pot command


Closed Thread
Results 1 to 23 of 23

Thread: pot command

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Probably you have disable the ADCs but not the comparator? Both have to be disable.

    And yes i'm talking about doing a A/D conversion... that's already built-in, free and far better than POT
    Steve

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

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    by just using a pot on that pin, wont I have to use a voltage divider. If I just put a pot, then it will the same voltage and the convertion will be the same.
    Right now with this I am getting weird characters on the lcd.
    I did not touch portB..
    To disable I guess by using the ADCON1 = 0 it is disable (bit 2 and 3)

    Define ADC_BITS 10 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ' Set sampling time in uS
    B0 var byte
    Start:
    TRISA = 3 ' Set PORTA to all input
    ADCON1 = 0 ' PORTA is analog
    ADCIN 0, B0 ' Read channel 0 to B0

    Lcdout $fe, 1 'Clear screen
    Lcdout "Pot: ", Dec B0 'Display the decimal value
    Pause 300

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    TRISA = 3 and ADCON1 should be out of the loop...

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. Using the Pot command.
    By timseven in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th August 2009, 20:23
  3. PBP2.50b and POT command problem ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2008, 17:14
  4. Replies: 4
    Last Post: - 24th January 2007, 22:20
  5. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 18: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