The HWFILT3P3Z (Hardware 3-Pole / 3-Zero Filter) self-test validates a single HW3P3Z filter channel by verifying its low-pass frequency response.
The channel is configured as a 2nd-order IIR low-pass filter and driven through the AHB interface with two tones: an in-band low-frequency tone that the filter passes and an out-of-band high-frequency tone that it heavily attenuates.
Stages exercised: AHB write path (DATA_IN0 trigger), the FILTER_BUSY handshake, AHB read of DATA_OUT, the forward multipliers (cx0..cx3), the feedback multipliers (cy1..cy3), the accumulator, the coefficient scale factors (scaleCX, scaleCY), the output gain (gOut), the output limits (limMax, limMin) and the frequency-selective magnitude response of the IIR section. Because the output swings negative (zero output offset), the 24-bit DATA_OUT payload is masked and sign-extended explicitly by the test.
On devices that provide CY_IP_MXS40PPSS, PPCA exposes two HWFILT3P3Z subsystem instances:
The self-test exercises the full IIR signal path by applying two frequency-selective stimulus tones and verifying the LPF magnitude response. The filter under test is a 2nd-order IIR low-pass filter (3P3Z topology, 3rd pole and zero at the origin, cx3 = cy3 = 0) with a double zero at z = -1 (Nyquist) and a conjugate pole pair close to DC.
The test procedure for each filter channel:
1) Save the original user configuration of the HWFILT3P3Z.
2) Enable the subsystem peripheral, disable the channel, then
program it in CPU accelerator mode (srcSel = AHB, enTrig0 = true)
as a 2nd-order low-pass filter (see the coefficient set below);
re-enable the channel.
3) Drive the out-of-band high-frequency tone, then the in-band
low-frequency tone, each through DATA_IN0 (which supplies the
sample and triggers the computation); poll FILTER_BUSY until idle
(with a defensive iteration bound) and record the peak absolute
DATA_OUT value of each tone.
4) Pass when the in-band peak reaches a minimum threshold and
exceeds HWFILT3P3Z_ATT_RATIO times the out-of-band peak. If the
ERROR_IN_HWFILT3P3Z error-injection flag is set, the status is
flipped so that a fault-free run is reported as ERROR_STATUS.
5) Restore the original filter configuration and return the result.
API Reference | |
| Macros | |
| Functions | |