Serial Protocol

This page is dedicated to understanding the protocol between the Expeed chip (running B firmware) and the Toshiba TMP19 chip dedicated to I/Os (running A firmware). Most of the work was done by Simeon and Leegong, and I simply centralized the information here.

The protocol uses synchronous serial communication. It is based on messages of the form

  

Each field is stored on one byte, except, which is  bytes long

As a reply, the other chip acknowledges by sending back the byte, or 0xFF if there was an error decoding the message.

A number of variables are used in this process

Structures

Many aspects of the firmware rely on double linked lists, or dlists, which are composed of individusal elements of the form



each element holds two pointers, one pointing to the previous element (ptr_prev), one to the next element (ptr_next), and a value, or payload, which is the actual data.

The implementation uses a sentinel element to indicate an empty list, which is an element that has both ptr_prev and ptr_next pointing to the element's address.

dlists can be used as queues (FIFO), stacks (LIFO) or plain lists. In the case of CSIO, they are used as stacks, each new element being pushed in the first position, and each element to be processed being 'popped' from that position. To avoid confusion of such stacks with the program stack, I'll use here the name lifo.