LCDOUT quesiton


Closed Thread
Results 1 to 3 of 3

Thread: LCDOUT quesiton

  1. #1
    Join Date
    Apr 2006
    Location
    Michigan
    Posts
    70

    Default LCDOUT quesiton

    I have a question about LCD out. What does the $FE before a command actually due? Is this simply something that has to be there for the software, or is it actually sending something to the display. The reason I ask is because I have an LCD that I can control the brightness through software. If I set the RS=1 and send out a %00000010 which would set the display to 50%. I also notice that the cursor home command is RS=0 and %00000010 on the data line. This is done with LCDOUT $FE,2. My question is how do I make the RS line equal to 1. Can I do it by changing the FE? The manual doesn't really state where the FE comes from or give a definition for it. I thought maybe it was the state of the non data bits.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    According to the Hitachi HD44780 Datasheet, RS should be set (high) before sending data commands and cleared (low) before sending instruction commands.

    Since PBP has only a single instruction for parallel LCDs (LCDOUT), the compiler has to have a way to tell the difference between instruction commands and data commands.

    My interpretation is that the $FE is a flag (i.e., instruction prefix) to tell the software that the next byte will be an instruction and therefore the software should clear the RS line before sending the next byte, otherswise the software should keep RS high when sending the next byte. ($FE is not sent to the LCD).

    LCDOUT $FE,2 ; sends b0000010 to the LCD with RS low.
    LCDOUT 2 ; sends b00000010 to the LCD with RS high.

    If I had to guess as to why $FE, it probably comes from the serial "backpack" people that first made serial interfaces to parallel lcds. See any of the datasheets for serial LCDs at www.seetron.com for an example of this (they use $FE as an instruction prefix).
    Further, $FE also is not defined by the HD44780 datasheet - a good choice for a flag.

    (Lastly, make sure your LCD is based around HD44780 driver or compatible or else you might find other surprises.)

    Paul Borgmeier
    Salt Lake City, Utah
    USA
    Last edited by paul borgmeier; - 15th June 2006 at 15:50.

  3. #3
    Join Date
    Apr 2006
    Location
    Michigan
    Posts
    70


    Did you find this post helpful? Yes | No

    Default

    I actually tried to find what the state of RS was when characters were written. I couldn't find it in my datasheet so I assumed it was 0. If it is 1, then this should be a no brainer. Thanks, I will let you know if it worked.

Similar Threads

  1. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  2. need help in coding..
    By daphne8888 in forum mel PIC BASIC
    Replies: 1
    Last Post: - 19th March 2008, 07:31
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 02:33
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22

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