Atmega Port A dodgy

Hi!

I am using an Atmega644p. I am using Port A as an output but then setting all pins to low. But pins 6 and 7 seem to sit at 3 and 4 volts respectively. I cannot seem to make them go low.

My circuit is quite simple: Vcc - 5v, Gnd - 0v, AVcc - 5v, AGnd - 0v, reset - (ISP) - 4k7 - 5v, Mosi - ISP, Miso - ISP, SCK - ISP.

I am measuring voltages with a multimeter. The chip is running at 20Mhz.

Code goes:

DDRA 0b11111111;
PORTA = 0b00000000;

while(1==1)
{

}

I hope someone can point out what I am doing wrong!

Thanks! :slight_smile:

either something you’ve wired up is conflicting, or the chip’s I/O pins are defective, or you’ve got some peripheral function of the AVR enabled that uses those two pins, and overrides DDRA

Nit: I suggest not using ‘0b11111111’ and the like, since binary bit syntax is not in the C language per se. Better to use 0xFF.