lcd interfacing

hi .i m interfacing 16x2 lcd to my P89LPC935 but i m unable to get the desired output.i hav tested many times and also the program is correct as i m able to debug it & observe the output correctly.i hav also replaced my lcd one time. i m using HY-1602F6 lcd module.i hav checked my pin configurations again & again but the lcd is just flashing with backlight voltage input pins. i m getting only blocks of one row display with no character when i change the contrast.

Could anyone helpme out in this as i hav to complete my project with this lcd module soon .also i would be thankful if anyone could suggest anyother lcd module for reliable & low cost operation.

Reply to
abhay
Loading thread data ...

The first answer to this problem is:

Power On Reset you have to have a significant delay, Many milliseconds, before attempting to intitialise an LCD. See your data sheet

martin

Reply to
martin griffith

How have you determined the timing and delays of your program?

No doubt using a HD44870 or clone controller chip.

What do you mean by 'flashing'.

What delays do you have between writes to the display?

What are your initialisation delays?

Are you sure you are configuring 4 and 8 bit transfer correctly.

How are you determining that your end is right?

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
              GNU H8 & mailing list info
             For those web sites you hate
Reply to
Paul Carpenter

i hav done my lcd interfacing through delay function & through polling of busy flag. in delay program i gave a delay of 250ms. by flashing i mean to say that the lcd is lit when i switch on the power but it displays only one line (the bricks in one line)& i hav correctly checked my configuring for 8 byte data transfer. my initialisation instructions are 0x38h,0x80h,0x06h,0x0Eh,0x01h. i hav read the datasheet & recommended delay was of 1.64ms & 40usec for some instructions So tomake program simpler i tried with 3ms delay for each instruction. i m having a doubt in initialising commands.do i need to initialise something else? also is there something that i could do with my lcd module itself(like any jumper setting) although i hav tried with that also but of no use

Reply to
abhay

Is the LCD drive voltage right? Some of these LCDs need a negative voltage on the drive, say generated by a 7660 inverter. Other LCDs need Vo sitting on a potentiometer between Vss and Vdd.

Would this information help some :)

formatting link

The approach I've used in the past is to literally bit bang the port with quite messy code, and then once the timings and LCD works, I then manage the output via a timer so that everything is precise. Each manufacturer's LCD is just slightly different in how it does things.

Are you reading the busy flag? This may be another approach.

Can you enable RS232 on your microcontroller so you can see what's going on?

You will get there, it'll eventually work :-)

Reply to
Aly

Extract from

formatting link

" If you are going to use these types of displays, heed this warning! The manufactures use the term Vcc-Vee to describe the LCD bias voltage. This is actually a NEGATIVE voltage! (At least all that I have looked at so far are negative. Check it your self before connecting.) Some displays have a negative LCD supply voltage AND a negative contrast control supply voltage. An example of this is the DMF50081 from Optrex. Others have a single negative LCD supply voltage which also controls the contrast. The smaller Optrex displays (like the DMF5005) and the Toshiba displays I have looked at work this way. Example: From the Optrex DMF5005 data sheet.

Supply Voltage (LCD Drive) Vcc-Vee is Min=8V Max=26V This means (5V - (-Vee)) = 26V, Therefore Vee= -3V to -21V Most the manufactures seem to use some variation of this notation. Don't let the unclear documentation destroy your display!

Yes, I should have example schematics and real applications. I am adding these as I get time. "

Reply to
Aly

Hi abhay:

This sequence doesn't look too bad...I suggest you drop the 0x80, it is not needed after reset.

Since you are only seeing the blocks your LCD contrast voltage is OK. So the problem is your display does not accept the init sequence.

Check also if the RS (register select), WR and CS (E) lines are correct. Look at the timing chart of your displays datasheet. Watch out: these LCD displays want a positive enable signal, not a negative one like usual :-)

HTH Wolfgang

--
From-address is Spam trap
Use: wolfgang (dot) mahringer (at) sbg (dot) at
Reply to
Wolfgang Mahringer

Sounds like contrast voltage is in correct range.

I would check the datasheet to see what dots per character you have as some data sheets have mistakes (especially on LCDs) if your character size is 5 x 8 then 0x38 is correct. In rare circumstances the font size is 5 x 11 so this should be 0x3C, it is unlikely you have a 5 x 11 font size.

As another poster has pointed out the 0x01 is not really necessary from initialisation. If you use the Display clear (0x01) then the 0x80 is a duplicate of part of the display clear function.

Changine 0x0E to 0x0F may help as when it is working you should at least see a blinking cursor.

If none of the above then this sounds to me like one of the following:-

1/ your timing to write to the LCD is not what you think it is e.g. R/W or RS or E line inverted or even timing of these relative to each other and data. 2/ Data line or other signal not actually reaching the LCD or swapped. 3/ You do not wait long enough from power up before starting to initialise the controller, most controllers need 30 to 50ms BEFORE the first command is written

I very much doubt that there is a jumper on the LCD that you should even think of changing as any jumper will be for manufacturering purposes of which LCD glass is on the module PCB.

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
              GNU H8 & mailing list info
             For those web sites you hate
Reply to
Paul Carpenter

This is the normal result of a power up reset, operate the reset on your micro to run the initialisation code again, if you have it correct the lcd should go blank. If it stays the same then you have a problem in that part of the code. You MUST follow the initialisation sequence as specified in the data sheet.

Reply to
cbarn24050

Abhay, If your LCD is HD44780 based (as most are) then please read the HD44780 datasheet and follow the initialisation strickly.

power off the board and check the continuity of MCU pins to the LCD pins.

power on board, check if RS,E,R/W and data signals reach okay at LCD pins. Put long delays say 20 secs and see if voltage changes at LCD pins as intented in the software.

Following is example for PIC for 4-bit interfacing (snip from

formatting link
) // setting interface length, higher 4-bits matter // Though naming following 8bit, these needs 4 wires // just to be consistent with HD44780 datasheet lcd_commwrt_8bit(0x38); // 0011 1000 -- set 8-bit delay(30000); lcd_commwrt_8bit(0x38); // 0011 1000 -- set 8-bit delay(30000); lcd_commwrt_8bit(0x38); // 0011 1000 -- set 8-bit delay(30000); lcd_commwrt_8bit(0x20); // 0010 0000 -- set 4-bit delay(30000); // 4-bit communication starts now with LCD lcd_commwrt(0x28); // 0010 0000 -- 4-bit, 1-line delay(30000); ... lcd_commwrt(0x01); // clear DDRAM and set DDRAM address to 0x00 delay(3000);

LCD comes with blocks of characters. for example 16 charcter LCD can be of two block. first 8 character in one address range and second half in another address range.

Depening on the instructions LCD controller will get from MCU, it can activate different regions/different lines.

Once a pin of MCU went bad while interfacing with LCD. It was difficult to detect as we do not doubt it (as it happens not so often). So with patience verify everything in a procedural manner.

thanks

- Surinder

Reply to
surindersingh

By no means an expert, but on 2 different controllers I have had to put a 5ms delay after raising the R/S pin. The display controllers would always treat the data as a command unless I put this delay in place. This was even with the code supplies by Microchip Application Maestro (I use PICs).

Reply to
EggNChips

hi guys.... thanks for ur response.........i tried with the following new modifications.

power on reset delay of 50ms vss connected to gnd thru pot. i had tried this lcd module with delay as well as by polling busy flag.but it has not changed anything.

i got another lcd of jhd162a but later noticed that it is based on same controller (ks0066). however i m trying on that rite now with these new modifications.one thing that i m not getting is that why this lcd is displaying bricks of only one line

Reply to
abhay

abhay wrote: .one

These is not much point in responing to you if your not going to read the responces.

Reply to
cbarn24050

lcd has started working.the actual problem was that the ground of micro & lcd was not common.thanx for ur suggestions.also the power on reset delay concept proved helpful.

Reply to
abhay

i hav been able to programmed lcd and able to work through it by delays & polling for busy flag.i need to interface one keypad & lcd to my microcontroller p89lpc935.i am getting output on lcd when i press keys on the keypad & output is correct also.but i am not able to do the same through interrupt programming of keypad.i have enabled appropriate bits for interrupt programming.

also i am able to do keypad through interrupt & watch its output on my hyperterminal window .......but it is not showing on lcd.

can u suggest reason for the same

Reply to
abhay

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.