Need help with Pot command


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Posts
    65

    Default Need help with Pot command

    Hi everyone, I want to learn how to use POT command so I tried some codes and try also to simulate it on protues.
    Code:
    Include "modedefs.bas"	' Include serial modes
    TRISB =%00000001
    Portb =%00000000
    ' Allocate variables
    x Var Byte
    
       CMCON = 7     ' Set PORTA to digital
       Pause 100     ' Wait for LCD to start
    
    mainloop:
       Pot PORTB.0, 127, x
       Serout PortB.1,T9600, [$Fe,1]
       serout PortB.1,T9600,[" Pot ",#x] ' Send value to LCD
       Pause 100                 ' for delays
       Goto mainloop             ' Do it again
    
       End
    I tried to play around with the variable potentiometer to see if its displays varies, but it jumps from 2-8-15-47-255. How can I make it increment by 1 to have a smooth display to 255? I tried to change the pot resistance between 5-10K but no luck.
    Attached Images Attached Images  
    Last edited by mbox; - 21st August 2010 at 11:16. Reason: trouble with image

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Default

    Hi, mBox

    The best advice I can give is : FORGET about POT ...

    use RCTime instead, it will be far easier to work with. and result is trustable.

    If your Pic ( 16F628 ??? ) had had an ADC ... surely It would have been the best solution.

    AND do not forget POT only can properly work @ 4 Mhz ... Following the manual scheme ( what you didn't do ...)

    Alain

    AS you will insist on using it ... try " scale " around 66 - 68 ...
    Last edited by Acetronics2; - 21st August 2010 at 15:43.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  3. #3
    Join Date
    Oct 2008
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Hi Acetronics, thanks for the tip. I will try RCTIME.

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