cancel
Showing results for 
Search instead for 
Did you mean: 

DFSDM 8 serial channels but 4 filters. Why????

delphi
Associate II
Posted on June 11, 2016 at 20:44

I use the DFSDM in multichannel sound card USB. It is 1st time for me.

I have read that the average DFSDM has 8 channels.

When I started the project I have found that STM engineers added only 4 filters for 8 channels. It is incredible. I can't understand why? For exmaple I bought several boards and want to create 8 channel PDM MEMS mic sound card. I have introduced in MEMSIC board and found 4 channel example. I wanted to increase the number of channels. I found near the 5 bugs and correct it. So now I can create it in hardware. But during the introduction in filters I found that it is difficult to make this without integrated filters approach as it be in 4 channel example. Could you help me to understand how can I do that for 8 channels using only 4 digital filters. Or maybe I am wrong?

#dfsdm
41 REPLIES 41
Igor Cesko
ST Employee
Posted on July 18, 2016 at 10:54

Hi Roman,

 The phase in injected mode is ''distorted'' probably of different sampling time when multiplexing: if we multiplex 2 channels then the second channels output data are sampled in different times than first channels data (they are interlaced). Therefore the second channel time waveform is shifted by sampling period time. This time shift is constant reading time scale but it is not constant if we look on it at frequency scale. Because for each higher n-th harmonics looks this constant time shift like more phase shift (periods for higher harmonics are shorter and shorter - therefore the constant time shift is larger time from period => larger phase shift). Try to draw this on paper: 2 time shifted signals (more harmonics inside). But this ''phase distortion'' can be easily corrected in firmware - because we know how long is the time shift and we can easily calculate phase correction for each harmonics and move phases back to correct value. This technique is used in phase sensitive applications if we multiplexing more channels by one ADC (for example: AC energy measurements: P=U*I*cos(fi)).

Regarding the data rate in injected mode:

Maximum output data rate exact formula is written in reference manual:

0690X00000605F8QAI.png

This formula gives for your configuration (3MHz, FOSR=32, FORD=3, IOSR=1):

3MHz/(32*(1-1+3)+(3+1))=30kHz

So - the maximum output data rate is 30kHz. If you are using multiplexing of 2 channels then it will decrease to 15kHz per one channel. But this sampling rate is calculated as theoretical maximum - because there is not continuous mode in injected conversions. So - just after one conversion finishes then there must be initiated trigger to perform next conversion. One way is to configure one filter in injected

scan

mode and in the scan group will be 2 channels. The configuration will be JSCAN=1   =>  for one trigger is performed in continuous mode whole scan group (all channels for one trigger as fast as possible). But then must be initiated trigger (usually timer trigger) to start next couple of conversion. Second way (and better for your application) is to use JSCAN=0  =>  for one trigger is performed only one conversion from scan group (one channel converted) and to perform next conversion (next channel in scan group) is needed to initiate next trigger. This second configuration can be slower - because timer trigger must be initiated after previous conversion finished + some margin to be sure. But advantage of second configuration is equidistant interval between each samples - because only timer trigger defines the time between samples (and there is not conversion after conversion and then waiting for trigger - like in first case).

 You reported 2kHz output sampling rate - this is too slow. Which type of trigger are you using. Try to set the timer trigger for ~10kHz rate - this should be safe value for the theoretical maximum (30kHz) data rate for your configuration (FOSR=32, FORD=3, Fclkout=3MHz).

  Regards

                       Igor

delphi
Associate II
Posted on July 19, 2016 at 11:53

There was no any answer after my last message.

It is bad!

Now I think that STM support cann't solve some problems.

So I solved all my problems ourself and can make my non standard work properly. Thank you. That was a good experience