Relaxation oscillators (for capacititive touch sensing)


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default

    Hi HankMcSpank,

    Here's their simple schematic here (source = http://ww1.microchip.com/downloads/e...tes/01171B.pdf) ...
    The application note that you refered to in your first post is about a built-in capacitive sensing module in the PIC16F72x series. You are using something else, the 16F690. The capacitive sensors can be done with the 16F690, but that is the hard way. With the PIC16F72x series it is much simpler. You don't need comparators or any external components. I have built some of these capacitive switches for some of my projects and they work like a charm.

    Check out in this forum some posts by Byte_Butcher and myself about this touchsensors. We have already struggled to make these chips work but finally we got it.

    Just as a final note, by using an oscilloscope to see the signal changes you are adding a lot of capacitance to the line and this is no good when detecting capacitance from your fingers.

    Robert

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rsocor01 View Post
    Hi HankMcSpank,



    The application note that you refered to in your first post is about a built-in capacitive sensing module in the PIC16F72x series. You are using something else, the 16F690. The capacitive sensors can be done with the 16F690, but that is the hard way. With the PIC16F72x series it is much simpler. You don't need comparators or any external components. I have built some of these capacitive switches for some of my projects and they work like a charm.

    Check out in this forum some posts by Byte_Butcher and myself about this touchsensors. We have already struggled to make these chips work but finally we got it.

    Just as a final note, by using an oscilloscope to see the signal changes you are adding a lot of capacitance to the line and this is no good when detecting capacitance from your fingers.

    Robert
    All good points well made...I did get a bit carried away with my linkage above, but I'm basing most of this 16F690 stuff on http://ww1.microchip.com/downloads/e...tes/01101a.pdf ...which is using the same method I'm targetting here comparator+SR latch vs the capactive sense module). I do have a PIC16F726 winging it's way to me...but the extra piN count (ie bigger size), is not that welcome!

    Good point about the scope though...since we're talking picofarads, you're quite right...it's going to have a major impact on the results (but allow me to wallow for just a few minutes & enjoy those oscillations onscreen ...it's taken me two nights to see 'em!)

    Re byte_butcher's post - yep, it's a good 'un (tks Msr Butcher!), albeit he uses the CSM of the 16f72x series.

    I've actually already stumbled at the next hurdle of this embryonic second stage ...ie where I'm presently parachuting in bits of byte_butchers interupt code into mine. (plagiarism is alive and well)....

    I saw DT's reply on that thread ( http://www.picbasic.co.uk/forum/show...00&postcount=5) & have modified the DTS-INTS-14.Bas file in accordance with his instructions (& the other bits & bobs), but when I come to compile I get a whole heap of erroRs along the lines of TMR1GIF Symbol not previously defined in the ASM file....????

    I'm well out my depth here...so now off to get a scuba tank.
    Last edited by HankMcSpank; - 22nd November 2009 at 22:02.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HankMcSpank View Post
    I saw DT's reply on that thread ( http://www.picbasic.co.uk/forum/show...00&postcount=5) & have modified the DTS-INTS-14.Bas file in accordance with his instructions (& the other bits & bobs), but when I come to compile I get a whole heap of erroRs along the lines of TMR1GIF Symbol not previously defined in the ASM file....????
    The 16F690 does have a Gate control on Timer1.
    But it doesn't have a TMR1GIF bit, and doesn't generate interrupts for the gate.
    <br>
    DT

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    The 16F690 does have a Gate control on Timer1.
    But it doesn't have a TMR1GIF bit, and doesn't generate interrupts for the gate.
    <br>
    Hmm (rubs chin, pretending to understand the significance of what you're saying - but nevertheless knowing full well it's *BAD*). As it goes, I was just about to say, I'm getting this when I compile...

    "Symbol not previously defined (TMR1GIF)" (which may/may not be related to what you're saying, l- modified your files as per your instructions to byte_butcher - I'm out my depth at the moment...but learning fast!)

    From the Microchip application note- http://ww1.microchip.com/downloads/e...tes/01101a.pdf (which embraces this method with the 16F690)...

    "Once the oscillator is constructed, its frequency must
    be monitored to detect the drop in frequency caused by
    a finger press. Figure 5 shows a more complete schematic
    where C2OUT not only drives the oscillator, but
    also is fed into the clock input of Timer1, T1CKI. Each
    time C2OUT changes from ‘0’ to ‘1’ Timer1 will increment.
    Unhindered, Timer1 will increment non-stop and
    eventually roll over, but this is not useful for capacitive
    sensing.
    To make it useful, a fixed time base is used to measure
    the frequency over a defined period. Timer0 provides
    this fixed period time base. At the start of a measurement,
    Timer0 is cleared, and it will count up to 255 and
    then it will overflow. On overflow, the Timer0 interrupt,
    T0IF, causes the program to vector to the Interrupt Service
    Routine.
    "



    As a beginner, could you tell me the significance of your news...

    1. I can't use your interupt routines?
    2. Their proposed method wont work? even though from the same datasheet, they say this ...

    "There are currently three families of PIC microcontrollers
    able to use the method as shown. These are the
    Microchip PIC16F616 family, PIC16F690 family and
    PIC16F887 family."


    Grateful for the clarification!
    Last edited by HankMcSpank; - 22nd November 2009 at 23:19.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The significance is that you are trying to use features that your selected PIC does not have (TMR1GIF).

    So you will need to make more than syntax changes to get it to work.
    The overall method used will need to be different, and it's one that I have never investigated.
    <br>
    DT

  6. #6
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    The significance is that you are trying to use features that your selected PIC does not have (TMR1GIF).

    So you will need to make more than syntax changes to get it to work.
    The overall method used will need to be different, and it's one that I have never investigated.
    <br>
    Ok, roger that...I'm in the Sierra Hotel Indigo Tango (hey ho, two nights apparently wasted). Thanks for the early interjection at this point though ...I'd have ended up looking like a 'ZZ Top Guitarist after a night on the razzle' trying to sort this one myself.

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Don't give up ...

    I'm sure it can be done.
    But copy/paste from a 16F726 program will only confuse you.

    You've got an Oscillator running ...
    So if the C2OUT pin were connected to the T1CKI pin, then Timer1 could count the pulses.

    Make a "Time Base" with Timer2 and the CCP1 pin (a.k.a. HPWM at lowest freq) connected to the T1G pin.

    Then use TMR2_INT to read the Timer1 value, which should be directly proportional to the frequency. Not sure how good the resolution will be, but that's what experimentation is for.
    <br>
    DT

Similar Threads

  1. Need a cheap touch sensor idea.. here it is
    By mister_e in forum Code Examples
    Replies: 20
    Last Post: - 16th April 2016, 23:42

Members who have read this thread : 0

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

Posting Permissions

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