LCD BARgraphs


Closed Thread
Results 1 to 40 of 233

Thread: LCD BARgraphs

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Location
    Houston, TX
    Posts
    96


    Did you find this post helpful? Yes | No

    Wink Nice Work

    DT,
    Really nice work! I will be using this on several of my A2D projects!!
    Padawan-78

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


    Did you find this post helpful? Yes | No

    Smile Thanks Tyson!

    Hope they work out for you.

    You might also want to check out this one ...

    Bargraph query thread
    http://www.pbpgroup.com/modules/newb..._id=37&forum=2
    <br>
    DT

  3. #3
    Join Date
    Mar 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Hello !
    First of all , thanks for the LCD codes.
    I applied the code below , it works fine ; but at the first row ; " Value= XXX " always flickering ; like something is writing over the " Value = XXXX " and it's always flickering.
    What is the problem ?
    Code:
    @ DEVICE pic16F877 
    @ DEVICE pic16F877, WDT_on 
    @ DEVICE pic16F877, PWRT_ON 
    @ DEVICE pic16F877, PROTECT_OFF 
    @ DEVICE pic16F877, HS_OSC 
    
    TRISA=%00000001
    TRISB=0 
    TRISE=0 
    INCLUDE "LCDbar_INC.bas" 
    
    ham var word 
    
    
    DEFINE LCD_DREG PORTB 
    DEFINE LCD_DBIT 0 
    DEFINE LCD_RSREG PORTE 
    DEFINE LCD_RSBIT 1 
    DEFINE LCD_EREG PORTE 
    DEFINE LCD_EBIT 0 
    DEFINE LCD_RWREG PORTE 
    DEFINE LCD_RWBIT 2 
    DEFINE LCD_BITS 8 
    DEFINE LCD_LINES 2 
    DEFINE LCD_COMMANDUS 1000 
    DEFINE LCD_DATAUS 225 
    DEFINE ADC_BITS 10 
    DEFINE ADC_CLOCK 2 
    DEFINE ADC_SAMPLEUS 100 
    
    ADCON1=%10001110 
    LOW PORTE.2 
    
    LCDOUT $FE,1 
    PAUSE 200 
    
    Loop1:
        ADCIN  0, ham
        ham=1023-ham
        LCDOUT $FE,2,"Value = ",DEC ham,"   "
        ; syntax- BARgraph   Value, Row, Col, Width, Range, Style
        @         BARgraph  _ham,   2,   0,    16,   1023,  lines
        PAUSE 50
    Goto Loop1
    
    END

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by karamastik View Post
    " Value= XXX " always flickering ; like something is writing over the " Value = XXXX " and it's always flickering.
    Code:
    Loop1:
        ADCIN  0, ham
        ham=1023-ham
        LCDOUT $FE,2,"Value = ",DEC ham,"   "
        ; syntax- BARgraph   Value, Row, Col, Width, Range, Style
        @         BARgraph  _ham,   2,   0,    16,   1023,  lines
        PAUSE 50
    Goto Loop1
    That's because something is always overwriting Value = XXXX. VALUE = XXXX is always overwriting VALUE = XXXX.
    Try ONLY overwriting just the value not the whole string.

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


    Did you find this post helpful? Yes | No

    Default

    Pause 50 is a bit low, try to increase it a little bit more.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    karamastik,

    LCD_COMMANDUS 1000 seems a little low.

    On most displays, the Home command ($FE,2) takes 1.6ms or 1600us.
    Try increasing it to 2000, some displays need even more than that.

    LCD_DATAUS 225 is pretty High. Should be around 50.
    If this one is too high, it won't cause a problem. It'll just slow things down unnecessarily.
    <br>
    DT

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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