- #1
sciguy14
- 5
- 0
Hey all!
I'm trying to drive 5 speakers, each at a different preset frequency. I had been using the timer in my microcontroller to drive one, but it would get very messy to drive 5 simultaneously in software using just the 1 available timer. I've decided to drive each with a Hardware-generated squarewave instead.
I figured the easiest way to do this would be to simply use a circuit like this one:
I'm using an ST M74HC14 Hex Schmitt Inverter for the job. This should theoretically generate a really nice 50% duty cycle square wave. Unfortunately, my speaker seems to disagree. When I drive it via my microcontroller timer I get a nice clean tone, but with this wave, the tone is uneven sounding and a bit choppy.
So, I looked at the two square waves on an oscilloscope. They both looked almost identical except for one thing. The timer-generated wave was precisely 50% duty cycle, whereas the trigger-generated wave was about 52% duty cycle.
Looking more closely at the datasheet for my Schmitt Inverter, I noticed that the output switch wasn't perfectly symmetrical, which is probably the cause the slight duty cycle issue. Here is the datasheet: http://www.st.com/stonline/books/pdf/docs/1901.pdf
So here are my questions:
1. Can a error of only 2% really drastically affect how the speaker sounds?
2. Could this be resolved by moving to a slightly more accurate Schmitt Inverter like this one: http://www.fairchildsemi.com/ds/MM/MM74C14.pdf ?
3. Is there some other way that I should be driving these speakers that I don't know about? (I've tried an op-amp square wave generator circuit with little luck using single supply). I also know that a 555 timer is a common choice, but you can't get to 50% exactly with that.
Thanks for any feedback!
I'm trying to drive 5 speakers, each at a different preset frequency. I had been using the timer in my microcontroller to drive one, but it would get very messy to drive 5 simultaneously in software using just the 1 available timer. I've decided to drive each with a Hardware-generated squarewave instead.
I figured the easiest way to do this would be to simply use a circuit like this one:
I'm using an ST M74HC14 Hex Schmitt Inverter for the job. This should theoretically generate a really nice 50% duty cycle square wave. Unfortunately, my speaker seems to disagree. When I drive it via my microcontroller timer I get a nice clean tone, but with this wave, the tone is uneven sounding and a bit choppy.
So, I looked at the two square waves on an oscilloscope. They both looked almost identical except for one thing. The timer-generated wave was precisely 50% duty cycle, whereas the trigger-generated wave was about 52% duty cycle.
Looking more closely at the datasheet for my Schmitt Inverter, I noticed that the output switch wasn't perfectly symmetrical, which is probably the cause the slight duty cycle issue. Here is the datasheet: http://www.st.com/stonline/books/pdf/docs/1901.pdf
So here are my questions:
1. Can a error of only 2% really drastically affect how the speaker sounds?
2. Could this be resolved by moving to a slightly more accurate Schmitt Inverter like this one: http://www.fairchildsemi.com/ds/MM/MM74C14.pdf ?
3. Is there some other way that I should be driving these speakers that I don't know about? (I've tried an op-amp square wave generator circuit with little luck using single supply). I also know that a 555 timer is a common choice, but you can't get to 50% exactly with that.
Thanks for any feedback!
Last edited: