Adcin or Pot


Closed Thread
Results 1 to 19 of 19

Thread: Adcin or Pot

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I am using a 47K linear POT.
    I tries usin a 0.1 UF capacitor, I was barely moving the pot and it reaches 255, bu adding 2 0.1 uF in series I was getting a little bit further. Then any changes in pot values did not change a thing. Decreasing the scale also help going a bi further. I scaled it down to decimal 2 (out of 255) and 2 x 0.1 uF caps. i am only getting halfway with the pot. i would like to go all the way.... what should I try..
    What are your Vref+ and Vref- settings on?

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    i did not set them , so they should be using the default 5v
    Is it needed fot eh POt command, i thout it was for the adcin (a/d)
    I tried it anyway , put Vref+ to 2.5v,no changes
    Last edited by lerameur; - 9th January 2007 at 19:08.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    OK I've just had a further look at the manual, and there was no connection of the second leg to the +ve, however disconnecting the link between the +5v and the pot resulted in the value of D (in the above example) to 1 regardless of where the pot was set. Reconnecting the leg of the POT to +ve and the value changed back to 255 !

    Looking at the manual it states
    The resistance is measured by timing the discharge of a capacitor through the resistor (typically 5K to 50K). Scale is used to adjust for varying RC constants. For larger RC constants, Scale should be set low (a minimum value of one). For smaller RC constants, Scale should be set to its maximum value (255). If Scale is set correctly, Var should be zero near minimum resistance and 255 near maximum resistance.

    Unfortunately, Scale must be determined experimentally. To do so, set the device under measure to maximum resistance and read it with Scale set to 127. Adjust Scale until the Pot command returns 254. If 255, decrease the scale. If 253 or lower, increase the scale.
    Whats happening here is that your not measuring the voltage and then converting that analogue voltage into a digital value as per A to D convertion. The resistor charges the capacitor, which then discharges, which results in a negative going pulse on the pin. The frequency of this pulse determins the value of being stored in the variable (D in my example above). Here are some traces showing the pulse rate when D was 0, around 20 and at 255.
    Attached Images Attached Images    

  4. #4
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I am not using A/D yu are right, but it still do not work , maybe i should use the A/D and change the reference voltage

    Ok i juste tried A/D works good
    Pot sucks..
    Last edited by lerameur; - 9th January 2007 at 21:15.

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


    Did you find this post helpful? Yes | No

    Default

    Je te l'avais dit

    I told you!
    Steve

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

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    oui je sais caline..

  7. #7
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    oui je sais caline..
    I didn't know the specie-that-grows-but-never-reproduces had haunted this forum ... LOL

    Being serious ... FORGET the "POT" Command ... and use RCTime instead !!!
    ADC not really compulsory for numerous applications.

    Alaain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Using the Pot command.
    By timseven in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th August 2009, 20:23
  2. A/D, Pot, Input, A,B So lost now....
    By Helmutt in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th March 2008, 22:23
  3. Replies: 4
    Last Post: - 24th January 2007, 22:20
  4. Using ADCIN or POT/RCTIME?
    By TonyA in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 16th April 2006, 18:37
  5. pot controlled pwm -- help
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 29th January 2006, 12:29

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