Version 3.0 beta firmware is now available. This allows for reading and writing to SEQ files located on the SD card.
As of 10/3/2011, I have updated the firmware in the PETdisk to version 1.1, and the microcontroller in the PETdisk has been switched to an ATMega168. Now using a bootloader, you can update the firmware on the chip directly from the SD card.
Here’s how to do it:
- Format your microSD card with the FAT32 filesystem.
- Copy a firmware file onto the SD card. This must be the first file copied onto the card after formatting in order for the bootloader to find it.
- With the PETdisk disconnected from power, insert the microSD card with the firmware into the PETdisk’s microSD slot.
- Power up the PETdisk. Within about 5 seconds of powering up, the bootloader will locate the firmware file and reprogram the memory of the ATMega168 chip.
- When the application is loaded onto the card, the bootloader jumps to the application and runs it. Upon launching, the application code will check for the existence of a firmware file and delete it if it exists. This is to prevent the program memory from being rewritten repeatedly upon powerup, which would shorten the life of the microcontroller chip.
That’s it! You can also create custom firmware builds and flash them onto the chip using this same procedure. Here are the specifications of the firmware file:
- The firmware file is a raw binary file with the exact contents of the program memory for the ATMega168. It is not an intel hex file (which AVR studio generates), but can be converted from one.
- The file must be exactly 14336 bytes in length. This is the exact size of the remaining memory remaining in the chip after the bootloader is programmed. (2048 bytes).
- The card containing the file must be formatted with FAT32 and the firmware file must be the first file copied onto the card.
- The name of the firmware file must be of the form:
where the * can be any character. FIRMWARE.BIN and FIRM011A.BIN are both valid.
Source code for the bootloader and for the v1.1 PETdisk application will be posted here soon.
For those enterprising souls who want to build their own version of the PETdisk from scratch, or who want to examine/modify the PETdisk firmware, I’m providing the full schematics of the board and the source code for the firmware.
Source code is licensed under the GNU GPL license.
Firmware Version 2.0, with support for subdirectories:
The 2.0 firmware supports subdirectories on the SD card. To support this, I’ve added a few new Commodore DOS-ish commands:
Change to parent directory:
Change to root directory:
LOAD:”$:/”,<devicenumber> or LOAD”$:\”,<devicenumber>
Firmware Version 3.0 beta – supports reading and writing to SEQ files:
Version 3.0 beta (SEQ file support)
- When loading programs with long filenames (greater than 8 characters), the load will fail if the extension is not .prg on the SD card. This is case sensitive, so only .prg (lowercase) will work, .PRG will fail. This is not intended behavior, and will be fixed in the next firmware revision. For now the workaround is to rename long filenames to have a lowercase prg extension. (This is fixed in the v1.1 firmware)