Capacitive sensing with the CSM module, 16F1823 & learning about interrupts


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Capacitive sensing with the CSM module, 16F1823 & learning about interrupts

    I'm wondering if we can tempt one of the experienced assembly guys here, to leverage on the "Automatic Context saving" interrupt capability aspect of these new line of PICs, which would place much less burden on the PIC when cap touch is used for switching.

    All we need the associated assembly interrupt to do is this...

    1. store the present timer1 count
    2. setup a running count 'threshold' (by deducting x% from the last timer1 count)
    3. compare present timer1 count with the 'threshold' .....if it is below, then a sensor has been touched, set a 'sensor touched' type flag, if the present timer1 count is not below the threshold, then store 'present timer1 count' away as 'last timer1 count' (for the next interrupt)

    job done!

    Else, if you have a lot of time sensitive stuff going on in your main loop, I fear you almost need to dedicate one pic (eg a 12f1822) solely to cap touch switching duties, due to the high frequency of interrupts needed & the chunky overhead they presently incur.
    Last edited by HankMcSpank; - 10th September 2011 at 15:46.

  2. #2
    Join Date
    Jun 2008
    Location
    Milwaukee, WI
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Capacitive sensing with the CSM module, 16F1823 & learning about interrupts

    OK. I'm missing something here. How do I make sure I have the latest PICKIT2 device file? will I be able to program the 16F1823 in MPLab, or just the stand alone program?

    on Microchip's PICkit 2 Development Programmer/Debugger page, I see the stand alone program v2.61, then the device file, which gives me the PK2DeviceFile-1.62.09.dat file. I deleted the -1.62.09 from the name and replaced the old file with the new one in the program files\Microchip\PICkit 2v2 directory.

    Then when I run the stand alone PICkit2 v2.61 program, I still don't see the 16F1823 in the drop down menu. and MPLAB still has the PICKIT2 greyed out when I load my workspace.

    THen, back to the Microchip PICkit 2 Development Programmer/Debugger page I see the PK2CMDv1.20 - do I need to put that somewhere?

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: Capacitive sensing with the CSM module, 16F1823 & learning about interrupts

    It sounds like you've done everything right, but the only thing I do different is not try & select it in the Pickit standalone app device drop down list (cos it's not listed there!). When you connect your pickit2 to your PIC, then start the pickit2 standalone application, it should detect it.

    If not, try....

    In the pickit2 app, select 'device family' - 'midrange' - '1.8V min

    then 'tools' - 'check communication ...and it should then find it (ie you should see your PIC listed next to the device field)

    re MPLab....still finding my feet with that interface, I don't go there much for now, but here the pickit2 is greyed out too....go figure, the pickit2 standalone app works, but microchips IDE doesn't!

    re the Pickit3...in my opinion it blows (for a start, there's no UART tool)
    Last edited by HankMcSpank; - 10th September 2011 at 23:15.

  4. #4
    Join Date
    Jun 2011
    Posts
    25


    Did you find this post helpful? Yes | No

    Default Re: Capacitive sensing with the CSM module, 16F1823 & learning about interrupts

    I try to use the CVD method on a pic18f but i did not have any luck
    The 18f does not have CSM , they have only mtouch
    The issue with mtouch is that you must touch the sensor to get a response, and if you put a piece of plastic 2-3 mm no way to get it working
    Does anybody has a pieces of working code for pic18f so i can experiment wit capacitive voltage divider method ?
    Thank you

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts