LCD BARgraphs


Closed Thread
Results 1 to 40 of 233

Thread: LCD BARgraphs

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    I've been playing with the NCD/DCD with excel, and there's something I can't seem to work in there.

    Granted, I'm relying on 30 year old memories from when I was working on microwave radios in the air force. But if memory serves me right, then a change of 3 db is double the power, and -3 db is half the power. And since the impedance is constant, it also means the voltage is either doubled or halved.

    So let's assume the signal is scaled so that the (maximum A/D reading +1) corresponds to +7 dbm. Then half of that would be 512 or +4 dbm.

    If you keep dividing that down, since there's only 10 bit's, you end up with a minimum of -23 dbm with an A/D input of 1.

    And it appears that it would take a resolution of 16-bits to be able to get down to -40 dbm.



    I think this applies to however you do it. Lookup, calculate, ...

    ADDED: And any noise or offset voltages will Obliterate the low end.

    But then, maybe I've got it all wrong? ??
    <br>
    I was always taught (having worked in the audo industry on digital mixin consoles, and having spent years designing synthesisers and samplers as a hobby) that the actual figure is around 6dB per bit, so 10 bits gives you 60dB, but in reality it's more like 4.5dB. I might be wrong but this is what I've always been told. Surely all you have to do is shift the levels?

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Sean_Goddard View Post
    I was always taught (having worked in the audo industry on digital mixin consoles, and having spent years designing synthesisers and samplers as a hobby) that the actual figure is around 6dB per bit, so 10 bits gives you 60dB, but in reality it's more like 4.5dB. I might be wrong but this is what I've always been told. Surely all you have to do is shift the levels?
    Look at http://www.picbasic.co.uk/forum/show...1&postcount=68. That one was solved!

    Ioannis

  3. #3
    Join Date
    Aug 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Question

    Hello!

    I've try to get some bar from this and I've got problem as usual ;-)


    So this is little code from me:
    INCLUDE "LCDbar_INC.bas" ' Include the BARgraph routines


    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 0
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50



    INPUT PORTA.0

    i var word


    LCDOUT $FE, 1 'clean screen

    while PORTA.0 = 0
    i = i+1
    LCDOUT $FE,2,"Value = ",DEC i," "
    ' syntax- BARgraph Value, Row, Col, Width, Range, Style
    @ BARgraph _Value, 2, 0, 16, 255, lines
    Pause 100
    wend


    As You can see in picture I've got problem when compiling with LCDbar_INC.bas...and get'+s lot lines of syntax error in INCLUDE file......off course I didn't make anything to this file...just copy -> paste....


    Do You know what couses this problem?
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Marin View Post
    ' syntax- BARgraph Value, Row, Col, Width, Range, Style
    @ BARgraph _Value, 2, 0, 16, 255, lines
    _Value should be _i in this case.

    The comments a little confusing at first, but once you figure it out, it just seems natural.
    <br>
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Hi Marin,
    To use Darrel's tidy little include files, you must place a copy of his file in the same directory as your code's file is in, and you must use MPASM as the assembler, not PM.
    JS
    Oh, and do they ever work sweet too!
    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.

  6. #6
    Join Date
    Aug 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    OK!

    Joe, is they any way to this be compiled in PM with some changes in .INCLUDE file?

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default

    If Darrel would make major changes it might!

    But then again why would he? MPASM is much better assembler!

    You still have your beloved compiler to write your code. Let Microchip do the job that knows better than anyone third.

    Ioannis

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