STM32F303 Comparator & ADC for AC RMS measurements
I come from the PJRC Teensy 4.x after many years playing around with it and building a product or two based on it. (NXP IMXRT chip)
But for a new project I need to be able to rapidly calculate the RMS value of an AC sine wave from an audio signal, with a wide range of 10Hz to 20Khz.
I was looking and googling and found that the F303 has a 5MSPS ADC and can also use the comparator at the same time on the same pin.
My need/goal is to be able to detect zero crossing point with the comparator, trigger an interrupt that will kickoff ADC readings/calculations and then once another interrupt arrives at the next zero crossing, stop the current ADC readings, switch buffers and start again for the next half cycle of the sine wave.
Is this something the 303 could handel?
I would also need to offset the ADC input to be able to handle the ac value, and also provide the comparator with the extact same offset voltage for the zero crossing point.
So what I looking for is confirmation of the ability to do what I need, and also if someone has a schematic of how I would hook up the hardware - that would be great!
