2 Decimal Numbers


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Smile re:AD Scaling

    I am a sponge for now, must absorb your good info.
    Thans again Ms. M.

  2. #2


    Did you find this post helpful? Yes | No

    Question re:2 decimal numbers

    I ran the code Ms M. suggested and after a few setup line changes everything started to come around. I have the voltage divider set for exactly 5 volts to the AD. Here is the bummer: the display says Volts = 0.00 when the power supply is at zero volts, this is OK, but when the voltage is run up the display numbers are showing strobe dimming and are totally incorrect and unstable. The "Volts =" is steady and OK. The numbers vary from above 0.00 to 65.05 volts which is way off since the power suppply only runs up to about 25 volts. Can this be worked out by additional code or by filtering? My digital bench meter is showing a good clean output across the input to the AD which is 0 to 5volts.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    More likely you have the wrong JUSTIFICATION if you are using a WORD variable with your ADC. Check your DATASHEET for your PICs ADC Register settings and the ADCIN defines for the correct number of BITS you have set. If you are using the 16F877 (your first post)... you should have a line something like...

    ADCON1.7=1

    ...somewhere in the initialisation section of your program. To find out in detail what this means, look in the ADC Section of the Datasheet for your PIC. But when using a 8-Bits from your ADC, the Result should be LEFT Justified, whilst when using more than 8-Bits, the ADC Result should be RIGHT Justified (which without seeing any code from you is what I think you should be doing).

    Another reason for your results jumping about is that your sampling time could be too short.

Similar Threads

  1. Replies: 4
    Last Post: - 15th April 2009, 01:54
  2. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  3. show on LCD decimal numbers
    By savnik in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st March 2007, 20:36
  4. Returning whole numbers for DS1820?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th February 2007, 12:15
  5. 2 decimal display on LCD
    By pt3rg in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th January 2004, 14:28

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