LCD Control


Closed Thread
Results 1 to 29 of 29

Thread: LCD Control

Hybrid View

  1. #1
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Question LCD control

    Hi Steve, Hi Alec,

    Alec, I've tried all sorts of delays, or even different program parts, to write line 2, all without success, but thanks anyway.

    Steve, I usually allow 1 sec. startup, but trying 2 secs made no difference. The setup is a control circuit for medical laser x-y-z control containing analog and digital circuits. This model is supplied via laboratory power supply, is smoothed and filtered (100nF everywhere) and the line shows ca. 20 mV ripple in operation. The oscillator is decoupled from the VCC line because that causes lots of nasty noise usually. If you wish, I’ll send you the circuit diagram.

    The code is the usual:


    DEFINE LCD_etc…. ‘Setup LCD

    Pause 1000 ‘Settle pause

    LCDOUT, $FE, 1, “ Blah blah” ‘Write #1

    GOSUB somewhere ‘Fetch, calculate variable

    LCDOUT $FE, $C0, “ Blah “, DEC Variable ‘Display variable

    I haven't got another unit of this size and type, to take another type for test will involve (sigh) a large amount of work as this is built-in and direct connected. If I don't get it to work, though, I'll buy a new one eventually. I don't like getting beat, though.

    One point, I’m using a 16F877 and have the LCD defined to the D-Port as the only port free. I’m wondering if some register needs to be set/reset. I’ve been caught like that before. Is anything known? I’ve not found anything in the PIC Data book, but something with the parallel port control possible?

    Greetings,

    Rob

  2. #2
    Rhatidbwoy's Avatar
    Rhatidbwoy Guest


    Did you find this post helpful? Yes | No

    Default

    I was having a problem with HANTRONIX 20 x4.

    I fixed the problem with a pause. In description to what I was getting was that I would get the second line to go and the fourth line to go. Not the first nor the third line to light. I played with many things, but what came to work was that I need a pause.

    When you write your first line you normally would not need a clear screen (lcdout $fe, 1). So the second thing would write. leaving nothing for hte first line. This is were the pause is needed. So it looks something like this:

    lcdout $fe,1
    pause 10 'what ever value. I used 10
    lcdout $fe, address (first line), (what ever you want to write here)
    lcdout $fe, address (second line), (what ever you want to write here)

    This might lead to something good and it might not, but it is something worth your while to try. I tried this with the 20x4 HANTRONIX and I got my screen to do what I wanted it to do.

  3. #3
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Default lcd control

    Hi Rhatidbwoy,

    I've tried all sorts of delay times beween lines, nothing works. I've ordered a new display, as I suppose this one to be defect. Thanks anyway.

    Greetings

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking Just for fun ...

    Hi, Boboco

    Was it a 50% Discount ???

    ...

    Seriously, you should ask a question about that on the Displaytech site ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    boboco, As Rhatidbwoy mentioned I have found in the past (8+ years) that most LCD displays require anywhere from 5 to 15 Milliseconds to execute a clear command "$FE,01" or a home command "$FE,02". I have found this to be true with displays from OPTREX,ITRON,and CRYSTALFONTZ. They are all compatable with HD44780 type lcd controllers found on most lcds. Also whenever I use a command to place the cursor to a different location on the lcd I always use "PAUSEUS 100" as I have found in the past some displays require this delay. I have had no problems with any LCD or VFD displays using delays in my software as I have mentioned. LOL

    Dave Purola,
    N8NTA

  6. #6
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Initialization of a 16x2 LCD.

    (4 bit Interface).

    The first picture is the initialization of a Hitachi HD44780.
    The second picture is the initialization of a Samsung KS0077.

    Best regards,

    Luciano




    Code:
    Hitachi HD44780 initialization
    (The above picture)
    
    E=1  D7=0  D6=0  D5=1  D4=1
    E=1  D7=0  D6=0  D5=1  D4=1
    E=1  D7=0  D6=0  D5=1  D4=1
    E=1  D7=0  D6=0  D5=1  D4=0
    
    E=1  D7=0  D6=0  D5=1  D4=0
    E=1  D7=1  D6=0  D5=0  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=1  D6=1  D5=1  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=0  D6=1  D5=1  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=1  D6=1  D5=0  D4=0
    Code:
    Samsung KS0077 initialization 
    (The above picture)
    
    E=1  D7=0  D6=0  D5=1  D4=1
    E=1  D7=0  D6=0  D5=1  D4=1
    E=1  D7=0  D6=0  D5=1  D4=1
    E=1  D7=0  D6=0  D5=1  D4=0
    
    E=1  D7=0  D6=0  D5=1  D4=0
    E=1  D7=0  D6=1  D5=0  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=1  D6=0  D5=0  D4=1
    
    E=1  D7=0  D6=0  D5=1  D4=0
    E=1  D7=0  D6=0  D5=0  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=0  D6=0  D5=0  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=1  D6=1  D5=1  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=0  D6=1  D5=1  D4=0
    
    E=1  D7=0  D6=0  D5=0  D4=0
    E=1  D7=1  D6=1  D5=0  D4=0
    Last edited by Luciano; - 18th January 2006 at 22:47.

  7. #7
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Default LCD Control

    Hi all,

    thanks for the help.

    Curious is that the first line functions exactly as it should in every way, only the second line not. If I turn the contrast up to maximal all pixels turn black, though, so at least the line isn't dead.

    I've temporarily replaced the Displaytech with another type of unit. (all that work...., sob!) It worked at once so I take it that the Displaytech is bugged in some way. I've ordered a new one and hope that that will work, otherwise I'll have to change the whole construction to use some other. I'll report when I've got the results.

    Another short question on LCD control +PBP. If I want to control a 4 liner, which is essentially two complete LCDs in one, I've been doing it by switching both enable lines via resistors from one port and shorting each of the enable lines respectively with another two ports to disable it.

    It must be possible to program the PIC so that the selection of two enables is directly possible. (DEFINEs?) I've looked on the board but haven't found anything. Any ideas?

    Greetings

    Rob

  8. #8
    boboco's Avatar
    boboco Guest


    Did you find this post helpful? Yes | No

    Default LCD Control

    Hi all,

    thanks for the help.

    Curious is that the first line functions exactly as it should in every way, only the second line not. If I turn the contrast up to maximal all pixels turn black, though, so at least the line isn't dead.

    I've temporarily replaced the Displaytech with another type of unit. (all that work...., sob!) It worked at once so I take it that the Displaytech is bugged in some way. I've ordered a new one and hope that that will work, otherwise I'll have to change the whole construction to use some other. I'll report when I've got the results.

    Another short question on LCD control +PBP. If I want to control a 4 liner, which is essentially two complete LCDs in one, I've been doing it by switching both enable lines via resistors from one port and shorting each of the enable lines respectively with another two ports to disable it.

    It must be possible to program the PIC so that the selection of two enables is directly possible. (DEFINEs?) I've looked on the board but haven't found anything. Any ideas?

    Greetings

    Rob

Similar Threads

  1. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 20:54
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30
  5. 4x40 LCD control problem
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th January 2005, 12:43

Members who have read this thread : 0

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