Using ADCIN or POT/RCTIME?


Closed Thread
Results 1 to 12 of 12

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Hi Tony,

    ADCIN & the PIC's internal ADC are actually pretty fast, but the sound
    command, depending on the note/duration time, can be relatively slow.

    RCTIME just measures the time a pin stays in a particular state. POT would
    work, but it's really a pain to calibrate.

    The time lag you're seeing is most likely due to the time it takes to generate
    sound.

    You can adjust the sample time for A/D readings by using the PBP
    DEFINE ADC_SAMPLEUS option as long as it stays within the parameters
    shown in the PIC data sheet for A/D acquisition time.

    The default is 50uS unless otherwise specified with DEFINE ADC_SAMPLEUS.
    Regards,

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

  2. #2
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    I see, so it's the SOUND command that's taking the time.

    What about using the ADCIN with a pot using a different circuit than the voltage divider that's shown in the books. Is it possible to use other circuits with a pot and ADCIN?

    Thanks again,
    Tony

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


    Did you find this post helpful? Yes | No

    Default

    PIC A/D inputs can be connected directly to the analog source. You don't
    need any voltage dividers unless the analog input is greater than Vcc.
    Regards,

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

  4. #4
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    So I can just connect one part of the pot to the pic pin and the other to ground?

    Or if using a photocell, one lead to pin the other to ground?

    I was laboring under the notion that there had to be that voltage divider that I've seen in some books where one pot pin goes to +5, the other to ground and the middle pin to the pic ADCIN pin.

    Tony

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


    Did you find this post helpful? Yes | No

    Default

    If you have an analog signal from some external device, say, a temperature
    sensor or something else, that outputs an analog voltage, then you can
    connect this analog source directly to the PIC A/D input.

    If you're using a potentiometer to simulate the external analog signal, then of
    course you'll want one end to Vcc, the other to ground, and the wiper to the
    PIC A/D input.

    Without one leg of the potentiometer to Vcc you wouldn't have anything but
    ground on the PIC A/D input.
    Regards,

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

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


    Did you find this post helpful? Yes | No

    Default

    AND be sure you POT or ELSE analog source meet the maximum A/D input impedance.

    If you plan to use a PhotoResistor, you will need to pass the PhotoCell trhough an OPAmp or else method.

    look the PIC datasheet (once again) to know the maximum PIC A/D impedance
    Steve

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

  7. #7
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default Rctime

    Ok, thanks for the info.

    So RCTIME is just measuring the time for a cap to discharge, but the voltage source is coming from the pic pin itself, when it goes from low to high. In this case you would just hook the pot up like what's described for using the POT command? (None of the pots pins to Vcc)

    Thanks again,
    Tony

Similar Threads

  1. ADCIN and PIC18F4331 Arghhhhh !
    By GrandPa in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th December 2010, 21:27
  2. How to make adcin stable?
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th January 2009, 08:41
  3. ADCIN problems with PIC16F73
    By passion1 in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 26th July 2007, 12:38
  4. Adcin or Pot
    By lerameur in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 11th January 2007, 17:46
  5. help using adcin
    By harryweb in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st January 2006, 08:46

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