PD0 on ATmega32U2.

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have the following code running on an ATmega32U2

int main ()
{
  DDRD = 0x3f;
  while (1) {
     PORTD = 0x0f;
     delay_ms (150);
     PORTD = 0x30;
     delay_ms (150);
  }
}

Can anyone explain why PD0 remains high impedance? (the led on there flashes if I short the pin with PD1.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rewolff wrote:
I have the following code running on an ATmega32U2

int main ()
{
  DDRD = 0x3f;
  while (1) {
     PORTD = 0x0f;
     delay_ms (150);
     PORTD = 0x30;
     delay_ms (150);
  }
}

Can anyone explain why PD0 remains high impedance? (the led on there flashes if I short the pin with PD1.

PORTD.0 pin is badly soldered.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, but I don't think so. I have PC2 (on the left of PD0) not connected to anything, and I can short it on the chip with PD0 to make the led on PD0 flash. (the code above doesn't have the PC2 flashing, but I tried that).

it would be very weird if my pushing against PD0 and PC2 or PD0 and PD1 would create the connection between PD0 and its pad, but when I try the voltmeter on PD0 alone, it wouldn't make that connection. Moreover, I tried the voltmeter on the pin itself, and it shows "0V" (and changing numbers between 1.5 and 3.5 on the pins that are actively flashing).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK. It must have been a "port ESD zapped" issue: The second board of the same design with similar (evolved) software works just fine.....