Currently, there are two messages in software: read and write. Both messages start with three words: sync, length (r/w), and address, as shown below. The length is set to a maximum of 511 words.
0xEB90 – Sync word
0000 00XL LLLL LLLL – X is zero for read and one for write, L is length in 16-bit words 0xAAAA – 16-bit bit address (last word for read command)
0xDDDD – first data word to be written at address AAAA (only for write commands)
0xDDDD – second word to be written at address AAAA+1
…
0xDDDD – last word to be written at AAAA plus the length or number of words
The hardware is set up for 16-bit data and addresses. The first four addresses are for the bus ID and version number. The address space 0xFE00 thru 0xFFFF is reserved for system messages.
0x0000-0x0003 – Bus ID
0x0004-0xnnnn – First user module
0xnnnn-0xFDFF – User module space
0xFE00-0xFFFF – Reserved
The word data is sent in little endian or least significant byte first. In our main example, with two modules and a serial interface, the lower byte of the sync word is sent first, then the most significant, and the same for the length and address words.
The address map for the following design is shown below:
0x0000-0x0000 – Interface ID
0x0004-0x0006 – Port output
0x0007-0x0208 – WS2811 output module
Sending the following three-byte read command will return the first 16 locations within the design, as shown below. The first four words returned are the bus interface identification module, followed by the output port module of three words, and then the WS2811 pixel output module. Each module returns its identification, length, and data. Multiple messages can be sent simultaneously and/or exist on the bus.
The write message is in the same format. It will be written to the first data location within module #2, or address 0x0009. These 6 words/12 bytes will set the Red/Green/Blue LED intensities for the four LEDs with the WS2811 string.
Currently, the interface waits until there are enough words to complete a write, without a timeout.
Copyright FPGA Magic, 2023