Disabling JTAG on PrintrBoard - Get 4 more I/O pins
As I discovered while getting the Panelolu working with a Printrboard the JTAG interface is enabled by default. This uses 4 pins on one of the expansion headers:
In order to get access to these pins the JTAG interface needs to be disabled: to do this you have to change the fuses on the AT90USB1286 micro. An ISP is required (I use the Pololu AVR ISP) but others should work fine.
Warning: You can "brick" your micro if you mess up the fuse settings: handle with care and I don't recommend you mess with the clock settings!
Lincomatic describes how to set the fuses in his blog post on uploading a bootloader to the AT90USB1286. He has the following settings
LOW : 0xDE
HIGH: 0x9B
EXT: 0xF0
Using the fuse calculator at engbedded.com, start by selecting the AT90USB1286 and then put the DE,9B and F0 setting in at the bottom of the page. After applying these settings it is simple to deselect the "JTAG Interface Enabled" check box and recalculate the settings. The only one which has changed is the HIGH setting to 0xDB
Using the version of avrdude that comes with arduino 0023 change the fuse setting to disable the JTAG interface:
avrdude -c avrispv2 -p at90usb1286 -U hfuse:w:0xdb:m -C ..\etc\avrdude.conf -P com40
You will need to change the "-c avrisp2" to match your ISP and the "-P com40" to match the com port it's on.
Now that we have read-write access to those pins the connections for the Panelolu can use 1 less plug and stay on just one expansion header:
The pin allocations are:
With pin numbering of:
TDI = 42
TDO =43
TMS = 44
TCK = 45
The only change to the firmware from that described in my previous post is:
pins.h
#define LCD_PINS_D4 42
#define LCD_PINS_D5 43
#define LCD_PINS_D6 44
#define LCD_PINS_D7 45
#define LCD_PINS_D5 43
#define LCD_PINS_D6 44
#define LCD_PINS_D7 45
So if you have an ISP and want 4 more IO pins this is the way to go. If you are going to buy a Printrboard then ensure you get your supplier to change the fuses to disable the JTAG interface before sending it to you.
