<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://bitwizard.nl/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Leelassen</id>
	<title>BitWizard Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://bitwizard.nl/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Leelassen"/>
	<link rel="alternate" type="text/html" href="https://bitwizard.nl/wiki/index.php/Special:Contributions/Leelassen"/>
	<updated>2026-04-05T22:09:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://bitwizard.nl/wiki/index.php?title=Spi_lcd_1.3_protocol&amp;diff=2561</id>
		<title>Spi lcd 1.3 protocol</title>
		<link rel="alternate" type="text/html" href="https://bitwizard.nl/wiki/index.php?title=Spi_lcd_1.3_protocol&amp;diff=2561"/>
		<updated>2013-05-16T12:48:44Z</updated>

		<summary type="html">&lt;p&gt;Leelassen: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
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). &lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
After the address a single byte indicates the &amp;quot;port&amp;quot; on the board that the data is written to. The software can thus define 256 ports on each board. &lt;br /&gt;
&lt;br /&gt;
Also see the [[general SPI protocol]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= write ports =&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
The spi_lcd board defines several ports. &lt;br /&gt;
{| border=1&lt;br /&gt;
! port !! function &lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || display data.&lt;br /&gt;
|- &lt;br /&gt;
| 0x01 || write data as command to LCD.&lt;br /&gt;
|- &lt;br /&gt;
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. &lt;br /&gt;
|- &lt;br /&gt;
| 0x09 || Set startup message line 2. &lt;br /&gt;
|- &lt;br /&gt;
| 0x0a || Set startup message line 3. &lt;br /&gt;
|- &lt;br /&gt;
| 0x0b || Set startup message line 4. &lt;br /&gt;
|- &lt;br /&gt;
| 0x10 || any data clears the screen. &lt;br /&gt;
|- &lt;br /&gt;
| 0x11 || move the cursor to line l, position p. &amp;lt;br&amp;gt;l is the top 3 bits&amp;lt;br&amp;gt;p is the bottom 5 bits of the data. &lt;br /&gt;
|- &lt;br /&gt;
| 0x12 || set contrast. &lt;br /&gt;
|- &lt;br /&gt;
| 0x13 || set backlight. &lt;br /&gt;
|- &lt;br /&gt;
| 0x14 || reinit LCD. &lt;br /&gt;
|- &lt;br /&gt;
| 0xf0 || change address. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= read ports =&lt;br /&gt;
The spi_lcd board supports two read ports: &lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
! port !! function &lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || identification string. (terminated with 0).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || read eeprom (serial number). &lt;br /&gt;
|}&lt;br /&gt;
= examples =&lt;br /&gt;
&lt;br /&gt;
== read identification ==&lt;br /&gt;
&lt;br /&gt;
read the identification string of the board. (&amp;#039;spi_lcd 1.3&amp;#039;). &lt;br /&gt;
{| border=1&lt;br /&gt;
! data sent !! data recieved || explanation &lt;br /&gt;
|-&lt;br /&gt;
| 0x83 || xx || select destination with address 0x82 for READ.  &lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || xx || identify&lt;br /&gt;
|-&lt;br /&gt;
| xx || 0x73  || &amp;#039;s&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || 0x70  || &amp;#039;p&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || 0x69  || &amp;#039;i&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || ... || etc. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Send text to display ==&lt;br /&gt;
Display the string &amp;quot;Hello World!&amp;quot; (only the first 5 bytes of the string shown). &lt;br /&gt;
{| border=1&lt;br /&gt;
! data sent !! data recieved || explanation &lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || xx || select destination with address 0x82 for WRITE&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || xx || datastream&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || xx  || &amp;#039;H&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || xx  || &amp;#039;e&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6c || xx  || &amp;#039;l&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6c || xx  || &amp;#039;l&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6f || xx  || &amp;#039;o&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || ... || etc. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== set cursor position ==&lt;br /&gt;
move to line 1, character 5:&lt;br /&gt;
{| border=1&lt;br /&gt;
! data sent !! data recieved || explanation &lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || xx || select destination with address 0x82 for WRITE&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || xx || port 0x11 = set cursor position. &lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || xx  || 0x25 = 001 00101 = line 1 position 5. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== define custom character ==&lt;br /&gt;
&lt;br /&gt;
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:&lt;br /&gt;
 82 01 40                        # set CGRAM char 0 line 0 &lt;br /&gt;
 82 00 01 02 04 08 10 10 10      # define character 0 (7 bytes)&lt;br /&gt;
 82 11 00                        # move to home position&lt;br /&gt;
 82 00 41 42 0                   # print characters A B and our newly defined character.&lt;br /&gt;
&lt;br /&gt;
Use 0x48 instead of 0x40 to define character number &amp;quot;1&amp;quot; (Up to 8 characters can be defined in CGRAM). &lt;br /&gt;
&lt;br /&gt;
the character data &amp;quot;01 02 04 08 10 10 10&amp;quot; is just an example. 11 11 11 1f 11 11 11 is the uppercase &amp;quot;H&amp;quot; that I have on my display right now. &lt;br /&gt;
&lt;br /&gt;
the last two lines are just a example of how to get back to &amp;quot;display&amp;quot; mode. It works for me I don&amp;#039;t have the inclination to find other ways.&lt;br /&gt;
&lt;br /&gt;
Getting back to display mode (DDRAM) and moving to home position (address 0) can also be done by sending: &amp;quot;82 01 80&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Showing a cursor/blinking cursor ==&lt;br /&gt;
&lt;br /&gt;
Show cursor position:&lt;br /&gt;
 82 01 0E  # cursor on&lt;br /&gt;
 82 01 0C  # cursor off&lt;br /&gt;
&lt;br /&gt;
Blinking (current position):&lt;br /&gt;
 82 01 0D  #blink on&lt;br /&gt;
 82 01 0C  #blink off&lt;br /&gt;
&lt;br /&gt;
== scrolling the display ==&lt;br /&gt;
&lt;br /&gt;
Send&lt;br /&gt;
 82 01 18&lt;br /&gt;
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).&lt;/div&gt;</summary>
		<author><name>Leelassen</name></author>
	</entry>
	<entry>
		<id>https://bitwizard.nl/wiki/index.php?title=Spi_lcd_1.3_protocol&amp;diff=2560</id>
		<title>Spi lcd 1.3 protocol</title>
		<link rel="alternate" type="text/html" href="https://bitwizard.nl/wiki/index.php?title=Spi_lcd_1.3_protocol&amp;diff=2560"/>
		<updated>2013-05-16T12:41:07Z</updated>

		<summary type="html">&lt;p&gt;Leelassen: /* define custom character */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
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). &lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
After the address a single byte indicates the &amp;quot;port&amp;quot; on the board that the data is written to. The software can thus define 256 ports on each board. &lt;br /&gt;
&lt;br /&gt;
Also see the [[general SPI protocol]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= write ports =&lt;br /&gt;
&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
The spi_lcd board defines several ports. &lt;br /&gt;
{| border=1&lt;br /&gt;
! port !! function &lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || display data.&lt;br /&gt;
|- &lt;br /&gt;
| 0x01 || write data as command to LCD.&lt;br /&gt;
|- &lt;br /&gt;
| 0x08 || Set startup message line 1. After setting the startup message please wait 100ms before sending the next line. &lt;br /&gt;
|- &lt;br /&gt;
| 0x09 || Set startup message line 2. &lt;br /&gt;
|- &lt;br /&gt;
| 0x0a || Set startup message line 3. &lt;br /&gt;
|- &lt;br /&gt;
| 0x0b || Set startup message line 4. &lt;br /&gt;
|- &lt;br /&gt;
| 0x10 || any data clears the screen. &lt;br /&gt;
|- &lt;br /&gt;
| 0x11 || move the cursor to line l, position p. &amp;lt;br&amp;gt;l is the top 3 bits&amp;lt;br&amp;gt;p is the bottom 5 bits of the data. &lt;br /&gt;
|- &lt;br /&gt;
| 0x12 || set contrast. &lt;br /&gt;
|- &lt;br /&gt;
| 0x13 || set backlight. &lt;br /&gt;
|- &lt;br /&gt;
| 0x14 || reinit LCD. &lt;br /&gt;
|- &lt;br /&gt;
| 0xf0 || change address. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= read ports =&lt;br /&gt;
The spi_lcd board supports two read ports: &lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
! port !! function &lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || identification string. (terminated with 0).&lt;br /&gt;
|-&lt;br /&gt;
| 0x02 || read eeprom (serial number). &lt;br /&gt;
|}&lt;br /&gt;
= examples =&lt;br /&gt;
&lt;br /&gt;
== read identification ==&lt;br /&gt;
&lt;br /&gt;
read the identification string of the board. (&amp;#039;spi_lcd 1.3&amp;#039;). &lt;br /&gt;
{| border=1&lt;br /&gt;
! data sent !! data recieved || explanation &lt;br /&gt;
|-&lt;br /&gt;
| 0x83 || xx || select destination with address 0x82 for READ.  &lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || xx || identify&lt;br /&gt;
|-&lt;br /&gt;
| xx || 0x73  || &amp;#039;s&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || 0x70  || &amp;#039;p&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || 0x69  || &amp;#039;i&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || ... || etc. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Send text to display ==&lt;br /&gt;
Display the string &amp;quot;Hello World!&amp;quot; (only the first 5 bytes of the string shown). &lt;br /&gt;
{| border=1&lt;br /&gt;
! data sent !! data recieved || explanation &lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || xx || select destination with address 0x82 for WRITE&lt;br /&gt;
|-&lt;br /&gt;
| 0x00 || xx || datastream&lt;br /&gt;
|-&lt;br /&gt;
| 0x48 || xx  || &amp;#039;H&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x65 || xx  || &amp;#039;e&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6c || xx  || &amp;#039;l&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6c || xx  || &amp;#039;l&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| 0x6f || xx  || &amp;#039;o&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| xx || ... || etc. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== set cursor position ==&lt;br /&gt;
move to line 1, character 5:&lt;br /&gt;
{| border=1&lt;br /&gt;
! data sent !! data recieved || explanation &lt;br /&gt;
|-&lt;br /&gt;
| 0x82 || xx || select destination with address 0x82 for WRITE&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || xx || port 0x11 = set cursor position. &lt;br /&gt;
|-&lt;br /&gt;
| 0x25 || xx  || 0x25 = 001 00101 = line 1 position 5. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== define custom character ==&lt;br /&gt;
&lt;br /&gt;
A usage of the 0x01 port is to define custom characters. Here in a less verbose format:&lt;br /&gt;
 82 01 40                        # set CGRAM char 0 line 0 &lt;br /&gt;
 82 00 01 02 04 08 10 10 10      # define character 0 (7 bytes)&lt;br /&gt;
 82 11 00                        # move to home position&lt;br /&gt;
 82 00 41 42 0                   # print characters A B and our newly defined character.&lt;br /&gt;
&lt;br /&gt;
Use 0x48 instead of 0x40 to define character number &amp;quot;1&amp;quot; (Up to 8 characters can be defined in CGRAM). &lt;br /&gt;
&lt;br /&gt;
the character data &amp;quot;01 02 04 08 10 10 10&amp;quot; is just an example. 11 11 11 1f 11 11 11 is the uppercase &amp;quot;H&amp;quot; that I have on my display right now. &lt;br /&gt;
&lt;br /&gt;
the last two lines are just a example of how to get back to &amp;quot;display&amp;quot; mode. It works for me I don&amp;#039;t have the inclination to find other ways.&lt;br /&gt;
&lt;br /&gt;
Getting back to display mode (DDRAM) and moving to home position (address 0) can also be done by sending: &amp;quot;82 01 80&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== scrolling the display ==&lt;br /&gt;
&lt;br /&gt;
Send&lt;br /&gt;
 82 01 18&lt;br /&gt;
to scroll the display one place left. Use 0x1c instead of 0x18 to scroll right. Replace 0x82 by the address of your display (e.g. 0x94 if you have an rpi_ui at the default address).&lt;/div&gt;</summary>
		<author><name>Leelassen</name></author>
	</entry>
</feed>