1
\$\begingroup\$

As a learning experiment, I am trying to use PWM to transmit audio in the FM band (80MHZ - 108Mhz).

Currently, I have a PWM output with a prescaler of 0, ARR of 1, and pulse width of 1. Since I'm using the STM32F4 with a max APB2 clock of 90MHZ, I am able to achieve a 90MHZ output (that looks like a saw-tooth wave on my oscilloscope).

Additionally, I created a separate timer that runs at 3KHZ, to toggle the PWM ARR from 1 to 2 (modulating the frequency). This creates an audible 3KHZ tone when listening on the radio.

Now I'm stuck when thinking about how to actually play raw PCM audio. From my limited understanding, I would want at least 8 bit depth for the audio, but with my current PWM settings, I don't think that's possible or maybe I'm missing something obvious? Perhaps there's another way around this or I've hit the wall with what I can do using this method?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Maybe you could modulate the entire system (or just the timer) input clock by mucking with the PLL values. We're only talking about a fraction of 0.1%. The freedom you have depends on the STM32- STM32F411 have a single PLL where you can multiply by a variable number. Others like the H7 have much more available hardware.

enter image description here

Lock time is specified as a couple hundred microseconds which sounds promising, at least for crude audio. Presumably small deviations could be faster.

If you want to go more analog, you could replace the crystal with an LC circuit with a varactor diode forming part of the resonant tank circuit. Then create a deviation signal with an ADC from the MCU itself.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.