PDA

View Full Version : trying the pot command to control delay



reddogtj
- 20th May 2005, 05:58
Can anyone help? I'm using a pic 16f84a to control some relays. I want to have a variable delay using a pot. This is what was programed

POT 1,255,B0
Let B1 = B0 * 1000
pause B1

I was thinking that the pot val B0 would be multipled by 1000 (1sec) and end up being anywhere from 0 to 255 seconds worth of delay (or pause) Well, it only gives me from 0 to a little more than 1 second worth of delay.
I'm new to this and am a loss. Is this the wrong way to go about this? Please help!! Can you pont me in the right direction?

Melanie
- 20th May 2005, 08:55
POT is one of those commands you have to experiment with depending on your values of R and C.

For example, in one design, to get a span of approximately 0-255 into my variable I use...

POT WLTimer,95,DataA

For this particular Scale value, I was using a 10K preset and a 100nF Capacitor (the same ultra-cheapo Y5V dieletric Capacitors that are used for decoupling the PIC).

Acetronics2
- 20th May 2005, 12:50
Hi, red Dog ...

The POT command works well only @ 4 MHz, with 0.1µF and 5 to 50 kohms...

further trials could show you the 0 -255 result range is a view of mind, linearity is also only acceptable within a limited range.

If you want fine results, try to use RC Time ...as Melabs recommends !!!

Alain