PDA

View Full Version : PIC12F683, POT & RCTIME not supported?



CuriousOne
- 5th June 2013, 10:58
Hello.

I want to read value of potentiometer into that MCU. here's sample code.



RC var GPIO.0
test var gpio.5
RESULT VAR WORD

:mainloop
HIGH RC
PAUSE 1
pot RC,100,result
pulsout test,result
goto mainloop



the all hook-up is done according to manual. But it does not works, I've hooked oscilloscope to test pin - see no pulses here when I adjust pot.

CuriousOne
- 5th June 2013, 11:41
I've looked with scope at POT pin too, there are fixed pulses, about 84hz frequency, and they don't change when I rotate the pot.

Acetronics2
- 5th June 2013, 12:06
To be known ...

POT only works "correctly" @ 4 Mhz and using the components shown in the Holy manual.

Now, having a Chip with onboard ADC ... it's a shame and a nonsense using such an awful command ( not linear, need special value components ... )

RCTime works perfectly ... but, here again, response is not linear and the range it must be used calculated with care to get enough granularity ...

Alain

CuriousOne
- 5th June 2013, 12:33
I tested RCTIME with my components on basic stamp 2p module, and it works perfectly, with nice linearity. Tried to move parts and code into PBP - does not works.

Acetronics2
- 5th June 2013, 18:30
with nice linearity

sure !!!

LOL ... I didn't know capacitor charge or discharge was showing something linear

Have a nice evening.
Alain

CuriousOne
- 6th June 2013, 05:11
Think what happens when you connect two unlinearities :)

Acetronics2
- 6th June 2013, 19:57
Think what happens when you connect two unlinearities :)

it's you who has the problem to generate your pulses ... not me ... :D

InputJive
- 14th June 2013, 19:35
I had a problem with RCTIME. Suggest you add a pause after rctime. It gives processor time to finish rctime before moving onto the next line of code.