POT Command


Closed Thread
Results 1 to 10 of 10

Thread: POT Command

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

    Question POT Command

    I realised a "scale factor wiewer" with LCD ( see scheme on LCDOUT page ... ).

    It Works fairly well at 4 Mhz ...everything perfect !!!

    BUT, I need to run the POT command with a 20Mhz crystal ...

    of course, I added the right DEFINE ...

    It's really awful as a result, even after trying different R an C's ...

    Anyone having an idea or a solution ???

    ( Those with RCTime are a little bit late on this game ) !!!

    Alain

  2. #2
    Keith55555's Avatar
    Keith55555 Guest


    Did you find this post helpful? Yes | No

    Default

    This is a long shot but I learned this the hard way and sometimes something that is obvious, isn't, as we have all seen.So just in case this is something you have assumed,I'll throw it out there :are you using an EPIC to program?and did you use 'HS' for the clock configuration in Epic.I once did a define with the osc 20 DEFINE but used :the 'XT' for the clock .The device worked but did some freaky things.-Keith

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Thanks to you, Keith.

    From the lab' point of view, everything is here;picstart + , MPlab 6.50, PbP 2.44...and the right crystal.

    From the software point the difference is just a little "DEFINE OSC 20" ...

    And Further, Melabs has no solution and tell me to use an ADC !!! Just understand my wish was to make simple ...

    "Is there a solution " seem to be the good question !!!

    Alain

  4. #4


    Did you find this post helpful? Yes | No

    Default

    I believe the reason behind using ADC versus the POT command is because the ADC offers a higher resolution. The POT is limited to 255 I think where as the ADC goes up to 1023. If you want simple just use the ADCIN command and divide the result by 4.

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


    Did you find this post helpful? Yes | No

    Default

    You can use POT on PIC's with no ADC's (like F84 or F628 etc) which makes it useful in some situations.

    I've found that you have to play with the POT scale settings sometimes, as it doesn't quite follow the manual. I've had a situation (10K pot and 100nF capacitor) where using the recommended scale of 127 as a starting point (see manual) did not return meaningful results in Var (always zero I recall), and only when scale was reduced to around 100 did things start to work as expected.

    This is one of those experiment and see situations.

    Just as a reminder for everyone else reading this thread... never use the open drain pin on the PIC (PortA.4 I believe).

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


    Did you find this post helpful? Yes | No

    Thumbs up

    Hello, Melanie

    Thanks for this answer ... reading between the lines tells me there's no future for my superb PCB !!!

    So, last question ( with humour ...)

    Why are there " IF OSC >=16..." and " IF OSC >= 20 ..." in lines 3213-3218 in PBPic xx.lib ???

    Let' Hotten the Persulfate Bath ... and modify POT to RCTime !!!

    Alain

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You know, I've never had reason to poke around those lib files... nice collection of "If OSC" statements though...

    I'm surprised... you should get the POT to function... even at higher OSC speeds... just play with the scale value until sensible figures start appearing and then adjust accordingly from there.

    What values of VR and C are you using? For C, I tend to use the same 100nF Capacitors as I do for board decoupling (makes life easy for assembly on the factory floor)... despite being a cheap Y5V spec, for non-precision user adjustments work really well.

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


    Did you find this post helpful? Yes | No

    Talking

    Hello, Melanie

    I've tried from 1 nF to 1µF for caps and got a wristache turning the 47k pot back and forth.

    Results are really awful ( no usable range and min R give max result )

    May be a "capacitive load problem" occurs ...

    I already saw that with PULSOUT command ( just switch and unswitch the servo, without removing power ...)
    ...write a LOW portx.y just before PULSOUT
    or also when driving mosfets with an RCDiode array on the gate
    writing " portx.y =1 "
    ...write " HIGH portx.y " not the mosfet to sleep too long a time !!!

    I' ve chosen to use RCTIME ...that will be kwicker to have my model plane's canopy closed !!!

    Alain

  9. #9
    Keith55555's Avatar
    Keith55555 Guest


    Did you find this post helpful? Yes | No

    Default

    Since the pot command has relationship to pulsout architecture and pulsout is dependent on the oscillator frequency(a DEFINE does not change this dependency)isn't it correct to assume that pot will be effected by this, by possibly a way too short charging of the capacitor?Could you emulate this structure of what goes on in 'pot'and increase the time of the pulse(1 period at 4 mhz in pulsout=10us and at 20mhz=2us,so times five).Scaling under these conditions may not do the job if it is frequency dependent.PBP manual does not comment on how the clock effects the 'pot' command although is quite 'vocal' about pulsout's relationship to the clock.Simply put a question to MELABS,that asks,"does the clock freq. effect the 'pot' command?"That's either a yes or no answer and we can eliminate that part of the question.
    I do believe I am going to have to try this 'in-circuit',myself just to put this to rest.

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


    Did you find this post helpful? Yes | No

    Talking

    Hello Keith

    It's a long time I went to a trip through PBPic14.lib ... lines 3170 to 3237 ...

    I didn't see anything strange, as the cap charge is driven through a PAUSE 10 instruction ...and PAUSE goes well if the right define is here !!!

    sorry, that's not the right solution ...

    Alain

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. PBP2.50b and POT command problem ?
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2008, 17:14
  3. Replies: 4
    Last Post: - 24th January 2007, 22:20
  4. pot command
    By lerameur in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 25th November 2006, 04:12
  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