PDA

View Full Version : Troubled by LCD



Josuetas
- 6th March 2006, 22:52
Hello, I have used LCD displays several times before, but this LCD is making me unhappy.

It is a 4x20 Blue Backlight LCD that just says QY-2004A, the thing is that it seems to work fine but restarts de PIC18F452, i think this is the problem because with an older LCD (i bought it before) everything works fine.

My concern is because i just bought two of this LCD`s and is strange that both are wrong, maybe someone had this problem before.


By the way i am using the connection as stated in the PicBasic Manual.

DynamoBen
- 7th March 2006, 01:28
Might be drawing more current or introducing noise into the circuit. I had a problem like this once and remedied it by placing a capacitor between 5V and common.

sougata
- 7th March 2006, 05:47
Hi,

If you are not using the R/W pin then the communication is unidirectional. That is the PIC talks and the LCD listens. And there is a rare chance that your data lines are taking more current (if the LCD is not faulty). For the 18F452 you can start you program and dump the values of the stack and POR registers to a serial output. This way you know what is causing the PIC to reset. Assuming that your code is alright, the possibility is of a brownout. Try disconnecting the backlight (pin 15,16). This would drastically reduce the current consumtion of the LCD module and as suggested by dynamoben do use decoupling capacitors at both the PIC and LCD modules. If your LCD runs okay then you need to work on the PS. Maybe you are using a 78L05 which supplies a maximum current of 100ma. Also note that some LCD modules do not have limiting resistors in the backlight so you have to put one yourself. Also the LEDs inside the backlight are connected as series then parallel. So until unless you know the VFwd of the LED you would not be able to calculate your series resistor. A simple way of measuring this is put an arbitary resistor in the path of the backlight and measure the voltage across pin 15,16.

If you are using the R/W pin (only when you use the LCDIN command) then there can be a bus conflict (again rarely). Try increasing the command and data delays to the LCD. This may resolve your problem.

Regards

Sougata

Josuetas
- 8th March 2006, 00:23
Hi, I have considered most of your tips, I am using a POT for the contrast and a resistor for the BackLight, My new discovery is that although i bought yet another LCD 4x20 the same results appear, my guess is that the datadelay and command delay are not correct, do you have any idea of what the correct values would be for this LCD?, i am pretty sure that everything else is correct because i made a simple HELLO WORLD test and the uC keeps turning off, by the way i am using a strong LM338 (5 AMPS regulator :D) so i think the Power is ok.

I am going for the delays, any suggestion is appreciated as i dont kwon what this delays mean

sougata
- 8th March 2006, 02:38
Hi,

The LCD controller takes a finite time to excute a command (the $FE ones) and take in the DATA (character to be displayed). Normally PBP does not poll the busy flag on the LCD to know if the LCD has successfully executed a command (or taken a data) and ready for the next. So the LCD defines assures that data and commands are not passed to the LCD too fast. If the LCD is slower it will definately loose character (s). So the delays assure that the speed of your PBP + PIC is slower than what the LCD can take.

However for your particular problem it is necessary to know what is causing the reset. So I suggested to check the STACK and POR registers. Please post your entire code. Sometimes typos are hard to find (yourself).

If possible post the schematic too.

Regards

Sougata

Josuetas
- 10th March 2006, 22:54
OK, the problem was with the power after all, i used a decoupling Capacitor to the uC and all my problems where gone!, i really cant believe yet as i had such a huge regulator for the application.

MENTAL NOTE : Never forget that 103 Capacitor between Vcc and Vdd ever again!

DynamoBen
- 10th March 2006, 22:57
That’s what I thought. I had this problem some time back when I moved a project to another PIC. Bruce explained to me the reason why it occurs with some PICs and not others, I just don't remember.

Long story short, you always need that cap.

Bruce
- 11th March 2006, 01:17
These are sometimes called "bypass" or "decoupling caps". They act as a
local voltage source during high frequency noise spikes. Without them, the
PIC can reset, lock up, or just act plain crazy. You might even think there's
a problem with your firmware when all you did was forget that silly cap.

Think of them as tiny little fast-acting batteries that keep the PIC Vcc and
ground pins stable during fast noise spikes.

They charge up to your power supply voltage, then quickly discharge during
brief switching current spikes to maintain voltage levels.

It's a good idea to add bypass or decoupling caps near all IC's in your circuit.
I normally include one at every Vcc/gnd connection point.

smokeysteve
- 21st April 2008, 12:01
If anyone is looking for the datasheet for the LCD marked QY-2004A, it is sold by Sure Electronics under the code DE-LM005.

The datasheet is currently available from:
http://www.sure-electronics.net/mcu,display/DE-LM005.pdf

Archangel
- 21st April 2008, 17:11
These are sometimes called "bypass" or "decoupling caps". They act as a
local voltage source during high frequency noise spikes. Without them, the
PIC can reset, lock up, or just act plain crazy. You might even think there's
a problem with your firmware when all you did was forget that silly cap.

Think of them as tiny little fast-acting batteries that keep the PIC Vcc and
ground pins stable during fast noise spikes.

They charge up to your power supply voltage, then quickly discharge during
brief switching current spikes to maintain voltage levels.

It's a good idea to add bypass or decoupling caps near all IC's in your circuit.
I normally include one at every Vcc/gnd connection point.

Everything Bruce said here is spot on target, I would add, they act as very fast-acting short circuits to noise spikes in the upward direction too. . .smooth out the highs and the lows . . Great little gadgets . . .

prolixusimports
- 9th December 2010, 10:15
hi there,,:p

Sorry I realize this forum is quite old, but it never hurts to try. I recently purchased a 24 character lcd display that came with a usb demo board. I've been trying to get this demo board to work but no success. Is there a way you can have a look at the two links below and let me know if there is any way you can help me out. Any help would be appreciate it. Is there a driver needed for the demo board at all?

Here are the link:>>:rolleyes:

http://www.sure-electronics.net/download/DE-LD007_Ver1.0_EN.pdf


http://www.sure-electronics.net/mcu,display/DE-LM005.pdf

Jerson
- 9th December 2010, 13:43
It is highly probable that the board has not been pre-programmed. It may just be blank and needs you to write your own application code for the PIC. You should check with the person from whom you purchased the demo board.

malc-c
- 9th December 2010, 16:16
hi there,,:p

Sorry I realize this forum is quite old, but it never hurts to try. I recently purchased a 24 character lcd display that came with a usb demo board. I've been trying to get this demo board to work but no success. Is there a way you can have a look at the two links below and let me know if there is any way you can help me out. Any help would be appreciate it. Is there a driver needed for the demo board at all?


Have to agree with Jerson, it could be that the PIC has been wiped and needs re-programming (with the sample code at the end of the PDF). The demo board has the ISCP pins to allow you to connect to a PIC programmer in order to do this.

Basically it looks like the demo board was simply designed to allow you to test various LCD screens. Plug in an LCD, hook up to a USB port for power and the company info would by default scroll across the screen.. You could then modify the code, compile it and then reload it so it says something completely different. - no "drivers" are needed (Windows running on a PIC.... now there's an worrying thought :) )

Do you have the ability to program PICs ?

Archangel
- 10th December 2010, 01:39
hi there,,:p

Sorry I realize this forum is quite old, but it never hurts to try. I recently purchased a 24 character lcd display that came with a usb demo board. I've been trying to get this demo board to work but no success. Is there a way you can have a look at the two links below and let me know if there is any way you can help me out. Any help would be appreciate it. Is there a driver needed for the demo board at all?

Here are the link:>>:rolleyes:

http://www.sure-electronics.net/download/DE-LD007_Ver1.0_EN.pdf


http://www.sure-electronics.net/mcu,display/DE-LM005.pdf
I bought one of those . . . heh heh heh the one I bought was just that, a demo board to use to test the LCD, it displayed Sure electronics and was powered by the USB port but does nothing else. It is NOT a serial LCD.

prolixusimports
- 12th December 2010, 02:28
hi again.. thanks so much for your response. I actually hooked everything up and connected the usb to my pc. the lcd powered up and started displaying the company welcome notes. Then I downloaded turbo C/C++ from the net for windows 7 64bit, and wrote the exact same code into the program and just changed the welcome message to my own. But after compiling the program i saw no results. It just kept on displaying the company info. I took some c++ programing for a semester back in college but that's about it. If you can help me program my pic i would greatly appreciate it. thank you


Have to agree with Jerson, it could be that the PIC has been wiped and needs re-programming (with the sample code at the end of the PDF). The demo board has the ISCP pins to allow you to connect to a PIC programmer in order to do this.

Basically it looks like the demo board was simply designed to allow you to test various LCD screens. Plug in an LCD, hook up to a USB port for power and the company info would by default scroll across the screen.. You could then modify the code, compile it and then reload it so it says something completely different. - no "drivers" are needed (Windows running on a PIC.... now there's an worrying thought :) )

Do you have the ability to program PICs ?

prolixusimports
- 12th December 2010, 02:33
hi again.. thanks for your reply.. I actually hooked everything up together and pluged the demo board by its usb connection to my pc. It started displaying company information. but when i used the exact same programing codes that came with the demo board in Turbo C/C++ win 7 64bit, i didnt get any results of my own. I just changed the greeting message to one of my own. nothing changed. Im not sure if its the turbo c im using is the right program or it could be the code. not sure.. help me out please.



It is highly probable that the board has not been pre-programmed. It may just be blank and needs you to write your own application code for the PIC. You should check with the person from whom you purchased the demo board.

prolixusimports
- 12th December 2010, 02:35
hi again.. thanks for your reply.. I actually hooked everything up together and pluged the demo board by its usb connection to my pc. It started displaying company information. but when i used the exact same programing codes that came with the demo board in Turbo C/C++ win 7 64bit, i didn't get any results of my own. I just changed the greeting message to one of my own. nothing changed. Im not sure if its the turbo c im using is the right program or it could be the code. not sure.. help me out please. i will provide you with any information you that is necessary. thank you.




Have to agree with Jerson, it could be that the PIC has been wiped and needs re-programming (with the sample code at the end of the PDF). The demo board has the ISCP pins to allow you to connect to a PIC programmer in order to do this.

Basically it looks like the demo board was simply designed to allow you to test various LCD screens. Plug in an LCD, hook up to a USB port for power and the company info would by default scroll across the screen.. You could then modify the code, compile it and then reload it so it says something completely different. - no "drivers" are needed (Windows running on a PIC.... now there's an worrying thought :) )

Do you have the ability to program PICs ?