LCD Displays

Having an LCD Display looks quite smart. it can display the current time, media information and menu choices at a glance and with a little patience, are fairly simple to install.
As an electronics novice, I managed to wire up an LCD panel fairly easily. The difficult part was getting the Pi to talk to the display. this was due to conflicting information on the'net so hopefully with this guide you wont have the same frustrations I did.

What You Will Need

  1. A Raspberry Pi with Raspbmc already installed (see here for details)
  2. A terminal program such as PuTTy to get command line access to the Pi.
  3. a GPIO cable.
  4. A Breakout board for the GPIO Cable
  5. A breadboard for assembling and testing.
  6. Some jumper wires
  7. an LCD display board 
  8. (Optional) a small PNP Transistor for backlight control
  9. (Optional) a 10K potentiometer for adjusting the contrast
The components you can get from your local Maplins store if you live in the UK. For the LCD board, I bought a DEM16217 board that cost about £16.99 although you can get a cheaper HD44780 board form eBay for only a few pounds, they both use the same software, the pins are only slightly different (On the DEM16217 the pinout has the backlight power, then the data pins while the HD44780 has the data pins, then the backlight power). I got the DEM board becasue I am an impatient sod.
the HD44780 also looks nicer than the DEM16217, it has a nice blue backlight and you can get a model with a  larger display (4x20 compared to the DEM's 2x16)

Wiring it up

For details on wiring up the display, I highly recommend Matthew Manning's website http://www.raspberrypi-spy.co.uk where he has a couple of great tutorials on wiring up the displays and testing them with a Python script. he has two tutorials for wiring up the Display, one simple and a slightly more advanced one for backlight control and contrast adjustment.
A Simple LCD Circuit
LCD Circuit with Backlight Control
I mainly followed the second tutorial, but didn't bother with the resistors on the backlight pins as the DEM16217 has the resistors already built in and with the the resistors in place, the backlight didn't come on at all, nor did I bother putting the  potentiometers to control the brightness or contrast.
This is how I connected it all up:
LCD PinLCD FunctionPi FunctionPi Pin no.
L++5v+5vP1-02
L-GNDConnect to PNP transistorTransistor Collector pin
1GNDGNDP1-06
2+5V+5VP1-02
3RSGPIO 7P1-26
4RWGNDP1-06
5EGPIO 8P1-24
6Data 0Not usedN/A
7Data 1Not usedN/A
8Data 2Not usedN/A
9Data 3Not usedN/A
10Data 4Not usedN/A
11Data 5GPIO 25P1-22
12Data 6GPIO 24P1-18
13Data 7GPIO 23P1-16
14Data 8GPIO 18P1-12

I connected the Emittor pin of the transistor to ground and the base to GPIO 11 (Pin P1-23) on the PI.
Here's a picture  of the LCD Display assembled and connected to the Pi

To work out the psitions on the pin, here is an image of the pin layout for the Revision 2 board of the Pi

Rev 2 Pi GPIO

So afte hooking all that up, I had this:

LCD

So let's assume you have followed Matthew's instructions and have the Display all wired up, we now have to look at how to get RaspBMC to talk to it.

Configuring the Pi.

  1. Use PuTTy to ssh to the PI
  2. First we need to install the LCD software, at the prompt, type "sudo apt-get install lcdproc' and press enter.
  3. the LCDProc software should download and install.
  4. for some reason, when I installed it, the driver for the hd44780 wasn't included. Fortunately Andy Pi, who hosts , wrote a driver specifically for the hd44780 with backlight support. To download it, type at the prompt 'cd /home/pi' and press enter
  5. Now type 'mkdir lcdproc' and press enter
  6. Now type "cd lcdproc' and press enter to go into the directory you just made.
  7. now type 'wget http://dl.dropbox.com/u/29632026/hd44780.so' to download the hd44780 driver
  8. We need to edit the LCDd.conf file so type 'sudo nano /etc/LCDd.conf' and press enter
  9. Change the drivers entry from 'Driver=curses' to 'Driver=hd44780'
  10. Change the DriverPath entry to read "Driverpath=/home/pi/lcdproc'
  11. use the keys "CTRL+W" to find the next occurrence of hd44780 and change the ConnectionType= line to read 'ConnectionType=rpi'
  12. Add the following lines
    D7=18
    D6=23
    D5=24
    RS=7
    EN=8
    BL=15
    If you have used different pins to connect to the LCD, this is where you can enter what pins are connected to which input. the BL line defines which pin is controlling the backlight. if you haven't wired up backlight control, don't bother with it.
  13. If you have the LCD wired for backlight control, change 'Backlight=no' to 'Backlight='yes'
  14. use 'CTRL+X@ to exit and save the changes.
  15. Reboot the Pi, it should now display 'LCDProc Server' and a heartbeat symbol on the LCD display.
  16. in XBMC, go to System, then Settings, then scroll down to System and on the Video Output screen check 'Enable LCD/VFD' - Note this doesn't appear to do anything so don;t panic.
  17. In System>Settings, go to AddOns and then selectt "Get Addons" and select 'XBMC.org Addons'
  18. Select 'Services' then down near the bottom of the list you should see "XBMC LCDProc", install and enable it.
  19. Congratulations, your LCD display should now be working!
IR Remote ->
Index
<- Configuring Live TV