16F1828 HPWM and ADC


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: 16F1828 HPWM and ADC

    just noticed you have no adc defines
    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 100
    could help, they should be included anyway

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: 16F1828 HPWM and ADC

    ADCON1 = %00000000
    FVRCON = %11000010 'voltage reference set to 2.048V
    you are setting the frv (ps bit 6 of fvrcon is read only) but never connecting it to the adc module .
    to use the fvr as ref you need to set adcon1 bits 0 & 1 to 1

    you have also selected a conversion clock of fosc/2 which @4mhz is out of specs
    you need fosc/4 or rc clock for adc

Similar Threads

  1. ADC values above 4095 for 12 bit ADC
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st February 2015, 23:24
  2. ADC problem on 18F46K22 device using all 28 ADC pins
    By JimAvanti in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd February 2012, 21:22
  3. Replies: 3
    Last Post: - 23rd October 2011, 13:53
  4. Newbie HPWM / ADC question
    By Johan in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th June 2007, 13:52
  5. HPWM of the port of two HPWM
    By ja2rqk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 16:05

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