2018-04-18 08:00 AM
Does anyone has been able to use DFSDM to filter data from the internal ADC?
I have ADC triggered by a timer in order to acquire data equidistant in time.
It works fine but I need to filter them better than using its oversampling function.
I removed ADC oversampling and I tried to use DFSDM with no results.
This is my initialization code:
DFSDM_Filter_HandleTypeDef hdfsdm_filter0;
DFSDM_Channel_HandleTypeDef hdfsdm_channel0;hdfsdm_channel0.Instance = DFSDM_Channel0;
hdfsdm_channel0.Init.OutputClock.Activation = DISABLE; hdfsdm_channel0.Init.OutputClock.Selection = DFSDM_CHANNEL_OUTPUT_CLOCK_SYSTEM; hdfsdm_channel0.Init.OutputClock.Divider = 3; hdfsdm_channel0.Init.Input.Multiplexer = DFSDM_CHANNEL_ADC_OUTPUT; hdfsdm_channel0.Init.Input.DataPacking = DFSDM_CHANNEL_STANDARD_MODE; hdfsdm_channel0.Init.Input.Pins = DFSDM_CHANNEL_SAME_CHANNEL_PINS; hdfsdm_channel0.Init.SerialInterface.Type = DFSDM_CHANNEL_SPI_RISING; hdfsdm_channel0.Init.SerialInterface.SpiClock = DFSDM_CHANNEL_SPI_CLOCK_INTERNAL; hdfsdm_channel0.Init.Awd.FilterOrder = DFSDM_CHANNEL_SINC3_ORDER; hdfsdm_channel0.Init.Awd.Oversampling = 128; hdfsdm_channel0.Init.Offset = 0; hdfsdm_channel0.Init.RightBitShift = 0x00; HAL_DFSDM_ChannelInit(&hdfsdm_channel0);hdfsdm_filter0.Instance = DFSDM_Filter0;
hdfsdm_filter0.Init.RegularParam.Trigger = DFSDM_FILTER_SW_TRIGGER; hdfsdm_filter0.Init.RegularParam.FastMode = DISABLE; hdfsdm_filter0.Init.RegularParam.DmaMode = DISABLE; hdfsdm_filter0.Init.FilterParam.SincOrder = DFSDM_FILTER_SINC3_ORDER; hdfsdm_filter0.Init.FilterParam.Oversampling = 200; hdfsdm_filter0.Init.FilterParam.IntOversampling = 8; HAL_DFSDM_FilterInit(&hdfsdm_filter0);HAL_DFSDM_FilterConfigRegChannel(&hdfsdm_filter0, DFSDM_CHANNEL_0, DFSDM_CONTINUOUS_CONV_ON);
I start conversion with: (obviously ADC and timer are started already)
HAL_DFSDM_FilterRegularStart_IT(&hdfsdm_filter0);
But no interrupt comes from DFSDM....
Any one has some experience on it?
Thanks in advance