How exactly LCDOUT statement works?


Closed Thread
Results 1 to 33 of 33

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,078

    Default How exactly LCDOUT statement works?

    Hello.
    I'm trying to get the max out of ST9720 LCD module. It needs some custom commands to be sent, and I'm using LCDOUT for that. But what and how exactly this statement does? Manual shows only common use, without going into internals. Like just send $FE,$80 to set cursor at beginning of the 2nd line and so on.

    So here are questions.

    What is $FE for LCDOUT and why it is mandatory? (I tried removing it and sending next statement without it - it does not works) This is 1111 1110 in BIN, and I can understand that it might be used for display initialization, but as most display manuals say, for initialization you have to send 0000 0001. This means, this statement works in reverse? If it is not for initialization, then why LCDOUT $FE, $1 does the same?

    Does this statement allows control of RW/E lines? (This is required for display module config), or we have to do it manually) If yes, then how?

  2. #2
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    Also, it is possible to use 4 or 8 bits for controlling the LCD module. But some statements want to send bytes to DB7-DB4 ports. How this is done via 4 bit hardware connection?

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,389


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    5.38 LCDOUT
    LCDOUT Item{,Item...}
    Display Items on an intelligent Liquid Crystal Display. PBP supports LCD modules with a Hitachi 44780 controller or equivalent. These LCDs usually have a 14- or 16-pin single- or dual-row header at one edge.
    .......................
    What is $FE for LCDOUT and why it is mandatory? (I tried removing it and sending next statement without it - it does not works) This is 1111 1110 in BIN, and I can understand that it might be used for display initialization, but as most display manuals say, for initialization you have to send 0000 0001. This means, this statement works in reverse? If it is not for initialization, then why LCDOUT $FE, $1 does the same
    Commands are sent to the LCD by sending a $FE followed by the command. ie not data
    read the manual

    5.38 LCDOUT
    The LCD may be connected to the PIC MCU using either a 4-bit bus or an 8-bit bus. If an 8-bit bus is used, all 8 bits must be on one port. If a 4-bit bus is used, the top 4 LCD data bits must be connected to either the bottom 4 or top 4 bits of one port.

    Also, it is possible to use 4 or 8 bits for controlling the LCD module. But some statements want to send bytes to DB7-DB4 ports. How this is done via 4 bit hardware connection?
    44780 or equivalent controllers Have a 4 bit i/f protocol that pbp can use to send 8 bit data or commands to the display by breaking it into nibbles for transfer
    Warning I'm not a teacher

  4. #4
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    I have read manual, and it says nothing about $FE, and why it can't be $DC, for example.

    And how this breaking into nibbles is done?
    Can I have an example?
    I mean, how can I instruct LCDOUT to send 8 bit data command.

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    $FE is the "signal" to the compiler that the next byte should be sent to the LCD as a command and not as data. The fact that it's $FE and not something else is most likely because $FE in the character set of the HD44780 is a white space (at least in ROM code A00) which there already is a valid ASCII code for within the character set ($20).

    DEFINE LCD_BITS 8 will instruct the compiler to talk to the LCD in 8-bit mode. This IS covered in the manual, there's even setup code and schematic for 8-bit mode. The LCDOUT command itself is used exactly the same, no matter 4 or 8 bit mode. Read through the section on LCDOUT again.

  6. #6
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: How exactly LCDOUT statement works?

    I know how to set up 8 bit connection.
    I want to learn how to transfer 8 or 16 bits with 4 bit connection.
    Because say

    LCDOUT $FE,0,1

    is NOT equal (in terms what I see on display)

    to

    LCDOUT $FE,0
    LCDOUT $FE,1

    So I guess, on each LCDOUT statement, there's something special made to display. So I'm interested exactly what happens.

Similar Threads

  1. DS3231 works in one config, but does not works with other IC.
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd December 2019, 19:52
  2. Alternate If-Then Statement Help
    By pdegior in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th August 2007, 00:07
  3. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  4. 8bit LCDout vs 4bit LCDout
    By keithdoxey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th May 2006, 12:16
  5. A simple IF Statement!!!!
    By mslaney in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 17th February 2005, 20:58

Members who have read this thread : 2

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