Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Is my chip broken?

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    2

    Is my chip broken?

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

    }

  2. #2
    Junior Member
    Join Date
    Jul 2013
    Posts
    2
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •