3
\$\begingroup\$

I want to use the PC2 pin on my ATmega164-1284PA series of microcontrollers and it's not working no matter what I do. I even wrote a minimal test case that only sets it as an output and toggles the pin with a one second delay. Not even that works. What's the problem?

\$\endgroup\$
6
\$\begingroup\$

I wasted a lot of time on this. You need to disable JTAG with the fuse bits to use PC2, PC3, PC4 and PC5.

According to the datasheet

in reset. When programmed, the input TAP signals are internally pulled high and the JTAG is enabled for
Boundary-scan and programming. The device is shipped with this fuse programmed.

This means that for the pins to act as regular pins you need to disable JTAG.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ You don't need to change any fuses. Just disable JTAG from the MCUCR. \$\endgroup\$
    – asdfex
    Oct 17 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.