ADC Codes

Discussion in 'The Projects Forum' started by honeymustard909, Aug 15, 2011.

  1. honeymustard909

    Thread Starter New Member

    Jul 27, 2011
    Hi there ,

    I was wondering if any of u guys are familiar with ADC programming . I am currently using a Pic 18f46k20 . My project involves measuring my battery voltage where when it reaches a certain level , the PIC recognizes it and turn on the charging circuit for the battery. I am having a 12V power supply. I have scaled down the voltage from 12v to 3v using a voltage divider circuit but i am not sure on the ADC conversion part. I would be really grateful if anyone decided to help out. Thank u
  2. simo_x


    Dec 23, 2010
    Well, post your code.. Did you already look what datasheet reports about ADC operations?
  3. blah2222

    Distinguished Member

    May 3, 2010
    I'd recommend using a voltage regulator rather than a simple voltage divider circuit for bringing down the voltage as the rest of your circuit that you would like to power may affect the voltage it receives.
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    Note to self: We really could use a tutorial on D2A accuracy and resolution.

    Try to write one, OK?
  5. strantor

    AAC Fanatic!

    Oct 3, 2010
    I think OP is talking about the analog input being scaled down. So, if the battery is at 6V, the analog input will be 1.5V, etc.