cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3 as class-D modulator

michaelweilguni9
Associate
Posted on August 03, 2015 at 15:34

Hello!

I'm trying to use an STM32F3 to drive a gate driver for a class-D amplifier using sigma-delta modulation. Therefore I use the internal comparator to compare a reference signal with the actual integrated signal of the amplifier output. Depending on the comparator's output, the amplifier is switched on/off. Currently I'm using a timer interrupt at 1 MHz and check the comparator state within the interrupt routine. The routine is quite short but nonetheless the interrupt occurs quite often, limiting the capabilies of the µC.

A D-flipflop with the comparator output as input, clocked by a 1MHz timer would also work, but an external component is required.

Does anyone know another way to toggle an output depending on the comparator state with an update rate of 1 MHz?

Thanks!
1 REPLY 1
jjonethal
Associate II
Posted on August 04, 2015 at 07:21

Try pulse density modulation (PDM) over SPI.

You could also use DMA to reduce interrupt load. Only external components required are low pass filter and speaker. Rc filter might be omitted if noise band is much above passband of speaker.

You only need the data out MOSI signal for this application. SPI clock should be above 1... 3 MHZ for good noise rejection. Add another high pass filter around 20 Hz for speaker protection recommended.

Jjo