Is my chip broken?

Status
Not open for further replies.

csdidier

New member
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(n) (CLKPR = 0x80, CLKPR = (n))

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);
}
}

}
 
Sorry,

False alarm - - there is a short circuit in my breadboard, or faulty connections, or something. put meter up to the actual pins, and they are all fluctuating 0 to 5 V.
 
Status
Not open for further replies.
Back
Top