On this long journey, the last piece to upgrading machines B and C to the latest computers, and Xeno head design, is obtaining/reproducing the newer versions of the tongue and jaw boards as they had an old design (not compatible with the newer architecture?). There's also some speculation of differences in the rear most light board, one thing we can pretty much confirm is the power (yellow/black) to one of the boards is reversed in the revised design. Along with the boards, we're also manually making the wiring harnesses to mate them. We're making solid progress, and this post documents the jaw board programming and we've confirmed our boards working in an Alien LE.
This assumes you know a bit about Atmel programming, have a USB programmer, and have some blank (re)production jaw boards; we learned, we have, and we obtained. The below is kinda a brain dump with not great instructions, but it's better when I don't instruct on things I don't know well!
Used MacOS and downloaded the CrossPack AVR toolkit:
https://www.obdev.at/products/crosspack/download.html
alien_flash.hex code:
https://pastebin.com/3Yc2QiYD
--------------------------------------------------------------------------------------------------------------------
Dump flash from working jaw board:
$ sudo avrdude -c usbasp -p atmega328p -U flash:r:/Users/username/alienfw/alien_flash.hex:i
(flash:r: command reads flash)
It should respond like:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading flash memory:
Reading | ################################################## | 100% 20.54s
avrdude: writing output file "/Users/username/alienfw/alien_flash.hex"
avrdude: safemode: Fuses OK (H:07, E:D9, L:E2)
Note the Fuse settings of the working jaw board are:
High fuse bytes: 07
Extended fuse bytes: D9
Low fuse bytes: E2
The important change here is the low fuse bytes, which control the clock speed the code we're going to flash expects. The others were defaulted to 07 and D9 respectively on our run of boards, and didn't need to be changed.
$ sudo avrdude -c usbasp -p atmega328p -e -U flash:w:/Users/username/alienfw/alien_flash.hex:i
(-e erases ROM and EEPROM before programming and the flash:w: command writes the code to flash)
$ sudo avrdude -c usbasp -p atmega328p -U lfuse:w:0xE2:m
(write the bytes E2 to lfuse)
After these two commands, the jaw board should be programmed.
Other options to read/write are the eeprom, hfuse, and efuse but we found they didn't need to be changed; though we dumped them anyway.
So piecing it all together, it looks like this when writing a fresh board:
$ sudo avrdude -c usbasp -p atmega328p -e -U flash:w:/Users/username/alienfw/alien_flash.hex:i
Password:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "/Users/username/alienfw/alien_flash.hex"
avrdude: writing flash (1322 bytes):
Writing | ################################################## | 100% 0.86s
avrdude: 1322 bytes of flash written
avrdude: verifying flash memory against /Users/username/alienfw/alien_flash.hex:
avrdude: load data flash data from input file /Users/username/alienfw/alien_flash.hex:
avrdude: input file /Users/username/alienfw/alien_flash.hex contains 1322 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.82s
avrdude: verifying ...
avrdude: 1322 bytes of flash verified
avrdude: safemode: Fuses OK (H:07, E:D9, L:62)
avrdude done. Thank you.
$ sudo avrdude -c usbasp -p atmega328p -U lfuse:w:0xE2:m
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
avrdude: reading input file "0xE2"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.01s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xE2:
avrdude: load data lfuse data from input file 0xE2:
avrdude: input file 0xE2 contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.00s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: safemode: Fuses OK (H:07, E:D9, L:E2)
avrdude done. Thank you.