![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hi guys, I was doing some work over the weekend with my LCD that i bought second hand off my friend at work. I don't know the brand or chipset that it uses all i know is that it has 16 pins: 8 pins are for data 2 pins are for the LED lighting 2 pins are for power. 1 pin for contrast and 3 other pins called: Enable RS and R/W Does anyone know what these last 3 pins actually do/ Require for operation??? I'm totally lost with this. I've had no luck on google, and i've had no experience with LCD's before. And i'm really desperate for some kind of explanation!!! Thanx in advance
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | #2 |
|
Hi pike, :wink: As your mentioned, if the LCD is 16 pins, i think this link would be suitable for you...if it is a standard format. http://stalmp3box.sourceforge.net/JM162ASPEC.pdf | |
| |
| | #3 |
|
thanx for that MonkeyXP. Although I am still pulling my hair out over the "Enable"" pin. Anyone else?
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | #4 | |
| Quote:
| ||
| |
| | #5 |
|
You DO need the enable PIN.... I was kind of lazy to write something up since you should be able to find that information about everywhere on the net.... but here it goes :wink: A standard LCD module comes with 14 pins (sometimes 16) - 8 Dtata Lines (D0-D7) - 3 Control Lines (RS, W/R, E) - 3 Power Lines ( Vdd"+", Vss "-", Vee-Contrast Control "Sometimes negative") :arrow: The Vee (if not a negative source required) can be obtain with a Potenciometer connected between Vdd and Vss. :arrow: The Data lines D0-D7 are bus lines where information can be transfered from AND to the display. There are two modes of transmitting data 8-bits (using all 8 lines) at a time... or using nibbles (transmiting 4 bits, twice). Either way you are always transmitting 8-bits of data. When transmitting characters you will need to refer to a ASCII table most of the time. When transmitting commands you will need the commands intruction set for the LCD :arrow: On the control side, we have the RS- Register Select. At this time I would like you to see the back of the LCD and check the chip that is in it. The most common is a HD44780 or similar. You can do a google search if yours is different and check the instruction set. Back to the RS.... you can send characters to the LCD or Commands such as position the cursor on the second line. To diferenciate between what you are sending if a command or Data you have to manipulate this line. If the RS line is set high, the LCD will interpret any information in its D0-D7 as a character. If the RS is Low then the LCD will read its D7-D0 and interpret that as a commands, according to its Instructions Set. :arrow: R/W is the Read/Write line control... as you can probably guess they control weather you want to send data to the LCD or recieve information form the LCD. Most application you only want to send data to the display therefore you pull this line low in hardware, so you don't waste pins on your controller. :arrow: And with the infamus E- Enable control input. This pin is used to tell the LCD that the data in its port is ready to be read and that the RS and R/W are also set. This Enable line is kept normally LOW and pulsed HIGH for a X amount of time (depending on your chip set). When the transition from low to high is detected on the pin E then and only then the data in the D0-D7 port will be read. :arrow: Other things to consider... a LCD when powered up needs to go thru its initialization process, before you can send any commands to it. When powered up there are also certain "defaults" that the LCD starts with, such as Display is OFF (so altough you have power the LCD, it won't show characters sent), therefore in your LCD controller you must turn the LCD display ON.... certain cursor properties will be in default too... like Cursor OFF, etc. The controller CHIP intruction set will tell you what are the defults. :idea: So the first thing you should do is get the instrucion set for your LCD controller. Here is a link to the HD44780..... try also looking for the specs on your LCD online... a google search will help you with something. Well I hope it helps you some, Good Luck Ivancho | |
| |
| | #6 | ||
| Quote:
(just kiddin')
| |||
| |
| | #7 |
|
recently i try to interface PIC with Nokia 3310 LCD. Is there any PICBasic example code for it?
| |
| |
| | #8 |
|
most Nokia LCD's use I²C. There's info about their protocol on the net. Doing the I²C itself is easy with picbasic as it is a built in command | |
| |
| | #9 | |
| Quote:
And it has been quite a while | ||
| |
| | #10 |
|
Thankyou very much Ivancho!! That has helped me alot!!Just two other curious questions: -Would this mean I can control multiple LCD's, provided i have the ENABLE pins on different outputs of the microcontroller??? -How long should i keep the enable pin high for, so the LCD has time to react?? Thanx again!!
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | #11 | |
| Quote:
This is all I use to pulse the enable line, I added the NOP just as good practice, it will probably work fine without it. It works happily at either 4MHz or at 20MHz with all LCD's I've tested it on. Code: Pulse_e bsf LCD_PORT, LCD_E nop bcf LCD_PORT, LCD_E retlw 0x00 | ||
| |
| | #12 | |
| Quote:
How long your enable should remain high depends on the manufactureer.... But it is not something that will be to high.... the minimum for a HD44780 based LCD would be in the nano seconds, something like 450nSec minimum...... and it must remain low for another 550nsec..... That means a total of 1usec.... if you need something that reacts faster than that.....mmm..... :wink: Make sure that you have the LCD datasheet, they are easily obtain..... that way you can see the timing tables, memory locatoins, etc. Good Luck Ivancho | ||
| |
| | #13 |
|
- Removed (double post) ops:
| |
| |
| | #14 | |
| Quote:
| ||
| |
| | #15 |
|
Thankyou very much, guys You guys deserve a medal!
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
|
| Thread Tools | |
| Display Modes | |
| |