AD problems


Closed Thread
Results 1 to 4 of 4

Thread: AD problems

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    we don't know much about your external analog source but assuming a 10K, the ADC sampling time is way too low. Use my PicMultiCalc to know the right value for your actual setup.

    Here if i use 10K, the DEFINEs will be...
    Code:
    DEFINE ADC_BITS 10     ' ADCIN resolution  (Bits)
    DEFINE ADC_CLOCK 2     ' ADC clock source  (Fosc/32)
    DEFINE ADC_SAMPLEUS 11 ' ADC sampling time (uSec)
    now...
    Code:
    MER1=MERITEV1/112
    MER1Y=MERITEV1//112
    MER1X=(MER1Y*10)/112
    
    MER2=MERITEV2/112
    MER2Y=MERITEV2//112
    MER2X=(MER1Y*10)/112
    to me it's suppose to be MER2Y

    Code:
    ADCON1=%10010111
    i don't see this setting in the datasheet... for now, it make all pins to digital.

    i did the test with ADCON1=%10000000
    and it works.. well here
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    And, based on your analog pin assignments;
    Code:
    ANALOG1 VAR PORTA.0 'ANALOGNI VHOD1
    ANALOG2 VAR PORTA.1 'ANALOGNI VHOD2
    ANALOG3 VAR PORTA.3 'ANALOGNI VHOD3
    If you change ADCON1=%10010111 to ADCON1=%10000100, that would
    set RA0, RA1 and RA3 up as analog inputs to match. Assuming analog Vref
    is Vdd & Vss.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jan 2006
    Location
    Slovenia EU
    Posts
    32


    Did you find this post helpful? Yes | No

    Default

    Thank you for your help. It is working now.

    Samo

Similar Threads

  1. 16F876 AD comparisation help needed
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th April 2008, 18:41
  2. Problem with AD inputs at PIC16f873a
    By wurm in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2008, 10:01
  3. I neat some help on 12F675 ad
    By Kmt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd November 2007, 18:48
  4. PLEASE HELP ME! pic16f876a and AD tlc4541
    By luca_sheva in forum mel PIC BASIC
    Replies: 1
    Last Post: - 1st February 2005, 17:32
  5. ADC problem
    By NacNud in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 02:27

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