Hi,
I'm trying to control the volume of a piezo buzzer with a AVR Mega16 microcontoller using PWM. I've got the buzzer hooked up to the PWM pin (OCR1A) and I can set the frequency by choosing a suitable Clock prescale but I'm having problems with volume control. When I vary the PWM duty cycle, the volume DOESN'T change - I just hear some very slight alterations in the tone.
Is this because I'm using a piezo which requires a square wave input? Should I be using some other kind of DC input piezo, or is it just me?!
Any help would be appreciated.
Richard
I'm trying to control the volume of a piezo buzzer with a AVR Mega16 microcontoller using PWM. I've got the buzzer hooked up to the PWM pin (OCR1A) and I can set the frequency by choosing a suitable Clock prescale but I'm having problems with volume control. When I vary the PWM duty cycle, the volume DOESN'T change - I just hear some very slight alterations in the tone.
Is this because I'm using a piezo which requires a square wave input? Should I be using some other kind of DC input piezo, or is it just me?!
Any help would be appreciated.
Richard