PIC16F628A frequency generator?

Thread Starter

iflymyhelishigh

Joined Jan 30, 2009
1
Hello. I have been working with PICs. I am wondering if there is a way to output a frequency through a pin to a piezo buzzer. I want to make it beep 3 times. Thank you
 

thatoneguy

Joined Feb 19, 2009
6,359
Microchip and SourceBoost have examples using the PWM Module on the PIC Controller in the PicDem 2+ board, assembly from Microchip, C from Sourceboost. Both of the above are free for download and use, size limitations on Free BoostC.

The sound can also be made with delays in software if your IC doesn't have an unused PWM module. To make a beep without PWM, turn the piezo on for roughly 250uS, then off for roughly 250 uS, repeat that 500 times for a single, roughly half second tone.

Changing delays/ratio (pulse width) is encouraged up or down for preferred sound with your particular piezo size.
 
Top