Author Options:

How can I disable an avr's special pin functions? Answered

I'm using an ATMega8? I've set all PD to output. The PD4 (XCK/T0) and PD6 (AIN0) can't be controlled and stay high or low.


The forums are retiring in 2021 and are now closed for new topics and comments.

11 years ago

page 64 of the datasheet of the atmega8 talk about "Overriding signal for alternate function for port d" and we see that "ain0" (pd6) and "" (pd4) seem to have an override. the ACSR (Analog Comparator Control and Status Register) on page 194 have a bit, bit#2 called "Analog Comparator Input Capture Enable" try writting a 0 at this spot (or use logic AND 0xFB) just a guess... try the avrfreak forum, www.avrfreaks.net these guy propably know the answer. also, since the port were in an output state, if it was forced to some value, these pin might have died. those questions can be tricky... good luck!