Difference between revisions of "SPI LCD"

From BitWizard WIKI
Jump to: navigation, search
(Future software enhancements)
m (Reverted edits by Rew (Talk) to last revision by Tom)
Line 8: Line 8:
 
== Assembly instructions ==
 
== Assembly instructions ==
  
The board comes assembled. No assembly required.
 
  
 
=== Possible Configurations ===
 
=== Possible Configurations ===
  
* The board could be configured with software for I2C.
 
* The seconde SPI connector can be jumpered to be the ICSP connector for the AVR CPU on the board.
 
  
 
== External resources ==
 
== External resources ==
Line 20: Line 17:
 
=== Datasheets ===
 
=== Datasheets ===
  
[http://www.atmel.com/Images/doc8006.pdf The datasheet of the Attiny44 processor] that is the "brains" of the board.
 
 
SPI connector:
 
[http://www.batsocks.co.uk/readme/isp_headers.htm We use the 6-pin header]. The pin labeled "RESET" when the connector is used as ICSP header should be labeled "slave select" when used for SPI datatransfer.
 
  
 
== Additional software ==
 
== Additional software ==
Line 32: Line 25:
  
 
== Pinout ==
 
== Pinout ==
 
=== SPI ===
 
[[SPI connector pinout]]
 
 
=== LCD ===
 
 
{| border=1
 
! pin !! name
 
|-
 
| 1 || VSS
 
|-
 
| 2 || VDD
 
|-
 
| 3 || VO (contrast)
 
|-
 
| 4 || RS
 
|-
 
| 5 || RW (GND)
 
|-
 
| 6 || EN
 
|-
 
| 7 || DB0 (NC)
 
|-
 
| 8 || DB1 (NC)
 
|-
 
| 9 || DB2 (NC)
 
|-
 
| 10 || DB3 (NC)
 
|-
 
| 11 || DB4
 
|-
 
| 12 || DB5
 
|-
 
| 13 || DB6
 
|-
 
| 14 || DB7
 
|-
 
| 15 || BL + (VCC)
 
|-
 
| 16 || BL - (PWM)
 
|-
 
|}
 
  
  
 
=== LEDs ===
 
=== LEDs ===
  
None. The board doesn't have leds. The next hardware revision might have a powerled.
 
 
== Power ==
 
 
The board can be powered from 3.3V or 5V. However the LCDs that I have don't work with a VCC of 3.3V.
 
  
 
== Jumper settings ==
 
== Jumper settings ==
Line 94: Line 40:
 
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.  
 
In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.  
  
See [[solder jumpers]] for more information on how to change the setting.
+
There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.
  
 
== Programming ==
 
== Programming ==
Line 116: Line 62:
 
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.  
 
0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.  
  
Other bytes between 0xf0 and 0xff are reserved and are currently implemented as a no-op.
+
Other bytes are reserved and are currently implemented as a no-op.
 
 
When you send a "read" request there are two different commands:
 
 
 
0x01: "Identify". The board will respond with "spi_lcd 1.2". The version number is subject to change of course. The string is zero-terminated.
 
 
 
0x02: "serial number". The board will respond with the 32-bit serial number. (After that the remaining bytes of the eeprom will be sent).
 
  
 
== The software ==
 
== The software ==
  
The attiny44 runs the software from here: http://www.bitwizard.nl/tw_spi/
 
 
The "tw_spi_general" package includes the code for the spi_lcd board in the lcd subdirectory.
 
 
A sample project which operates as a master is located here:
 
http://www.bitwizard.nl/spi_atmega/
 
  
 
== Default operation ==
 
== Default operation ==
  
By default the board boots up and shows "tiny-spi-LCD <version>" and the address on line 2.
 
 
The opening screen clears automatically when you first send any data.
 
 
Future versions of the software may allow changing the opening text through the SPI interface.
 
 
== Physical size ==
 
 
The board is 50x20mm. The mounting holes are 3mm from the edges. So the distances between the holes are 47x17mm.
 
  
 
== Future hardware enhancements ==
 
== Future hardware enhancements ==
  
* power led.
 
  
 
== Future software enhancements ==
 
== Future software enhancements ==
  
* Allow customization of the opening text.
 
* Allow different sizes of LCDs.
 
* Allow use of the spare eeprom bytes.
 
  
 
== Changelog ==
 
== Changelog ==

Revision as of 20:52, 8 February 2012

The SPI_LCD board
The SPI_LCD board

This is the documentation page for the SPI_LCD board.

Overview

Assembly instructions

Possible Configurations

External resources

Datasheets

Additional software

Related projects

Pinout

LEDs

Jumper settings

There are two solder jumpers. The one between the two 6-pin SPI connectors controls the function of the SPI connector nearest the I2C connectors.

In the default configuration the second SPI connector is a daisy-chain connector for the SPI bus. In the other configuration, the second SPI connector is the ICSP connector.

The second solder jumper connects "rs" and "vo" of the LCD together (and to one pin of the attiny44 controller on the board) in the default configuration. In the other configuration, the pin used for SPI slave select can be used as the RS pin. This is used in the I2C configuration.

There is a 10 mil (very small) PCB trace in the solder jumper in the default configuration. You'll have to cut this trace to move the solderjumper to the other position. If you later decide you want the other configuration again, some solder-wick can be used to remove the solder from one position and then it can be added to the other position.

Programming

To display a string on the LCD, just send over SPI the same bytes you would send to LCD, prefixed with the address of the LCD (the default address is 0x82).

Bytes above 0xf0 are "special".

0xf0 <xy> is set cursor. the <xy> byte is 3 bit line number and 5 bit position number. This addressing allows up to 8 lines of 32 characters.

0xf1 is clear LCD.

0xf2 <addr> is "set address". If you want to change the address the module reacts to. The address is stored in eeprom, and will remain this way after a powercycle.

0xf3 <contrast> is "set contrast". This will set the contrast to the value you specify. 0x40 is the default that works fine for the LCDs that we have.

0xf4 <backlight> is the "set backlight intensity" command. This will set the backlight intensity to the value specified.

0xf5 <byte> will send the byte as a command to the HD44780. You need this for example to use the user-defined characters.

0xff <byte> will send the byte to the LCD without special character processing. This allows you to send codes 0xf0 through 0xff to the LCD if required.

Other bytes are reserved and are currently implemented as a no-op.

The software

Default operation

Future hardware enhancements

Future software enhancements

Changelog

1.2

  • Initial public release