It's already been well of a year since I last made an update, but I promise the project is not abandoned! Fellow hacker @Erik Bartmann pointed out to me (thank you!) that I had an error in my revision A schematic. It turns out it made the entire circuit very unstable, which means I'll have to make a new revision of the schematic and order new boards. However, I'll leave the details of the schematic update to the next project log.
Last time I worked on the project, I started prototyping a simple graphical user interface in Java. The data itself is sent over a serial interface, so I have the need of a simple transfer protocol. I could use something like XMODEM, but I think it's more fun to make something myself.
I figured I wanted some sort of message passing protocol, so I sketched the following data structure:
The first three data fields make up the header. The magic word is used to identify the start of a message (this is set to 0xBEEF). With this message structure, a message can be at most 262 bytes long, with a maximum payload of 256 bytes. The Message ID is used to decode the payload. After the payload there is a CRC-16 checksum, used to validate the data before potentially writing to the EEPROM. The checksum is calculated on the header and the payload together.
The structure of the payload data depends on the message. With some messages the payload may even be zero-sized. Here's a table of the messages so far (there may be more coming):
|Message ID (hex)||Name||Direction||Description|
|0x00||-||-||Reserved (not used)|
|0x01||Erase||To device||Erase the entire EEPROM|
|0x02||EraseAck||To client||Acknowledge the erase|
|0x03-0x0F||-||-||Reserved (not used)|
|0x10||WriteBlock||To device||Write a 64 byte data block to the EEPROM|
|0x11||WriteBlockAck||To client||Acknowledge the block write|
|0x12-0x1F||-||-||Reserved (not used)|
|0x20||ReadBlock||To device||Read a 64 byte data block from the EEPROM|
|0x21||ReadBlockAnswer||To client||Read response with 64 byte data|
|0x22-0xFE||-||-||Reserved (not used)|
|0xFF||-||-||Reserved (null message)|
I'll omit the message details and leave that to the avid source code reader to find out :-)