
Originally Posted by
Melanie
Ah... I see what I wrote with regard to DIGITAL OUTPUT... what I meant was that the COMPARATOR gives you the Digital Output. You NEED to select C1OE and C1ON (C2OE & C2ON) bits to 1 so the Comparator gives you a physical Hardware Output (rather than just setting a bit in a Register internally within the PIC), and you set the TRIS for that pin to 0 (treat it as DIGITAL OUTPUT - which is what it is).
Ok, I think I understand, that's pretty much what their Application Note said (albeit for the 16f877, but doing some x correlation, it seems that most register settings on the 16F690 are very similar)...
Edit: Bingo! it works now!(phew)
The problem?
The darned Pickit2 programmer pin 2 (which goes to pin 18 - ICSPCLK -on the 16F690), was seemingly dragging the whole cct down and stopping it from oscillating - when I removed that leg from my Pickit2 & I get the following...

(which alters in frequency nicely when I touch my fingers across the 250nf cap I have in place in lieu of the C3 sensor pad/cap in the schematic above)
For the capactive touch record, here are my register settings...
Code:
CM1CON0= %10010100 'from the Microchip AN1011a application note.
CM2CON0= %10100000 'from the Microchip AN1011a application note.
CM2CON1= %00110010 'from the Microchip AN1011a application note.
SRCON = %11110000 'from the Microchip AN1011a application note.
VRCON = %10000111 'from the Microchip AN1011a application note.
ANSEL = %00001010 'AN1 & AN4 analogue, the rest Digital.
TRISA = %11111011 'RA1 (C12IN0-) as input, RA2 (C1Out ) output - but not sure if it's in scope here!
TRISC = %00000011 'RC0 (VCC/4) as input, RC1 Input (not sure if it's in scope either), RC4 output (C2OUT)
Thanks for chiming in, your input made me revisit this one last time (I was flagging!) ....that's the simple bit over with (which has taken me two nights!), now the hard stuff - getting this all to work!
Bookmarks