Shop OBEX P1 Docs P2 Docs Learn Events
Click not Biiiinnnnggggg — Parallax Forums

Click not Biiiinnnnggggg

John CoutureJohn Couture Posts: 370
edited 2007-03-27 21:13 in General Discussion
PROBLEM DESCRIPTION:

In moving my circuit from a breadboard to a perfboard (i.e. soldered connections), the piezo does not seem to want to give up a nice tone but rather sounds more like a click.·· When I run the perfboard from the SX-KEY I get the tone, but when I take the key off and try to run it from the 4mhz resonator, I get the click.··Running SX18 at 4mhz. ·Other notes:

1) The breadboard version gives tone with either the key or the resonator.
2) I swapped the SX and the resonator with the breadboard, no change, tone/click on perfboard, tone/tone on breadboard.
3) I soldered in the resonator, no change

Because the perfboard works ok with the SX-Key but not with the resident resonator, I'm guessing that it is not a wiring or component issue but rather something that is present on the SX-Key but not in my circuit?

Schematic attached for those intersted.




▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture

San Diego Miramar College

Comments

  • JonnyMacJonnyMac Posts: 9,298
    edited 2007-03-27 19:44
    The breadboard has a lot of stray capacitance that may be helping you. I wonder if you dropped a 0.01uF to ground on that line if it would help smooth out the "tone" to your peizo. How are you creating the tone?
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-03-27 19:49
    John,

    If you experience the problem when you change ONLY the SX-Key by replacing it with a 4Mhz resonator then I suspect you likely have a resonator related problem. The resonator section of your circuit diagram looks fine to me.

    What resonator setting are you using in your DEVICE directive? Is it OSC4MHZ or something else?

    - Sparks
  • John CoutureJohn Couture Posts: 370
    edited 2007-03-27 20:35
    Thank you guys for responding!

    Ok, based on what you two suggested,

    1) I wrote a simple program that just sounds the piezo (see attached) so that we can eliminate sofware problems

    2) Tested program and same characteristics (click on perf, tone on sx-key)

    3) I added a .01uf from positive·on·piezo to ground.· The Piezo then clicked on BOTH the resonator and the SX-Key

    4) Removed cap and got click on resonator, beep on key

    5) The program seemed to freeze up randomlly when the SX-Key is disconnected.· Apparently·when I put my finger across the four terminals where the SX-KEY is connected it seems to execute the program (albiet click, click, click).· Thus, it must be something about capacitance???

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • John CoutureJohn Couture Posts: 370
    edited 2007-03-27 20:38
    I also just tried it with OSC4Mhz and still get click, click ...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • John CoutureJohn Couture Posts: 370
    edited 2007-03-27 20:41
    Hmmmm. Now board runs fine without me touching SX-Key contacts but with OSC4MHZ setting. Interesting.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • JonnyMacJonnyMac Posts: 9,298
    edited 2007-03-27 20:45
    Did you try a series cap as well? In the Help file it shows a series cap for the SOUND instruction, with a 0.1 uF to ground in front of the piezo; you might give that a try. I seem to remember that working much better when I wrote the demo code for SOUND.
  • John CoutureJohn Couture Posts: 370
    edited 2007-03-27 21:00
    RIGHT ON! IT WORKED!

    You were spot on with the caps identified in the SOUND command help file. My apologies for not knowing that. Thanks guys!

    P.S. I was also tickled that I had the parts. After a couple of years of collecting various values of caps, resistors and IC's I was beginning to wonder if I overdid it (grin).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
  • Beau SchwabeBeau Schwabe Posts: 6,572
    edited 2007-03-27 21:04
    You are operating the piezo in a single ended mode, If you are not driving it HIGH and LOW (i.e. open collector or switching the pin between INPUT and OUTPUT mode).... Depending on what the 'sound' command is actually doing, it could make the piezo act this way. If that is the case, try placing a 1K or so resistor across the piezo.· This will effectively 'discharge' the piezo if it is being driven in an open collector mode.

    Here is some information on driving a piezo, that might be helpful....

    http://forums.parallax.com/showthread.php?p=466534

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • John CoutureJohn Couture Posts: 370
    edited 2007-03-27 21:13
    Pretty Cool Beau! I think I actually have an inverter too! (grin, wait till I tell my wife how much I saved in gas by NOT having to go to the local Radio Shack!)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
Sign In or Register to comment.