why are high impedance pins having voltage

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

I am trying to make some pins of my avr high impedance(portd.7 & portc). however these pins do have some voltage on them ranging for 4.5 to 2.5. if i connect a led betwwen these pins and ground, the leds light up.

am i missing something

int main (void) 
{ 
 DDRD &= ~(1 << 7);
 PORTD &= ~(1<<7);
 DDRC =0X00;
 PORTC=0X00;
while(1)
 {
 }

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

Even in high impedance state there is some leakage current. With a high impedance voltmeter you will measure some voltage that is usualy different from 0. Most digital meters are 10 MOhms, some more expensive one even in the GOhms range, this is sensitive enough to get a reasonable voltage even from less than nA leakage.

If it is enough to see the ligth from a LED than there is something wrong. Some special funktions may override the data direction register, the JTAG Pins for example are often forgotten.