LCD Reset Problem


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2007
    Location
    South-West of Australia. A small town called Denmark. 'Where the forest meets the sea.'
    Posts
    136

    Default LCD Reset Problem

    I have come across the same problem on a variety of PIC processors with a variety of 4 line LCDs:

    1. They always work OK on power-up.

    2. If 're-set' only lines 1 and 3 display, 2 and 4 are blank. If one does multiple re-sets all four line occasionally work.

    3. I have experimented with a variety of:
    *Oscillator/Xtal speeds
    *DEFINE LCD_COMMANDUS delays
    *DEFINE LCD_DATAUS delays
    *Various brown-out setting in the configuration word/s
    *And nothing seems to make all four lines work on re-set

    This is a fault that is difficult to pin down. Some systems never have this fault whilst others nearly always resuse to show lines 2 and 4.

    I do have the appropriate DEFINES for the LCDs: D,E,RS,Lines,Bits

    Any hints please?

    Regards Bill Legge

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


    Did you find this post helpful? Yes | No

    Default

    Hi Bill,
    Try FLAGS = 0 early in your code.
    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.

  3. #3
    Join Date
    Nov 2007
    Location
    South-West of Australia. A small town called Denmark. 'Where the forest meets the sea.'
    Posts
    136


    Did you find this post helpful? Yes | No

    Default LCD Re-Set

    Joe S

    Thanks very much, your tip worked

    FLAGS=0 Did the trick.

    I've looked up the note on FLAGS=0 in the LCDOUT command page of the PBP manual and don't understand how it works?

    1. If I cycle the power to the PIC, without 'FLAGS=0' all is OK.
    2. If I re-set I get the missing lines problem unless the statement 'FLAGS=0' is included.

    I thought the PIC executed the same code on re-set as on power-up?

    Whatever, you help is much appreciated.

    Regards Bill Legge

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bill Legge View Post
    Joe S

    Thanks very much, your tip worked

    FLAGS=0 Did the trick.

    I've looked up the note on FLAGS=0 in the LCDOUT command page of the PBP manual and don't understand how it works?

    1. If I cycle the power to the PIC, without 'FLAGS=0' all is OK.
    2. If I re-set I get the missing lines problem unless the statement 'FLAGS=0' is included.

    I thought the PIC executed the same code on re-set as on power-up?

    Whatever, you help is much appreciated.

    Regards Bill Legge
    It causes the LCD to reset each time the lcdout statement sends data to it.
    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.

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


    Did you find this post helpful? Yes | No

    Default

    little deeper.... when you clear FLAGS value, the next LCDOUT will include the whole LCD initialization commands (1 line or more, 4 or 8 bits mode etc etc... see your LCD datasheet), then send your data.

    You can do it manually with few LCDOUT, but since FLAGS-0 do the job, why messing with it euh?
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Just curious Bill, "reset" used in the first post, what do you mean by that, are you taking the mclr line low or doing a full power off scenario?
    I ask because a power off that only browns out the LCD may be the entire problem. There will be times you do not want to use flags = 0 due to latency problems.
    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.

  7. #7
    Join Date
    Nov 2007
    Location
    South-West of Australia. A small town called Denmark. 'Where the forest meets the sea.'
    Posts
    136


    Did you find this post helpful? Yes | No

    Default LCD Re-set

    Joe S

    The boards I'm using have a 10k resistor that normally holds MCLR high. The re-set button takes the MCLR pin direct to ground. The power is on all the time.

    I have been lazy with LCDs and not bothered with the spec sheets - just use the PBP LCD commands.

    FLAGS=0 has solved most of my problems but I still get the odd occasion when alternate lines of the LCD don't come to life.

    I suspect that the proper way to fix this is some combination of FLAGS and the configuration brown-out settings. AND READ THE SPEC SHEETS!

    I mostly use PIC16F877A and PIC18F8722 chips on Mikroelektronika boards for developement and move to Futurlec boards for the end product - all hobby stuff, no production.

    Thanks for you interest.

    Regards Bill Legge

Similar Threads

  1. LCD problem with 16F628
    By ngeronikolos in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 19th September 2016, 08:28
  2. Newbie? Problem with LCD
    By lew247 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 7th December 2009, 19:48
  3. LCD freeze
    By harryweb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th October 2009, 08:01
  4. LCD problem
    By Andre_Pretorius in forum General
    Replies: 8
    Last Post: - 27th January 2009, 15:47
  5. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11: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