Difference between revisions of "Spi lcd 1.3 protocol"

From BitWizard WIKI
Jump to: navigation, search
(Created page with 'Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address. Afte…')
 
Line 1: Line 1:
 +
 +
The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).
 +
 
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.  
 
Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.  
  
 
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.  
 
After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.  
 +
 +
= write ports =
  
 
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.  
 
Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.  
Line 22: Line 27:
 
|-  
 
|-  
 
| 0xf0 || change address.  
 
| 0xf0 || change address.  
 +
|}
 +
 +
= read ports =
 +
The spi_lcd board supports two read ports:
 +
 +
{| border=1
 +
! port !! function
 +
|-
 +
| 0x01 || identification string.
 +
|-
 +
| 0x02 || read eeprom (serial number).
 
|}
 
|}

Revision as of 11:00, 14 February 2012

The addresses on the SPI bus are 7 bits wide. The lower bit specifies if the transaction is to be a read or a write. Write transactions have the lower bit cleared (0), read transactions have the lower bit set (1).

Each transaction on the SPI bus starts with the address of the board. The spi_lcd board will ignore any transactions on the SPI bus that do not start with its own address.

After the address a single byte indicates the "port" on the board that the data is written to. The software can thus define 256 ports on each board.

write ports

Some ports just set a single value. So writing more than one byte to such a port is redundant. Other ports are logically a stream of bytes. So writing more than one byte is encouraged.

The spi_lcd board defines several ports.

port function
0x00 display data.
0x01 write data as command to LCD.
0x10 any data clears the screen.
0x11 move the cursor to x, y. y is the top 3 bits, x is the bottom 5 bits of the data.
0x12 set contrast.
0x13 set backlight.
0xf0 change address.

read ports

The spi_lcd board supports two read ports:

port function
0x01 identification string.
0x02 read eeprom (serial number).