Pic18f452 adcon


Closed Thread
Results 1 to 2 of 2

Thread: Pic18f452 adcon

  1. #1
    Join Date
    Sep 2005
    Posts
    53

    Post Pic18f452 adcon

    I would like to use the on board A/D on the 18F452 to read a battery voltage through a voltage divider on RA0, RA1, RA2, RA3, and RA5, can anyone please help me set up the ADCON1?

    Many Thanks,

    Regards,

    Gavo

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Pic18f452 adcon

    The datasheet would be a really good place to find out.

    But...

    ADCON0 = %01000001 ; A/D converter ON, CLK = FOSC/16
    ADCON1 = %11001010 ; Right justified, /16, AN0,AN1,AN2,AN4,AN5 as inputs, Vref into AN3

    OR

    ADCON1 = %11001001 ; Right justified,/16, AN1,AN2,AN3,AN4,AN5 as inputs, Vref = VDD

    Will probably work.
    Charles Linquist

Members who have read this thread : 1

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