Come on guys, did I ask such a stupid question that has to be ignored?
Come on guys, did I ask such a stupid question that has to be ignored?
Hi,
Yes and No ...
If you had read your Datasheet ...you could have noticed that GP3 is not a pin like the others ...
BUT, in your favour, you are not to know how "POT" works ...
So, just remember POT needs the pin to turn from time to time into an OUTPUT ...
And this is written nowhere in the manual ...
The Proof :
AlainCode:POTT movwf RM1 ; Save bit mask call HIGHT ; Set pin high to charge cap movlw 10 ; Charge cap for 10ms call PAUSE movf RM1, W ; Get bit mask iorwf INDF, F ; Set pin to input bcf FSR, 7 ; Point to port xorwf INDF, F ; Flip bit to low clrf R0 ; Zero counter clrf R0 + 1 potloop bsf FSR, 7 ; Point to TRIS movf RM1, W ; Get bit mask xorwf INDF, F ; Set pin to output CLRWDT?NOP ; Discharge a little (& clear Watchdog timer)
Change pin used ... no other solution ( ... RCTime won't work either )
Last edited by Acetronics2; - 26th March 2008 at 13:44.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
To add to Alain's explanation, GP3/MCLR is an input only. But huh... why using POT while your PIC have an ADC converter? Check in your manual and on this forum for ADCIN.
Make sure your pot impedance meet the datasheet requirement (<2.2K if my memory serves me well)
If you're using a Photoresistor, you will need to use a buffer (op-Amp, transistor or else) in between to match the impedance.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks Alain. Now I get it. In fact I already knew that GP3 is input only and without thinking about how pot works, I used GP3 intentionally, since I could not use it as an output if I needed one later. Smart huh?
And mister_e, I will give a try to ADCIN. And will make sure to use a analog available pin. thanks for the guidance.
Just changed the pin, and it works.
Thanks a lot guys, you are good.
Usually we don't accept anything under "You're the best"... but![]()
Just kidding.
Enjoy!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks