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


Results 1 to 6 of 6

Threaded View

  1. #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

    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.

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