Hot!ADC reading calculation

Author
mscientist33
New Member
  • Total Posts : 1
  • Reward points : 0
  • Joined: 2018/05/11 08:46:30
  • Location: 0
  • Status: offline
2018/05/15 10:00:07 (permalink)
0

ADC reading calculation

I am in need of some help calculating the voltage measured using the ADC on a c8051.  
 
The ref voltage I know is 2.4volts and it is using a 12bit step (4096 from my understanding and according to the notes of the last guy who programmed this thing).
 
It seems to have ADLJST set to right justify.  In my readings I am getting 8A on ADC0H, and 0D on ADC0L.
 
With that information, is it possible to get the actual battery voltage being read?
#1

4 Replies Related Threads

    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: ADC reading calculation 2018/05/16 15:26:56 (permalink)
    0
    mscientist33
    I am in need of some help calculating the voltage measured using the ADC on a c8051. 

    This is a Microchip PIC forum. Microchip do not make a "c8051"
     

    The ref voltage I know is 2.4volts and it is using a 12bit step (4096 from my understanding and according to the notes of the last guy who programmed this thing).

    The ADC value should then be (Vin / 2.4) * 2^12
    It's easy to rearrange that formula to calculate Vin from the ADC count
     

    It seems to have ADLJST set to right justify.  In my readings I am getting 8A on ADC0H, and 0D on ADC0L.
     
    With that information, is it possible to get the actual battery voltage being read?

    No idea about those registers as this is not a PIC chip.

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #2
    Bob White
    Super Member
    • Total Posts : 183
    • Reward points : 0
    • Joined: 2010/11/06 19:52:38
    • Location: Denver, Colorado
    • Status: offline
    Re: ADC reading calculation 2018/05/16 20:25:37 (permalink)
    0

    This is a Microchip PIC forum. Microchip do not make a "c8051"



    Well, actually, they sort of so now.  The Atmel AT89C51 are 8051 compatible devices.
     
    http://ww1.microchip.com/downloads/en/devicedoc/doc4180.pdf


    #3
    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: ADC reading calculation 2018/05/16 20:59:40 (permalink)
    0
    Nice try, but that chip doesn't contain any ADC peripheral.
    I'm assuming the OP is referring to the Silicon Laboratories C8051 
    https://en.wikipedia.org/wiki/C8051
    That comes in many varieties, with many different ADC peripherals available.
     
    They have a support forum at https://www.silabs.com/community
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #4
    Jump to:
    © 2018 APG vNext Commercial Version 4.5