AnsweredAssumed Answered

STM32F4 playing DPCM with simple PWM + DMA

Question asked by rocca.stephane on Feb 14, 2013
Latest reply on Feb 14, 2013 by rocca.stephane

I'd like to know if it is possible to play sound files in DPCM with a reasonnable quality (understanding human voice is enough) with the following configuration :
- with a standard low quality piezo buzzer,
- with PWM (TIMER8 on channel 3) input without a low pass filter (if the frequency of the PWM is enough high perhaps ?)
- by reading low resolution data (8000 Hz / 8 bits data samples) stored in flash memory, with DMA loading at 8000 Hz ?

I presume I have to set a PWM frequency by a multiple of 8000 Hz + repetition counter to inform DMA it have to load a new data in TIM8->CCR3 every 1/8000 sec: but what would be the DMA event I have to configure to do that ?

Is it possible to inform DMA from the number of data samples to load (sound duration) in such a configuration, in order to stop the readings at the end of the data samples ?

Last question : do you know any existing software to format wave files to DPCM, or I'll need to write my own ?

Thanks a lot, in advance ;)