STM32F4 + amlifier STA508

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Nedoja
Posts: 2
Joined: Tue Apr 09, 2013 6:16 pm

STM32F4 + amlifier STA508

Post by Nedoja »

Hello,

I am doing a program where processing audio signal with sampling frequency of 48 kHz and 24 bit. To amplify sound using digital amplifier STA508. Amplifier has only transistors and input signal to be "PWM". Unfortunately, I don't know how to get such a "PWM" from the processor. PWM doesn't have sufficient resolution or speed. I tried delta sigma modulator together with interpolation filter and FIR. Unfortunately, I don't know what to send out bit by bit from the processor to the amplifier. I tried to SPI but there was a delay between packets during interrupt and thus leads to a large distortion sound. I need still to send bits.
Does anyone have any idea?

Nedoja
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F4 + amlifier STA508

Post by Giovanni »

Hi,

I don't know that amplifier but there is the STM32 PWM driver that probably you could use, it allows to change the duty cycle dynamically using a callback.

If you need to send a sequential bit stream then you need an SPI driver operating with a circular buffer (no interruptions in the stream), this is feasible but not available in ChibiOS in this moment.

Giovanni
Nedoja
Posts: 2
Joined: Tue Apr 09, 2013 6:16 pm

Re: STM32F4 + amlifier STA508

Post by Nedoja »

This amplifier contains only transistors that amplify PWM pulses is filtered and then see the picture http://en.wikipedia.org/wiki/File:Pwm_amp.svg but instead "C block" is STM32. Unfortunately I can not use PWM because clock frequency of 168MHz and audio sampling 48kHz ( 168Mhz / 48kHz = 3500 quantization levels cca 10 bit instead 24 bit (16 777 216 quantization levels)). Thus leads to degradation of the sample :-(.
It would be best with a circilar buffer I2S or two buffers for sending a bit stream.

Nedoja
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F4 + amlifier STA508

Post by Giovanni »

Hi,

In the old forum on SF there is this thread where an SPI with circular buffer has been discussed: https://sourceforge.net/p/chibios/discu ... /2579760c/

I doubt that the patches there would apply on the current code but you could try to port them on the current SPI driver and make your own custom version.

Giovanni
Post Reply