PIC18F4550 interfaced to a serial lcd cant display anything

Thread Starter

xed339

Joined Feb 4, 2013
13
hi everyone..im having a problem in interfacing serial lcd to pic18f4550..im using mplab ide, c18 compiler..all i wanted is display a text in lcd..well my project is display time(rtc) using serial lcd..but i want to begin from the top..so as of now i want to learn about lcd...im really new in this field so i really need some guidance here :)..please do check the files that i attached..it is about the lcd im using and my program in mplab(nevermind the title of my project in the attachement:))...i already have a program but i dont know if im doing it the right way..
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
I have no idea what's in LCD.zip as ther is a rar inside the zip, and I can't open rar.

rtc sample has some code that never works the LDC.

So I would say start by adding code to talk to the LCD. You will find some at ...\Program Files\Microchip\mplabc18\v3.40\src\pmc_common\XLCD

Do look at the pin setups, and also tripple check and change the delays for your PIC device.
 
Last edited:

thatoneguy

Joined Feb 19, 2009
6,359
Use a RS-232 <-> TTL UART adapter, connect the Tx of the uC to the Rx of the TTL adapter.

Open hyperterminal, set to serial mode, on the com port the USB adapter was set as, and at the same baud rate as your Serial LCD.

See if you get output on hyperterminal screen when the uC sends data, if so, either wiring to, or something on, the Serial LCD isn't set right. If you get odd output, the baud rate is probably mismatched, or parity is enabled, or some other setting.
 

spinnaker

Joined Oct 29, 2009
7,830
Why is that that so many people come here, drop off their code and schematic then expect forum members to figure out their problem when the OP made no effort whatsoever?

OP,

You have to make some minimal effort to do your own work. Perfectly acceptable questions might be:

1. I have an XYZ LCD serial display and having issues displaying text. Does anyone have a working example for this display?

2. I am having an issue with an XYZ serial display. Can anyone give tips on troubleshooting.

ThatOneGuy already gave you a good way to start. Other options would be a logic analyzer, digital storage oscilloscope or even an non storage oscilloscope. If you have a PicKit 2, it may have some tools you can use like a logic analyzer.

Troubleshooting serial i/o is difficult without the proper tools.
 

Thread Starter

xed339

Joined Feb 4, 2013
13
@ErnieM :sorry about that. heres a link for the lcd (https://docs.google.com/file/d/0BxdLxDCD6HidazNwakdBTXdTTkU/edit)
@thatoneguy :sir i guessed i dont need to use a rs 232..please check the lcd datasheet in page5 Figure8 it is shown there that theres no need of rs 232..
@spinnaker : you right about that sir:) about the question.Let me rephrase it...

Does anyone have a working example on displaying text on lcd. A sample code for pic18f4550,c18 compiler, a serial lcd (4 connection only in lcd rx/tx/5v/gnd)

I've already searched on the internet but all the examples that i find is arduino.

everyone please do check the lcd datasheet link above.
Also, as far as i understands it (correct me if im wrong) i guess i don't need to use the xlcd in c18 library since i will be using a serial communication..
 

thatoneguy

Joined Feb 19, 2009
6,359
I said RS-232, but it is actually is the converter for USB to make a TTL serial port on your computer, which should be able to both send data to the LCD, and, after moving wires, see what the PIC is sending.

The reason I said RS-232 is that that is how it identified in windows (Serial Port), without making distinction between RS232 and TTL level.

The USB -> TTL Serial cost about $5 or less, and are extremely handy to have around.
 

spinnaker

Joined Oct 29, 2009
7,830
@ErnieM :sorry about that. heres a link for the lcd (
I've already searched on the internet but all the examples that i find is arduino.
Potato / PoTOTo. A mcu is pretty much a mcu. While a working example would be ideal for you, you still have an example.

It will be difficult but you should be ab;e to do is look at the code and translate. I have done this a number of times. What is really important is the sequence of bites you need to send to the LCD along with the speed.

But you also really should get your hands on some kind of tool to see what if anything you are transmitting. As mentioned a PC with appropriate interface will do. A logic analyzer would be at the top of that list.


And it would really help if you mentioned the type of serial lcd you are using instead of making people look. Many may not choose to look at your datasheet without knowing that information.
 
Top