LCD Help please

Status
Not open for further replies.

yfx4

Member
I have the powertip PC1602K 16*2 LCD display--datasheet link below.

https://www.electro-tech-online.com/custompdfs/2010/01/pc1602ky4.pdf

Using Nigel's (may I call you by your first name?) tutorials with a 16F628A I am able to make LEDs flash and run, alter sequences, etc. I progam with Pickit2.

I am unable to make the LCD display work.

I c/p the code to MPLAB, build it successfully, watch the outputs in SIM. All seems to go as designed. The LCD backlight works fine. I've tried adjusting the contrast.

How do I test the LCD?? Will LEDs on the porta outputs be helpful? Ideas?

Thanks in advance!!!!
 
When setting the contrast to max do you get black squares?Have you done all connections as indicated in the tutorial?

LEDs wont be helpful since an LCD requires commands that are to be sent so you wont be able to interpret them.
 
Try this. Experiments with PIC16F628A: Experiment No. 3: LCD Interface in 4-bit Mode
It is in mikroC, and you can download it from Compilers | mikroElektronika

- Raj

What do I use to program then?? I've only used MPLab and the Pickit2.

When setting the contrast to max do you get black squares?Have you done all connections as indicated in the tutorial?

LEDs wont be helpful since an LCD requires commands that are to be sent so you wont be able to interpret them.

No squares at all. I interpreted that to mean the controller was not getting power or that something was connected wrong so I double checked it all. I'll check again. If I apply power only and ground out the data pins should I see squares on the display? (I did not do this) I hoped there was a way to check the LCD hardware by connecting up certain pins. I checked the coding in MPLab and reburned it to no avail. Thats why I am looking at hardware.

Of course, it is more likely to be the typist as the cause.

Thanks again!
 
If you've built my hardware, and used my software, then it does work - it's well tried and tested, and in use by many people.

To test the LCD (rather crudely) just connect power and ground to it, and the contrast control - nothing else needs connecting. Then by adjusting the contrst control you should be able to see a row of solid blocks on the top line, with the bottom line blank. This is also what you get if the display isn't being initialised correctly.
 

Thank you. I will connect it up and check the LCD. I know the main 16F628A and board is connected properly and functioning as I have used it with LEDs. I was not sure about the LCD. This will help.

Thanks for the tutorials--it is a good start!!
 
Nigel:

I connected the LCD up like you suggested and got the top line of black squares. I'll rebuild my LCD board knowing that that is the most likely candidate. Double checking it (for me) is like proofreading my own work--I find the stupid stuff but overlook others. Often it is better to start over.

THANKS AGAIN!!!
 
Sorry, should have posted up sooner. You are always so polite--Thank you.

No.

I rechecked all connections, rebuilt my "interface" board, and still only got the black squares. This was the same for both of the LCD modules I have. I got frustrated.

Soooooo.....I ordered a new LCD from eBay and it works fine. I can only guess that I got 2 bad ones or it uses a different method to communiocate than the standard ones recommended here. Probably the former.

Now I'm slowly working on a replacement plug-in turn signal module for my motorcycle as well as a remote starter for it. Slow going due to my lack of skills (real reason) and lots of other things going on in life (excuse).
 
I'm sorry to hear you didn't get those first two HD44780 compatible LCDs working.

Many HD44780 compatible LCD controllers will "reset" themselves automatically after a long enough power-on delay but I've come across many others, new and old, that require the specific "reset" procedure outlined in several of the HD44780 Data Sheets (Brief overview about Hitachi HD44780 LCD controller).

The 4-bit interface initialization procedure requires specific 4-bit nibble data written at specific intervals to "reset" the controller before switching the controller into 4-bit interface mode. Nigel's tutorial program doesn't follow this procedure and so I suspect there are several HD44780 compatible LCDs out there that won't work with his example code.

If it helps, I posted an example 16F690 assembly language program that includes the 4-bit reset and initialization procedure in the following thread; 16F628 and KS0070B LCD

BTW, good luck on your new motorcycle project. Be sure to let us know how it's going.

Kind regards, Mike, K8LH
 
Last edited:
hi Mike,
Those are also my findings, due to experience with these LCD's, some will, some wont work without a software initialise.

I have tried to meet the power up requirements of the LCD controllers, but again it was hit and miss.

As it takes just a few lines of code to correctly initialise the LCD controller correctly to ensure a 100% success rate, its worth the code.

I also enable PWR on delay in the CONFIG.

Regards
Eric.
 
Hi - I am also having similar problems, with same pic, all connections as per nigels schematic ect.

As i am new to programming, can someone please indicate or show me where the modification to nigels software would go to help with the initilisation of the LCD.

I do not realy understand what I have to change.

Thanks
Charlie
 
Eric and Mike--thanks for the help. I'll go back to the LCD stuff and try again. Never know when I'll want a readout. Maybe add a digital tach to my bike on the remote starter????

I've reached a wall in my project(s) but need to clarify my problem in my own head before I post up the question. I've asked questions about it before but I guess they are not good questions b/c the answers, while addressing the topic, don't give me enough to work with. I'm not really intuitive when it comes to programming. I don't do programming or anything like it for a living (Dentist!) so I am like a tourist with a foreign language dictionary when I do this stuff.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…