![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
I'm trying to use a potentiometer to input one of four values to a 16F84 PIC chip, but I'm having problems. The value seems to go up exponentially as I slide the potentiometer, which doesn't make sense to me. As I slide it constantly, it will read: 0.........................1............2.....3.4.6 .16...................................... Smaller capacitors increase the size of the range that gives me 0, but decrease the range in which it goes from 1 to 16. I get that same effect when I change the scale value on the pot command. Thanks for any help. If I posted in the wrong forum or somesuch, I apologize. edit: I have a diagram of the circuit, in case it helps. ![]() My program is: Code: Symbol TrisB = 134 Symbol PORTB = 6 Poke TrisB, 1 Poke PORTB, 0 loop1: Pot 0, 255, B0 Poke PortB, B0 GoTo loop1 | |
| |
| | #2 |
|
It's an exponential "audio taper" pot. You seem to want "linear taper".
| |
| |
| | #3 |
|
You've also drawn the diagram wrong, you have the pot connected from HT to the capacitor, and not to any pin!.
| |
| |
| | #4 | |
| Quote:
And I fixed the diagram, thanks for the help. | ||
| |
| | #5 |
|
Listen to Nigel too, I didn't study the schematic. If you hooked it up like you drew the schematic, it's hooked up wrong.
| |
| |
| | #6 | |
|
The pot should be connected between the pin and the capacitor, not the 5v rail. M.K. Quote:
| ||
| |
| | #7 |
|
Mhhh.. Isn't this a better way.. connect the + to a 220Ohm resistor then the middle pin of a potentio meter (50K) then connect the last one or the first one to the 0volt line then put a cable from the analog pin to the middle pin of the potentiometer you can test it whit your multimeter..!!! when you move the resistor there will be another voltage over the smaller Res. and that's what we want. if you use other values you will get otherreactions..when turning the pot meter. TKS | |
| |
| | #8 | |
| Quote:
| ||
| |
| | #9 |
|
Now i untherstand.. i pulss down the pin... and wait when it raises by it self.. and the amout of time needed for that gives him a rough indication.. of it... mhh..smart... but not accurate.. TKS the way i have described i sue self but self i'm finding problems because i cant find the 1023 value... | |
| |
| | #10 | |
| Quote:
| ||
| |
| | #11 |
|
I believe it would be a good idea to put a current limiting resistor in series with the pot to prevent the latch on the I/O pin from being destroyed when the pot is set to zero.
| |
| |
| | #12 | |
| Quote:
| ||
| |
| | #13 | |
| Quote:
| ||
| |
| | #14 |
|
Son of a crap! I even had a test circuit set up the right way at one point. Thanks a million for helping me out.
| |
| |
|
| Thread Tools | |
| Display Modes | |
| |