SPRUJ17H March 2022 – October 2024 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
The digital filter works on a window of FIFO samples (SAMPWIN + 1) taken from the input. The filter output resolves to the majority value of the sample window, where majority is defined by the threshold (THRESH) value. If the majority threshold is not satisfied, the filter output remains unchanged.
For proper operation, the value of THRESH must be greater than SAMPWIN / 2.
A prescale function (CLKPRESCALE) determines the filter sampling rate, where the filter FIFO captures one sample every CLKPRESCALE system clocks. Old data from the FIFO is discarded.
A conceptual model of the digital filter is shown in Figure 7-335.
Equivalent C code of the filter implementation is:
if (FILTER_OUTPUT == 0) {
if (Num_1s_in_SAMPWIN >= THRESH) {
FILTER_OUTPUT = 1;
}
}
else {
if (Num_0s_in_SAMPWIN >= THRESH) {
FILTER_OUTPUT = 0;
}
}
The configurable digital filter output is for filtering glitches. The application chooses between filtered or raw output of the comparator, and the output can reach the event flag register (SDIFLG.FLTx_FLG_CEVTx) and the CEVETxOUT event output of the SDFM module as show in Digital Filter Outputs. The figure also shows rise edge detection logic along the path from the filter to flag register.
When the digital filter path is chosen, the event flag register is set only once on the rise edge of digital filter output. If the event flag register is cleared, the flag is not set again even if the comparator output is maintained high. The issue is not present on the CEVETxOUT event going to XBAR nor if the raw output path is chosen (aka CEVTxDIGFILTSEL = 0).
Filter Initialization Sequence
To make sure of proper operation of the digital filter, the following initialization sequence is recommended: