View previous topic :: View next topic |
Author |
Message |
sobinstn
Joined: 02 Mar 2017 Posts: 6 Location: Kochi
|
lcd not displaying |
Posted: Mon Mar 06, 2017 11:02 am |
|
|
Here LCD is not displaying anything, when the contrast is adjusted Dark squares only visible. When checked on Proteus the lcd pins are not ON.
LCD used is 20x4 Character LCD Module (Green), works on 5v.. Jhd204a
The Author of this program is ccs blogspot,
Real time clock with alarm using PIC16F877A and DS1307 RTCC CCS C
[code][/img]
Last edited by sobinstn on Mon Mar 06, 2017 11:48 pm; edited 1 time in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Mon Mar 06, 2017 12:43 pm |
|
|
Without knowing the LCD module part number....
you should always post that information.
If the LCD does not display anything it might be that the 'contrast' pin is not connected or incorrectly powered. Some need <.5VDC to 'show'.
Also most LCD modules are 5 volts, so be careful if you try to power with 3V it won't work.
Jay |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9244 Location: Greensville,Ontario
|
|
Posted: Tue Mar 07, 2017 5:49 am |
|
|
You need to post the code or a link to the actual code. I use 2004 LCD modules all the time now and if you get the black squares, it's good indication the module is OK. I suspect incorrect wiring or wrong pin assignments or bad code. You need to post the code and the LCD driver.
All the hardware is same as I have so they can work together.
Jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19542
|
|
Posted: Tue Mar 07, 2017 8:33 am |
|
|
I'd add the simple suggestion to add a 0.5 second delay, before calling lcd_init at the start of the code.
It could be the 'old chestnut' of just trying to initialise the LCD too quickly. One classic problem is that different LCD's, and even different batches of the same LCD, take different amounts of time to actually wake up. It could even be that his power supply is being a bit slow getting to 5v. The PIC then starts before the LCD is ready. |
|
|
sobinstn
Joined: 02 Mar 2017 Posts: 6 Location: Kochi
|
lcd not displaying |
Posted: Tue Mar 07, 2017 11:35 am |
|
|
Hii,
That too is not working, i checked it connecting lcd only. Still no.
Only pin D4 is high, all other pins are low.
What that could be ?
Thanks.. |
|
|
sobinstn
Joined: 02 Mar 2017 Posts: 6 Location: Kochi
|
lcd not displaying |
Posted: Tue Mar 07, 2017 11:38 am |
|
|
Hii,,
I tried this on proteus, after trying on breadboard.
thanks.. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Mar 07, 2017 11:59 pm |
|
|
Black squares means either the contrast voltage on the LCD is wrong (it should be about 0.4 volts), or the LCD is not being initialized.
The most common reasons for the LCD not being initialized are:
1. Incorrect wiring between the PIC and the LCD.
2. PIC not running, or running at the wrong frequency.
There are many threads on lcds with black squares on the forum.
Here is one of them:
https://www.ccsinfo.com/forum/viewtopic.php?t=45292 |
|
|
|