cancel
Showing results for 
Search instead for 
Did you mean: 

How to set up DFSDM with timer in CubeMX?

TDJ
Senior III

In CubeMX I am trying to put together DFSDM setup described in STM32L4 workshop: 4.6 New peripherals - DFSDM - App example 2 (PT100 thermometer) but for STM32H7A3VITx. Objective: fill the filter buffer with N samples every 1s. Screenshots below.

I got it working in continuous mode using "regular channel" but not with timer and "injected channel required" - "regular channel" cannot be triggered by internal timer, only "injected" can.

Before starting the 1s timer (HAL_TIM_Base_Start()) I call HAL_DFSDM_FilterInjectedMsbStart_DMA().

Neither DFSDM1_FLT2_IRQHandler() nor DMA1_Stream2_IRQHandler() is being called.

What am I missing? I have tried both Circular and Normal DMA modes.

I have searched all over the Internet for a working example of such setup but I found none.

Please advise.

0693W000008yYmGQAU.png0693W000008yYmLQAU.pngTimer 7 setup:

0693W000008yaaRQAQ.png 

1 ACCEPTED SOLUTION

Accepted Solutions
TDJ
Senior III

There was nothing wrong with this setup. The problem was that filter buffer was way too large and I was not patient enough.  

However, this approach does not fulfill my needs. On every timer tick a new value is added to the buffer and HAL_DFSDM_FilterInjConvCpltCallback() is called when the buffers gets full. To get series of quick measurements (e.g. 1kHz speed) I could increase timer speed but that would put too much unnecessary load on CPU while I do not care about the exact speed as long as it is known. I would be better off using regular conversion started at (e.g.) 1s interval.

View solution in original post

1 REPLY 1
TDJ
Senior III

There was nothing wrong with this setup. The problem was that filter buffer was way too large and I was not patient enough.  

However, this approach does not fulfill my needs. On every timer tick a new value is added to the buffer and HAL_DFSDM_FilterInjConvCpltCallback() is called when the buffers gets full. To get series of quick measurements (e.g. 1kHz speed) I could increase timer speed but that would put too much unnecessary load on CPU while I do not care about the exact speed as long as it is known. I would be better off using regular conversion started at (e.g.) 1s interval.