Also displayed is byte value of POT connected to RA0.
I have used a 16F88 configured for 8MHz internal oscillator. This cuts down component count.
You can use output's RA1 to ground which produces 5V Peak, or use RA1 and RA2 and this produces 10V Peak since RA1 o/p is complement to RA2.
I have tested O/P with a frequency counter and frequency on my setup is very close to displayed frequency.
If you have a piezo transducer with unknown resonant frequency, just connect between RA1 and RA2.
Adjust POT to vary frequency through whole range. When Volume is at its loudest, then you have found the correct working frequency.
If you find transducer too loud then connect between RA1 and GND.
When compiling code, You will see the following warning:
Code: Select all
Freq Gen1.c(1092): WARNING: This interrupt has previously been enabled, so the macro <Timer0_tick> may never get called.
Freq Gen1.c(1105): WARNING: This interrupt has previously been enabled, so the macro <Timer0_tick> may never get called.
Freq Gen1.c(1118): WARNING: This interrupt has previously been enabled, so the macro <Timer0_tick> may never get called.
Since within code, interrupt is disabled first, message does not apply. Martin