pot command


Closed Thread
Results 1 to 6 of 6

Thread: pot command

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    With the POT command PBP needs to control the I/O-pin. If you have the pin
    configured as an A/D input, the POT command can't toggle the pin to charge
    the capacitor.

    You could use ADCIN with the A/D configured for 8-bit or simply make the pin
    digital, then use the POT command.
    Regards,

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

  2. #2
    trying's Avatar
    trying Guest


    Did you find this post helpful? Yes | No

    Default

    Jerson that the 1st. way I wrote the code but for some reason it would not compile

    Bruce you a little over my head ( newbie) are you saying this is wrong?
    TRISIO = %00001100 ' MAKE GPIO.2/.3 INPUTS
    ANSEL = %00000100 'MAKE GPIO.2 ANALOG
    please explan more
    thanks

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


    Did you find this post helpful? Yes | No

    Default

    If you are using the POT command, then you do not want to make the pin
    an analog input. It needs to be configured for digital I/O.

    Change this: ANSEL = %00000100 ' MAKE GPIO.2 ANALOG
    To this: ANSEL = %00000000 ' MAKE GPIO.2 (and all other A/D pins) digital.

    Why?

    Because the POT command requires a pin it can control by flipping it from
    output, charging the cap, then flipping it back to an input. If you have the
    A/D feature for that pin enabled, then the pin no longer functions as a digital
    I/O-pin, and the POT command will fail.

    If you prefer not to use the POT command, then you could use the ADCIN
    command. In that case you would want to configure the pin as an analog
    input with ANSEL = %00000100 ' MAKE GPIO.2 ANALOG
    Regards,

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

  4. #4
    trying's Avatar
    trying Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    thanks Bruce
    I will give it a try, with you and others I'm learning

Similar Threads

  1. Using the Pot command.
    By timseven in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th August 2009, 21:23
  2. PBP2.50b and POT command problem ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2008, 18:14
  3. Replies: 4
    Last Post: - 24th January 2007, 23:20
  4. pot command
    By lerameur in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 25th November 2006, 05:12
  5. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 19:57

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