It’s really a matter of reading a pin for a period and outputting that frequency.
You could probably use PULSIN for a period after sorting out mic hardware to trigger the pic input.
I used an LM358 op-amp to drive a condenser mic.
I’m using DT’s timer, and most assembler now, but still a simple program.
On interrupt, a frequency value is written to hardware PWM one way or another (that I haven’t settled on),
then the frequency variable cleared before returning to main program.
The main program only counts audio transitions with the frequency variable in a loop.
Tonight I got desperate and connected a 64.5 MHz crystal to the pic 16F628A and it works fine!
I don’t know if it’s actually clocking at that frequency, but I have used 24/25 MHz crystals which have always gone fine,
and it’s now much faster than them.
Bookmarks