I successfully programming one by hooking it up to 3.3v where 5v would normally go. This should be in the AVRs voltage input range, and will keep the JTAG header running at safe voltage for your Pi.
I had to press and hold the reset button in order to program, however, that may or may not be a symptom of my crusty old green prototype board.
You will need female to female jumper jerky to connect the header up to your Pi.
The header on the board will be pinned out thusly:
MISO [ ] [ ] 5V <-- Use only 3.3v!
SCK [ ] [ ] MOSI
RESET [ ] [ ] GND
I’m not sure what orientation its in, but the ground pin will have 4 little pips coming off its solder pad that connect to the ground plain, and the power pin will have a fatter trace running from it.
On my board, with the PICADE text orientated properly the GND and 3.3v are bottom left and bottom right.
You will need to enable SPI on your Pi, then connect the Picade to: https://pinout.xyz/pinout/spi
MOSI -> SPI0 MOSI
MISO -> SPI0 MISO
SCLK -> SPI0 SCLK
RESET -> SPI0 CE0
VCC -> 3.3v
GND -> GND
You then use the linuxspi programmer to flash the board, running avrdude
like so:
sudo avrdude -c linuxspi -p m32u4 -P /dev/spidev0.0 -U flash:w:picade_original.hex
You might want to replace the bootloader with the original Leonardo (compatible with the ATMega32u4 on the Picade) bootloader, which you can grab with:
wget https://raw.githubusercontent.com/arduino/Arduino/master/hardware/arduino/avr/bootloader s/caterina/Caterina-Leonardo.hex
And flash with:
sudo avrdude -c linuxspi -p m32u4 -P /dev/spidev0.0 -U flash:w:Caterina-Leonardo.hex
If you see:
pi@zerowstem:~/picade-sketch/update/other $ sudo avrdude -c linuxspi -p m32u4 -P /dev/spidev0.0 -U flash:w:picade_original.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x000000 (retrying)
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
Hold down RESET on the Picade PCB and that should change to:
pi@zerowstem:~/picade-sketch/update/other $ sudo avrdude -c linuxspi -p m32u4 -P /dev/spidev0.0 -U flash:w:picade_original.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9587
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "picade_original.hex"
avrdude: input file picade_original.hex auto detected as Intel Hex
avrdude: writing flash (6282 bytes):
Writing | ################################################## | 100% 1.64s
avrdude: 6282 bytes of flash written
avrdude: verifying flash memory against picade_original.hex:
avrdude: load data flash data from input file picade_original.hex:
avrdude: input file picade_original.hex auto detected as Intel Hex
avrdude: input file picade_original.hex contains 6282 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 1.42s
avrdude: verifying ...
avrdude: 6282 bytes of flash verified
avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)
avrdude done. Thank you.