0
\$\begingroup\$

I have several piezoelectric crystal speakers connected to a TI MSP430 series MCU.

All speakers share a common PWM driven MCU pin and each one use a distinct MCU pin to select them. If only one of those select pins is driven low or high and the others are in open state, one distinct speaker can output the audio waveform delivered by the PWM pin. The peak-to-peak PWM amplitude is 3V this way, as the select pins can't be driven by the PWM frequency too.

Now I need to raise the volume level of the audio output.

I tried to use an integrated amplifier, however the options are scarce as the circuit should be battery powered for years, and only amplifiers with uA standby consumption are usable. I tried some, but they are meant for analog input and can't cope with the PWM drive, thus producing a massive noise floor.

What else options are there? It is possible to use some IC providing an balanced PWM drive (eg. dual H bridge to provide 6V peak-to-peak) which operate with one-digit uA standby power? Or is there any discrete circuit with equally low static consumption?

\$\endgroup\$
  • \$\begingroup\$ You may need to explain what a crystal speaker is, and provide a link to its datasheet. A schematic diagram of the drive circuit to the speaker would be helpful. \$\endgroup\$ – Steve G Oct 1 '16 at 19:01
  • \$\begingroup\$ A flat speaker using a piezoelectric crystal, see en.wikipedia.org/wiki/Piezoelectric_speaker . The speaker is just connected to two MCU pins, one is driven GND, the other one by a PWM signal switiching between VCC and GND. \$\endgroup\$ – dronus Oct 1 '16 at 19:21
  • \$\begingroup\$ @dronus - please update your question with extra information. Please don't leave information in the comments as it helps people reading the question to have it all in one place. Would you please post a link to the actual piezo-speaker part? Is the speaker just making a simple buzzing noise, or is the signal more sophisticated? I'm wondering if you could use a voltage multiplier, but that isn't likely to carry signal information faithfully. \$\endgroup\$ – gbulmer Oct 1 '16 at 20:18
  • \$\begingroup\$ The speaker is driven for full PCM audio by 32kHz 8bit PWM. \$\endgroup\$ – dronus Oct 16 '16 at 12:54
1
\$\begingroup\$

To provide 6V peak to peak (thus increasing volume), you need the select speaker pin to be driven out of phase, as you suggest.

Now, nothing really prevents you to have this pin:

  • either driven by the PWM (with 180 phase shift)
  • or high impedance to shut the speaker off.

If you can't do it without external components because the MCU doesn't have enough PWM outputs, or because it doesn't allow you to configure them as required, let's use simple logic gates to do that. What you need is just an inverter gate (actually one per speaker) that has an enable input which puts the output in high impedance. You feed the input with the PWM, and the output enable with your select signal. The output goes to the speaker terminal (the other terminal being fed with the PWM directly, just like it currently is).

Of course, such a chip doesn't exist off-the-shelf. So a solution is to use a single inverter (but I'm sure you can actually avoid it by configuring the MCU to directly output a complementary PWM signal), followed by some buffer with 3 state outputs and independant output enable: 74LVC125, can feed four spakers. Typically 1uA current consumption.

If you have a lot of speakers, you'll need several 74LVC125 and their quiescent currents will add up. At some point, it may become too much. In that case, gate their supply with a small P-channel MOSFET that you turn on (using an additional GPIO) only when at least one speaker is active. Then, only the FET leakage will be consumed most of the time. In this case, however, make sure from the software that the PWM output and all select lines from the MCU are tristated when the MOSFET is off, because otherwise, you may burn the buffer chips.

\$\endgroup\$
  • \$\begingroup\$ It is not possible to have the phase inverted PWM output too, due to the internal circuit of the MSP which drives only one pin using a hardware PWM and interrupt routine for value update. The device would drive several pins at lower frequencys, but high accuracy is needed in the audio frequency range which means close-to-limit operation for the MSP430. \$\endgroup\$ – dronus Oct 13 '16 at 13:08
  • \$\begingroup\$ I will try the inverter and 74LVC125 solution. I also considered miniature dual H-bridge drivers with standby, but they are extremely hard to get in small amounts (and hard to prototype with them too due to .3 mm pad pitch). \$\endgroup\$ – dronus Oct 13 '16 at 13:11
  • \$\begingroup\$ I never worked with MSP430, but still, wouldn't it be possible to avoid the inverter by using two different PWM blocks configured with the same frequency but opposite phases? Wastes an additional PWM peripheral, but you gain a BOM line and another uA. \$\endgroup\$ – dim Oct 13 '16 at 18:50
  • \$\begingroup\$ Theoretically yes, but my MSP430 already need to drive an realtime clock, read from SD card and so on. As I drive one of four speakers, the opposite pin would be selected as one out of four, and PWM pins are scarce and hardwired to the timer units. So there are never 5 PWM pins available if anything else need timers. May work, if two PWM pins are used and additionally 4 outputs selecting the speaker. But that would need even more external logic, sapping power I guess. \$\endgroup\$ – dronus Oct 16 '16 at 12:33
  • \$\begingroup\$ Also while doing PWM as such is easy, doing "updated" PWM (eg. audio output) is quite complex, as the software needs to update the PWM value under strict timing conditions. There are 8M time slots for 32kHz 8bit audio, which means that theoretically the update has to match 1/8M s, on a 16MHz device. This is quite sporty already even with one PWM. \$\endgroup\$ – dronus Oct 16 '16 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.