secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

adding this screen help please.

Tue Jul 31, 2012 3:37 pm

http://www.ebay.co.uk/itm/Display-LCD-M ... 27bc39382b

thats the module, basically i want to get it to output certain data while watching video files.

i.e

line 1: video file name
line 2: file length
line 3: time played
line 4: time left

i'll be using raspbmc but im NOT a programmer so i was wondering if anyones able to help me out on this?

i dont know which pins go to which header on the pi either, so i really need some step by step help from the very beginning.

its part of my "Pi Center" case project (logged under cases)

really appreciate it.

calebzulawski
Posts: 46
Joined: Tue Jan 31, 2012 6:00 am

Re: adding this screen help please.

Tue Jul 31, 2012 3:49 pm

secretreeve wrote:i dont know which pins go to which header on the pi either, so i really need some step by step help from the very beginning.
As far as I know, it's fairly dangerous (not to you, but to the Raspberry Pi), to interface directly to the GPIO pins. You'll also need to build some sort of buffer circuit to match the appropriate voltages and power for each device.

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Tue Jul 31, 2012 4:03 pm

any chance you can expand on that? it all went over my head.

other than the gpio pins, how would i go around connecting to it? i mean, isnt the point of the gpio to connect to the pi?

calebzulawski
Posts: 46
Joined: Tue Jan 31, 2012 6:00 am

Re: adding this screen help please.

Tue Jul 31, 2012 4:14 pm

Sorry, I was a little unclear. The GPIO pins on the Pi have absolutely no protection AFAIK. If you overvolt them or draw too much current, there may/will be problems that would permanently destroy things. The voltage levels on the GPIO pins are 3V3 (meaning 3.3 volts) and directly interfacing 5V components will overvolt the RPi and cause damage. Some sort of buffers (I've seen transistors, relays, etc used) must exist between the RPi and the LCD to match the voltage levels for each device.

This also seems to be a lot of programming, at least for a non-programmer, to undertake. I don't use the pi for video playback, so I'm not sure of the current status of video players, but some sort of plug-in would have to be written for the video player to extract this data, or the player would need to be rewritten to support this, unless the video player(s) have some interface for extracting this information.

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Tue Jul 31, 2012 4:21 pm

oh, wait....crud!

didnt realise it was a 5v screen lol. i'll probably draw its power supply from else where, on the case thread someone posted a pico power supply, after posting how it might not work, i realised how it can work so i'd only need to connect to the gpio of the PI to access the relative data, not to power the screen.

it does sound like alot of programming, which is why im hoping a kind soul around the forums will be able to help out with this lol. its alot to ask i know, but im sure i wont be the only one who would benefit from it greatly.

User avatar
rpdom
Posts: 17189
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: adding this screen help please.

Tue Jul 31, 2012 5:09 pm

That display looks like it's based on a HD44780 clone chip. If so, it's pretty easy to interface to a Pi (I've got a 2 line x 16 char display running right now), with no extra components needed. Search the forums for HD44780 for wiring details and sample programs in Python and C.

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Tue Jul 31, 2012 5:50 pm

cheers, i'll look into the wiring.

just need help with the programming side now

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Tue Jul 31, 2012 9:01 pm

well i spent a little time measuring up some wire, soldering on crimps and insterting said crimps into the "housings". used double crimp holders so they're nice and stable.

thanks for that link i'll pick up a screen at some point and to work on it

majassow
Posts: 9
Joined: Wed Jun 27, 2012 4:15 am

Re: adding this screen help please.

Wed Aug 01, 2012 9:53 pm

An option which would involved less programming (and fewer wires) would be to use a serial LCD display. They are a little more expensive than the parallel version, but you only need to connect three wires from GPIO to the LCD, comment out a few configuration items on the 'Pi to disable console using the UART, and you are able to display text using a simple echo commands (e.g. "echo 'Hello' > /dev/ttyAMA0").
Here is one place you can find the instructions on disabling the console from using the UART:
http://www.irrational.net/2012/04/19/us ... rial-port/
[you don't need the voltage level shifter for 1-way communication between the 'Pi and the LCD].
Just hook up the GPIO:GND -> LCD:GND, GPIO:5v -> LCD:5v, and GPIO:Tx -> LCD:Rx and you will be all set.
--Michael

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Wed Aug 01, 2012 10:03 pm

well i've already sorted out the wiring for the screen, i only need the screen itself and abut 5 min of soldering lol.

thats thats a good write up, thanks

majassow
Posts: 9
Joined: Wed Jun 27, 2012 4:15 am

Re: adding this screen help please.

Wed Aug 01, 2012 11:55 pm

No problem. I just mentioned this option because of your programming comment above.
You WILL need to write and compile code for the parallel LCD solution, but there are libraries out there that can help you a bunch. Check out:
https://projects.drogon.net/raspberry-p ... d-library/ for a very detailed description for both hooking up a parallel LCD and incorporating a C module in your own program for accessing the display.
--Michael

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Sun Aug 05, 2012 2:00 am

well i ordered the screen, it'll be here next week.

i also took a look at the programming side and i feel so far out of my depth its unrealistic!

looking through the libraries and so in have no idea which ones will make the Pi see it, which ones are for outputting data and have no idea how t modify anything or write any of it for getting playback file name and playback current time and total file length to output to it.

i really could do with someone to help me out here. a tutor so to speak. anyone willing to jump in on that one?

6677
Posts: 383
Joined: Wed Mar 14, 2012 9:23 pm

Re: adding this screen help please.

Sun Aug 05, 2012 1:46 pm

secretreeve wrote:oh, wait....crud!

didnt realise it was a 5v screen lol. i'll probably draw its power supply from else where, on the case thread someone posted a pico power supply, after posting how it might not work, i realised how it can work so i'd only need to connect to the gpio of the PI to access the relative data, not to power the screen.
greatly.
No, I don't think you understood that properly.
Even the IO pins on the screen draw power at 5 volts whereas the pi is 3.3 so EACH pin needs some sort of protection on it to prevent damage to the pi, alternately sometimes those displays are available in dedicated 3.3V versions which would work with the pi without issues

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Sun Aug 05, 2012 2:18 pm

erm if you check out some of the links then it shows how to set it to run on 3.3v via the wiring.

its done now, i just need the help with the programming side of this

User avatar
rpdom
Posts: 17189
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: adding this screen help please.

Sun Aug 05, 2012 2:42 pm

6677 wrote:Even the IO pins on the screen draw power at 5 volts whereas the pi is 3.3 so EACH pin needs some sort of protection on it to prevent damage to the pi
No. If the display is truely HD44780 compatible (which is probably is), then the I/O pins are buffered and accept (not draw) anything over 0.7V as a high value, and anything under that as low. The current draw which is the important thing, is around 0.05mA, which is well within the capabilities of the Pi.

What is more important is the Output voltage of the data pins, but as we don't need to read them (R/W pin is clamped low, so Write mode only), we don't have to worry about that.

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Mon Aug 06, 2012 2:56 pm

so the screen arrived today, i got it all wired up and it turns on fine!

i get 1 row of white blocks which im assuming is a good thing, contract pot works alright.

if someone can really help me out with the programming on getting it to display the playing file and current runtime/total runtime of the file in raspbmc i'd be forever grateful as it'll help me on the way to learning how to program as well.

im also eager to see the screen working with information on it

holmez
Posts: 31
Joined: Sat Mar 31, 2012 6:39 pm

Re: adding this screen help please.

Thu Aug 09, 2012 9:43 am

Should be fine. It seems to be a fairly common plan. See here.

You're basically using 6 GPIO pins as output to feed:
RS and E (control pins on the screen)
DB4-7 (the 4 data bus pins)
You will need to make sure to connect R/W pin to the ground.
Other advice has been to connect DB0-3 to ground as well (although I found it unnecessary in my case)

You will then transmit data in 4-bit mode (sending high 4 bits followed by low 4 bits).

I've managed to code a 1x16 lcd screen based on the ST7066U driver.

Secretreeve: Can you see the model number of your lcd screen?

User avatar
MattHawkinsUK
Posts: 538
Joined: Tue Jan 10, 2012 8:48 pm
Location: UK
Contact: Website

Re: adding this screen help please.

Thu Aug 09, 2012 11:16 am

Just tested my 20x4 LCD module. Very similar to 16x2 modules with just a few Python tweaks.

Here is my write up :
http://www.raspberrypi-spy.co.uk/2012/0 ... ng-python/

I use 7 GPIO pins. 4 for the data, 2 for the control and 1 for a backlight switch. In my application I don't want the backlight on 24/7 so I switch it on and off with a transistor. I also added a trimming pot so I could adjust the voltage to the contrast pin. This allows you to better adjust the display so you can reduce the "square blocks" that appear behind each character.

Had to mess about getting the 4 line addresses correct but once that was sorted it works the same as a 16x2 device.

Line 3 is a continuation of Line 1 and Line 4 is a continuation of Line 2. You'll notice the Line address of Line 3 is +20 (decimal) the address of Line 1. The same is true for Line 2 and Line 4.
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook, Pinterest and Twitter (@RPiSpy)

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Thu Aug 09, 2012 3:03 pm

hi holmez, no i cant see a model number but its based on the HD44780 screen.

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Thu Aug 09, 2012 4:39 pm

erm okay, so apprently XMBC support proclcd (so assuming raspbmc does as its based on xbmc) this would be the "settings code"

Code: Select all

[align=left][font=monospace]<lcd>
  <rows>4</rows>                          <!-- Number of rows to use for the LCD. -->
  <columns>20</columns>                   <!-- Number of columns to use for the LCD. -->
  <address1>0</address1>                  <!-- Memory address for row 1. -->
  <address2>20</address2>                 <!-- Memory address for row 2. -->
  <address3>64</address3>                 <!-- Memory address for row 3. -->
  <address4>84</address4>                 <!-- Memory address for row 4. -->
  <heartbeat>true</heartbeat>             <!-- Enables LCDprocs heartbeat symbol. Defaults to false. -->
  <dimonscreensave>true</dimonscreensave> <!-- Turns of the LCD/VFD backlight while screensaving. Defaults to false. -->
  <scrolldelay>2</scrolldelay>            <!-- Delay of the scroller widget. Defaults to 1. -->
  <hostname>host.example.com</hostname>   <!-- Hostname of the lcdproc server. Defaults to localhost. -->
</lcd>[/font]
[/align]
so should i change that to this

Code: Select all

[align=left][font=monospace]<lcd>
  <rows>2</rows>
  <columns>16</columns>
  <address1>0</address1><line>$INFO[VideoPlayer.Title] $[MusicPlayer.Title]</line>
  <address2>16</address2><line>$INFO[LCD.PlayIcon] $INFO[Player.Time]/$INFO[Player.Duration]</line>
  <address3>64</address3>
  <address4>84</address4>
  <heartbeat>false</heartbeat>
  <dimonscreensave>false</dimonscreensave>
  <scrolldelay>4</scrolldelay>
  <hostname>localhost</hostname>
</lcd>[/font]
[/align]
dimonscreensave = false due to no control from pi
heartbeat = false (i dont know what the hell this is so make sure it goes to false)

also, what do i do with the 3rd and 4th lines as i only have 2 lines on my screen?

and if thats not correct above, what the heck do i change it to? lol also, thats only for the video player as best i can work out. how should it look for things like the music player and the video player?

or would they be two seperate batches of code? like

<video settings stuff>
<align>
<align>
<music settings stuff>
<align>

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Thu Aug 09, 2012 5:35 pm

slightly revised code.

could still be wrong, if it is, please advise.

Code: Select all

[align=left][font=monospace]<lcd>
  <rows>2</rows>
  <columns>16</columns>
  <address1>0</address1><line>$INFO[VideoPlayer.Title] $[MusicPlayer.Title] $[MusicPlayer.Artist]</line>
  <address2>17</address2><line>$INFO[LCD.PlayIcon] $INFO[Player.Time]/$INFO[Player.Duration]</line>
  <address3>33</address3>
  <address4>49</addresss4>
  <heartbeat>false</heartbeat>
  <dimonscreensave>false</dimonscreensave>
  <scrolldelay>4</scrolldelay>
  <hostname>localhost</hostname>
</lcd>[/font]
[/align]
could still use a hand with the driver side aspect though :)

secretreeve
Posts: 330
Joined: Mon Feb 20, 2012 8:39 am

Re: adding this screen help please.

Fri Aug 24, 2012 3:25 pm

hi

i've got my lcd wired up like on this site

http://www.raspberrypi-spy.co.uk/2012/0 ... omment-485

exception being a 3.3k resistor instead of 5600

but the contrast is to high you can only see the output from a high angle.

with the contrast pin being tied into the gnd i dont know how to decrease the contrast.

can someone help with that please?

recantha
Posts: 209
Joined: Mon Jun 25, 2012 10:41 am

Re: adding this screen help please.

Wed Oct 03, 2012 9:26 pm

I've got the same problem as the other poster - a row of white blocks but nothing happens when I try to output to the LCD.
Anyone know what this means?
My Raspberry Pi blog with all my latest projects and links to articles
http://raspberrypipod.blogspot.com. +++ Current project: PiPodTricorder - lots of sensors, lots of mini-displays, breadboarding, bit of programming.

Return to “Other projects”