PIC12F675-mTouch application

Any general or miscellaneous queries that do not fit into the other forum catagories

Moderators: Benj, Mods

Post Reply
mfun
Posts: 15
Joined: Tue Sep 30, 2008 3:06 pm
Contact:

PIC12F675-mTouch application

Post by mfun »

Hello,
I'm wish to program a '675 to operate as a single button capacitive touch switch (GP4 output while pressed) using Flowcode V3. I have researched Microchips' site and I have a pretty good concept of what must occur in order to do this (software and hardware). I just need some direction in getting me going in Flowcode. Microchips' website states that any part with a comparator can do this, so with the '675 I think I need to setup the PIC as a relaxation oscillator (output the comparator to GP2(C OUT) through a diode to the touch pad, parallel a +/- 220K resistor to GND and connect all this back to GP0(C IN) to monitor for frequency drop due to added capacitance of a finger touch to GND). I have attached the Application Note that most closely fits my application, unfortunately the code examples they include are in ASM and for a 10F206 part, so literal transfer of hardware and software specifics are not possible. The hardware doesn't concern me too much, but the software using Flowcode does. Will I have to modify the ASM code and use it in 'blocks' or macros within Flowcode? The sleep modes shown in the App Note don't matter at this point.
Thanks in advance-
Attachments
AN1202.pdf
Microchip- Capacitive Sensing with PIC10F
(198.91 KiB) Downloaded 614 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PIC12F675-mTouch application

Post by Benj »

Hello

You can insert chunks of assembler code using the Flowcode C code icon. This come with a ready example of how to embed the assembler code. Most assembler code will remain the same across devices so you may be able to port the code directly. However things such as register addresses may change when moving to the replacement device so be aware of this.

Post Reply