Here is my code below:
The Pin "D1" is the only pin that goes from 0 Volts to 5.0 Volts.
The LED turns on at the same time D1 goes to 5.0 Volts.
Pins D0, D2, D3, D4,D5, D7 all stay at 0, however.
Pins C0, C1, C2, C3, C4, C5, C6, C7 all stay at 0V as well.
Am I doing something wrong, or is the chip broken?
Below is my code:
#include <avr/io.h>
#include <util/delay.h>
#define LED_CONFIG (DDRD = 255)
#define WIRE_CONFIG (DDRC = 255)
#define CPU_PRESCALE (CLKPR = 0x80, CLKPR = )
int main(void)
{
unsigned int i;
// set for 16 MHz clock, and make sure the LED is off
CPU_PRESCALE(0);
LED_CONFIG;
WIRE_CONFIG;
while (1) {
PORTC = 255;
_delay_ms(10000);
for (i=0; i<10; i++){
PORTD = 255;
PORTC = 255;
_delay_ms(1000);
PORTD = 0;
PORTC = 0;
_delay_ms(1000);
}
}
}
The Pin "D1" is the only pin that goes from 0 Volts to 5.0 Volts.
The LED turns on at the same time D1 goes to 5.0 Volts.
Pins D0, D2, D3, D4,D5, D7 all stay at 0, however.
Pins C0, C1, C2, C3, C4, C5, C6, C7 all stay at 0V as well.
Am I doing something wrong, or is the chip broken?
Below is my code:
#include <avr/io.h>
#include <util/delay.h>
#define LED_CONFIG (DDRD = 255)
#define WIRE_CONFIG (DDRC = 255)
#define CPU_PRESCALE (CLKPR = 0x80, CLKPR = )
int main(void)
{
unsigned int i;
// set for 16 MHz clock, and make sure the LED is off
CPU_PRESCALE(0);
LED_CONFIG;
WIRE_CONFIG;
while (1) {
PORTC = 255;
_delay_ms(10000);
for (i=0; i<10; i++){
PORTD = 255;
PORTC = 255;
_delay_ms(1000);
PORTD = 0;
PORTC = 0;
_delay_ms(1000);
}
}
}