Serial to HD44780
Although the Hitachi HD44780 LCD controller is old and its interface is not particulary pleasant to work with, it's still used just about everywhere. I use it a lot in my projects. So much so that I've decided to make this serial (UART or I2C) interface to save myself the work of routing its parallel interface yet again.
If PB4 is left floating (internal pullup), the selected interface is I2C (address 0x4c). If PB4 is shorted to GND (solder jumper marked UART next to T1), the selected interface is UART @ 9600 baud. When using UART, SCL equals chip's RX and SDA chip's TX (unused).
The protocol is byte oriented. Received bytes less than space (0x20) are command bytes, others are considered characters and are output to the display as data.
|0x01||go to start of line 1|
|0x02||go to start of line 2|
|0x03||go to start of line 3|
|0x04||go to start of line 4|
|0x0d||clear the rest of the line from current cursor position (emulated cr)|
|0x0a||go to next line (emulated lf)|
Bill of materials
|Qty||Value / Farnell code||Device||Size||Parts|
Resistor R1 is the backlight current limiting resistor and its value depends on your LCD's specs and the BL+ voltage you will be using. LCD pin 3 (contrast) is left floating. Depending on your LCD, you might need to connect a pot there.
To compile the sources, my AVR library is required. For fuse settings, take a look at the AVRDUDE_WRITE_FLASH variable in the makefile.