PicoMite: driving a passive buzzer


Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 11:59am 28 Nov 2022      

Hi folks,

I have some passive buzzers "Mini Piezo Passive Buzzer (9042) 16 ohm, 3V" and I'd like to get some life out of them on a PicoMite (non-VGA if that matters).

The monkey's first effort:

1. OPTION AUDIO GP0, GP1
2. Connect (+) on buzzer to GP0, Connect other buzzer to GND
3. PLAY TONE 600, 600, 1000
4. Very, very faint buzz

PLAY SOUND 1,L,S,600,25 or PLAY SOUND 1,B,S,600,25 seems to produce nothing.

I guess this is something to do with "The audio signal is superimposed on a square wave as a pulse width modulated (PWM) signal ..." but the solution given in the manual to that "... a low pass filter is required ..." which I can build/copy then needs a "following amplifier" (whatever that might happen to be) after it.

Can I make PLAY TONE/SOUND work with a buzzer and some basic components ? This is for a little hand-held game project.

I have also driven one of these buzzers connected to GP2 with PWM directly:

1. SETPIN GP2,PWM1A
2. PWM 1,600,50
3. An audible tone

So this is better if rather "closer to the machine" than I was hoping to go.

Note that the manual (at least the version I have) says the duty for the PWM command is optional, though not the comma before it ... this does not seem to be true, you get a syntax error if no duty is supplied.
PWM channel, frequency, [dutyA] [,dutyB]

I also had some problems with the syntax and the PicoMite rebooting with "Error : Invalid address - resetting" but I think that has been resolved by a firmware update.

Best wishes,

Tom