Relaxation oscillators (for capacititive touch sensing)


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    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).

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    If your Guitar is so sacrosanct, then why even consider sticking stuff to it? Leave it the way the manufacturer intended it to sound and why not simply build a bigger custom wah-wah pedal box with a heap more buttons and functions for controlling your effects?
    Because the end goal here is, is a guitar sustainer, ie infinite sustain (the holy grail for most guitarists) ...there isn't an effect pedal in existence that yields an equal effect (yes, there are guitar sustain pedals, but they're nothing more than glorified compressors/limiters...as the guitar note dies, the compressor pedal merely cranks up the gain to try and counteract, leaving you with a woeful signal to noise ratio & a still dying guitar note)....a proper guitar sustainer, uses an electromagnetic driver to keep the string moving - and that needs to go physically go on the guitar (as it goes this driver will literally be stuck onto the guitar - to save the unpaletteable thought of having to drill the guitar to mount it)

    For those that hold an interest, I made a short video clip where you can hear the end result (it's at a very rough & ready stage here though!) - complete with a breadboarded circuit hosting a 16F690 to one side of the frame (which presently has 5p momentary switches too - those are the puppies I'd like to replace with capacitive sensing switches - I can then use the screws on the scratchplate as on/off switches!)...

    (btw, that ain't no vintage guitar, but my test guitar...no worries if it gets scratched while I mess about mounting/removing driver coils to establish the best one)


    Quote Originally Posted by Melanie View Post
    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).
    I need to sit down in a quiet darkened room & digest that paragraph....but I will!

    rmteo ...thank you for your input, your chosen path - whilst brilliant - is excessive for my meagre switching needs! (I only need three switches & have an unhealthy obsession with keeping the component count low!)
    Last edited by HankMcSpank; - 22nd November 2009 at 18:16.

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    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!
    Last edited by HankMcSpank; - 22nd November 2009 at 20:26.

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, 22: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