Going back to your first post...
There is a difference... pin 18 is C12IN0- and pin 15 is C12IN1-
This is taken from my Datasheet DS41262E (yours might be an extinct version).
You asked about RC4. Whether you consider a Comparator OUTPUT as analog I suppose is up to you. I consider Comparators INPUT as ANALOG but technically their OUTPUT is DIGITAL since it can only be a High or a Low. RC4 is the OUTPUT for Comparator 2. If you are using Comparator 2, you DON'T want to set that pin to ANALOG (because ANALOG refers really only to INPUTS), but you want DIGITAL OUTPUT.
Look at figures 8.2 & 8.3 in the Comparator Section. They show you the Comparator INPUT arrangement. For your convenience CxVin- has four possible sources.
The 16F690 does NOT have a CSM Module.
This means that if you want to play with capacitive sensing you have to configure the Comparators as an Oscillator yourself, the frequency of Oscillation will change when you place your Dabs on the Sensing Terminal. It is up to you to detect the change in frequency. So really any PIC with Comparators can do that. It's nice that the 16F690 has a quad input to each Comparator, which means that each Comparator can potentially service up to four capacitive buttons (NOT like your schematic in the first post which cannot differentiate which Button is being touched). That's the easy part.
The Hard part comes when you discover that the frequency will SIGNIFICANTLY DRIFT with ambient TEMPERATURE and HUMIDITY. This means you have to continually sample and reset your base reference. Then some snotty kid comes along and presses your button with damp hands 'cos he's just been picking his nose, and your base reference swings wildly into the unknown. Enjoy...
Some of us have a life... *smiles*... (quite apart from the fact that a tactile PCB switch costs about 5 cents and is reliable. Mount it behind a flexible overlay and all you need is a pull-up Resistor and ONE LINE of code to see if anybody's pressed it or not. It doesn't care if the overlay is dry or wet or somewhere in between, and it doesn't care about the flavour of Ben & Jerry's you want to slap on it!).(that said, I'm surprised that there aren't many many more people chomping at the bit to get funky proximity touch sensor switches working on there PICs)
Bookmarks