POT delay?


Closed Thread
Results 1 to 3 of 3

Thread: POT delay?

  1. #1
    astrosteve's Avatar
    astrosteve Guest

    Question POT delay?

    Does anyone know the approximate delay in executing the POT statement? From the details in the manual, it appears as though the resulting value is a function of capacitor discharge through a resistor. Thus, there must be some timeframe involved to allow this to occur. Does anyone know how long I should allow for this to occur in a time-sensitive application?

    thanks,

    astrosteve

  2. #2
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by astrosteve
    Does anyone know the approximate delay in executing the POT statement? From the details in the manual, it appears as though the resulting value is a function of capacitor discharge through a resistor. Thus, there must be some timeframe involved to allow this to occur. Does anyone know how long I should allow for this to occur in a time-sensitive application?

    thanks,

    astrosteve
    Steve,
    I don't have my manual, but the pot command uses the RC time constant between charge and discharge (discharge and charge?) to affix an 8 bit number to the discharge time. As such, this is a variable time delay, and you can only plan for the longest possible delay. If this delay time is too long, you can reduce the cap value, or the pot value. It will reduce the usable range, but give you more time to do other things in software. I did an assembly routine that works on behind the scenes using interrupts. I used port B.0 and charged it to B+, set the interrupt and timer1 to start counting. When the pin went low, the routine stopped the timer, and flagged that it was complete. It was a simple thing to read that value out and take that variable for use at my leisure.
    Hope this helps,
    Ron

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


    Did you find this post helpful? Yes | No

    Default

    Why spending time when life could be much easier and reliable. Use a PIC with an internal ADC AND THEN you have the full control of it.

    You can even know the aquisition time... datasheet

    and use the following link to know how to measure it in real time => http://www.picbasic.co.uk/forum/showthread.php?t=365
    Last edited by mister_e; - 29th January 2006 at 00:21.
    Steve

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

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 07:57
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. RF Transmitter
    By et_Fong in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2005, 16:34
  4. Memory Space of the PIC16F84...
    By Tear in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st July 2005, 19:55
  5. Problem with saving to EEPROM...
    By Tear in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st July 2005, 00:10

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