Troubled by LCD


Closed Thread
Results 1 to 17 of 17

Thread: Troubled by LCD

  1. #1

    Default Troubled by LCD

    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.
    Last edited by Josuetas; - 6th March 2006 at 23:09.

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    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.

  3. #3
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Are you using the R/W pin

    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

  4. #4


    Did you find this post helpful? Yes | No

    Default All tried

    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 ) 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

  5. #5
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default LCD delays

    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

  6. #6


    Did you find this post helpful? Yes | No

    Default Solved, thanks for the help!

    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!

  7. #7
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    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.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    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.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  9. #9
    smokeysteve's Avatar
    smokeysteve Guest


    Did you find this post helpful? Yes | No

    Default

    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,...y/DE-LM005.pdf

  10. #10
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    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 . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  11. #11


    Did you find this post helpful? Yes | No

    Question regarding the 24 character lcd displays with demo board.

    hi there,,

    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:>>

    http://www.sure-electronics.net/down..._Ver1.0_EN.pdf


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

  12. #12
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default

    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.

  13. #13
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prolixusimports View Post
    hi there,,

    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 ?

  14. #14
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by prolixusimports View Post
    hi there,,

    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:>>

    http://www.sure-electronics.net/down..._Ver1.0_EN.pdf


    http://www.sure-electronics.net/mcu,...y/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.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  15. #15


    Did you find this post helpful? Yes | No

    Red face re: getting lcd to work

    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

    Quote Originally Posted by malc-c View Post
    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 ?

  16. #16


    Did you find this post helpful? Yes | No

    Smile re: getting lcd to work

    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.


    Quote Originally Posted by Jerson View Post
    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.

  17. #17


    Did you find this post helpful? Yes | No

    Wink regarding my lcd display and demo board

    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.



    Quote Originally Posted by malc-c View Post
    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 ?

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Dedicated LCD Controller question
    By chuckles in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 27th February 2006, 14:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts