This thread might help clear things up. Then again it might not.
http://www.picbasic.co.uk/forum/showthread.php?t=11947
let us know.
This thread might help clear things up. Then again it might not.
http://www.picbasic.co.uk/forum/showthread.php?t=11947
let us know.
Dave
Always wear safety glasses while programming.
Thanks you for replying. I'm not having problems on the software side... I've used the ADC module quite often without really grasping some of the inner workings...(for that I simply select the channel, wait the sampling time, set go/done)
I guess the questions I have is:
Can the CHold capacitor be charged (by selecting the appropriate channel and waiting the sample time), then be disconnected by deselecting the channel, and still be converted by immediately setting the GoDone bit after disconnection?
regards,
mike
Not sure what you are wanting???
Selecting the channel just tells what channel the go/done bit converts if the ADC is enabled.
Dave
Always wear safety glasses while programming.
Sorry, I've been quite busy and never got back to this... I had wondered why, in the above mentioned appnote (ww1.microchip.com/downloads/en/AppNotes/01298A.pdf), 2 channels are needed (and if it's possible to get by with just 1)... I plan to do some testing one of these days, but I'm busy with other projects at the moment... anyway, that's where I was going with my post...
regards
Michael
Last edited by Michael Wakileh; - 11th December 2009 at 23:17.
Hi, Michael
2 Channel required , why ???
SIMPLY because it is needed to charge CHold to Vcc ... through one channel. ( How else ? )
AND the second channel is used for measure...
sooo ...
2 "buttons" need 3 channels , 3 buttons ... 4 channels, etc, etc ...
Capisce ???
Alain
************************************************** ***********************
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 " !!!
*****************************************
Hi Alain!
without checking the datasheets or functioning code snippets
my idea was the following:
only 1 channel for cap touch (example on a 12F)
---------------------------------------
1...Tris to output and pin high/Vdd
2...charge Chold / Point ADC to the High pin (for example ANS<3:0>: Analog Select bits = 0001)
3...disconnect Chold ANS<3:0>: Analog Select bits = 0000
4...digital output low... dicharge external capacitance
5...Tris to input
6...Analog Select bit 0001 / (Point ADC to sensor on the same pin)
7...Begin Conversion.../...Set GODONE
----------------------------------------------------------------------
I guess I have 2 more uncertainties
in the following procedure:
1 tris to input
2 pointing ADC to input channel (using Analog select bits)
3 wait for Chold to charge to input pin level
4 disconnecting Chold from input channel (ANS = 0000)
5 Start Conversion....
1))) Can it work? Is only the charge on Chold needed for the conversion?
2))) Is there only 1 Chold for all analog channels, or one Chold on every analog channel?
These are just some thoughts..... I will get around to testing myself next month....
If someone can point me to a datasheet or appnote that sheds some light on this, I would be greatfull...
regards,
mike
Bookmarks