LCD 4-bit mode affecting rest of port?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Australia
    Posts
    20


    Did you find this post helpful? Yes | No

    Default LCD display problem

    Dear Sir,

    The LCD works fine as long as the power is supplied non-stop. However, when I turn LCD power off and turn on again, LCD displays two line black square forever, similar to power on first time. The power of PIC18F8520 is always on (never off). The definition of LCD is as follows:

    DEFINE LCD_EREG PORTA
    DEFINE LCD_EBIT 2
    DEFINE LCD_LINES 4
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 0
    DEFINE LCD_DREG PORTF
    DEFINE LCD_DBIT 0
    DEFINE LCD_BITS 8

    Your help and advice would be very much appreciated.

    Yuantu
    Yuantu Huang

  2. #2
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    The display needs to be initialized again, after poweron(and a pause) you need to do ......

    Flags=0
    LCDOUT blah,blah ,blah.......

    /Ingvar

  3. #3
    Join Date
    Jan 2005
    Location
    Australia
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Thanks

    Hi Ingvar,

    Thank you very much. You are right. The LCD needs to be reset after the power is restored. I can use

    lcdout $fe,$38
    lcdout $fe,$0c
    lcdout $FE, 1

    to restore 8 data line LCD display. But the above did not make 4 data line LCD display work. Could you please give me some suggestion how to fix the problems.

    Thank you very much.

    Yuantu
    Yuantu Huang

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Sorry but Ingvar gives you the solution...
    FLAGS=0

    it's written in the PBP manual too.
    Last edited by mister_e; - 22nd August 2005 at 04:40.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Jan 2005
    Location
    Australia
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Thanks

    Hi Steve,

    I thought FLAGS was a pseudo flag. Now I understand FLAGS = 0 is a LCD reset statement. It is working.

    Thank you and Ingvar for your help.
    Yuantu Huang

Similar Threads

  1. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  2. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  3. How to set TMRO & TMR3 as Counter?.
    By NatureTech in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 18th May 2007, 08:52
  4. LCD port bit choices
    By rossfree in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd September 2006, 10:22
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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