AdSense

Wednesday 3 July 2013

ATMega - Disable JTAG

(Deutsche Version) Whoever used an ATMega and wanted to use the channels PC2..5 knows this problem: the channels do not behave as they should. The reason is JTAG which blocks these channels. To disable JTAG, you only have to add the following lines to the beginning of your program:

MCUCSR = (1<<JTD);
MCUCSR = (1<<JTD);


Due to some (mysterious) security issues, the command has to be written twice, otherwise JTAG will not be disabled. Now the channels PC2..5 should behave as they should.

No comments:

Post a Comment