LCD output "smoothing"


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382

    Default LCD output "smoothing"

    I am receiving values serially and displaying them on an LCD. Unfortunately, I'm receiving them quicker than the LCD can display them. I'm currently receiving the data via interrupts.

    What is a good method of "smoothing" out the values so they are readable?
    I have considered removing the interrupt but thought I would post prior to going that route. Thoughts?

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


    Did you find this post helpful? Yes | No

    Default

    if you mean you receive many different data in a really short delay but you want to display them all... it will be hard/impossible.

    Is Reduce the transmitter refresh time an option???

    Sending to LCD a data on Xn receive

    Average them

    and i can be totally off... once again!

    A delay of few millisecondes between each display is suitable... let's say 100 mSec and up.
    Steve

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

  3. #3
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Question

    "What is a good method of "smoothing" out the values so they are readable? "

    Is it a single variable that changes quickly, or a number of different variables that must be displayed?

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Single variable that is changing quickly.

  5. #5
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    You could always delay how often you are displaying to the lcd. Create a counter so you only send commands to the LCD every 10th time through your program loop instead of everytime. You won't display everything you are recieving serially this way, but it may not matter.

  6. #6
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    There's a great bit of code on the Melabs site for using the hardware serial port and interrupts. It creates a ring buffer that automatically collects the incoming serial data. When your program is ready, it can average the data that is in the ring buffer and display it. If you need to display every little change of the variable, then you would display a "snapshot" of the last 10, 20, or 128 values that were captured. The ring buffer continually overwrites itself, so if there was a specific event, you can stop it, or just read values on the fly. Take a look at "serA452.bas". I tip my hat to whomever wrote it.

  7. #7
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Good tip. The information I'm displaying is RPM, which tends to fluctuate a fair amount.

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi again Ben,

    Sounds like you just need a little averaging.

    Averaging 16 bit values without using 32 bit math?
    http://www.pbpgroup.com/modules/wfse...hp?articleid=7

    Then once it's averaged, you can do something like this
    Code:
    IF Value <> LastValue then
        LastValue = Value
        LCDOUT  $FE,$C0,DEC Value
    ENDIF
    That will reduce the number of LCD writes significantly.
    <br>
    DT

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, 19:54
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  3. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46

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