ModusToolbox Safety Test Library
Loading...
Searching...
No Matches
ATOP AFE (ATOP AFE STL module)

General Description

PPCA ATOP AFE (Analog Front End) programmable-gain verification self-test.

The AFE is a differential programmable-gain amplifier placed in front of the 12-bit SAR ADC. Each of the four ADC groups has one AFE, on the first differential channel (channel 0) of that group:

  • ADC group 0: AIN0P / AIN0N
  • ADC group 1: AIN4P / AIN4N
  • ADC group 2: AIN6P / AIN6N
  • ADC group 3: AIN8P / AIN8N

The self-test verifies that the amplifier applies the expected gain to a differential input. It converts the same differential input three times:

  1. with the AFE off (the raw, un-amplified input),
  2. with the AFE at its 8.25x gain setting,
  3. with the AFE at its 16.5x gain setting, and checks that the two amplified codes match 8.25x and 16.5x of the raw code (and therefore that the 16.5x code is about twice the 8.25x code), within a caller-supplied tolerance. Because the expected codes are derived from the measured raw code, the check tracks the actual applied stimulus: source or temperature drift moves the raw code and the expected amplified codes together, while the tolerance absorbs residual gain error.

Required external stimulus

The AFE differential input is a dedicated analog pin pair (AINxP / AINxN) that has no on-chip stimulus source, so this is an EXTERNAL-reference test: before calling it, the application must apply a small, stable differential voltage across the selected group's AFE pins, within the AFE input window:

  • both pins within [VSSA - 0.25 V, 1 V] (common-mode limit),
  • a small differential, so the amplified result stays on-scale. The 16.5x reading reaches full scale once the raw differential exceeds about 1/16.5 of the ADC range, so keep the raw differential well below that (a raw code of a few tens is a good operating point). The test reports failure if the raw code is outside the caller's expected window or if either amplified code is saturated, so an absent or out-of-range stimulus is detected rather than silently passing.

More Information

The test procedure for one ADC group:

 1) Save the ADC and AFE configuration registers that the test modifies.
 2) Convert differential channel 0 with the AFE off, obtaining the raw
    (un-amplified) code, and confirm it lies inside the caller's
    expected raw window (stimulus present and in range).
 3) Convert the same channel with the AFE at 8.25x and then at 16.5x.
 4) Confirm neither amplified code is saturated, and that each matches
    the raw code scaled by its gain (8.25x, 16.5x) and that the 16.5x
    code is about twice the 8.25x code, all within the tolerance.
 5) If the ERROR_IN_ATOP_AFE error-injection flag is set, corrupt one
    amplified code beyond the tolerance so that a fault-free run is
    forced outside the acceptance window and reported as failed.
 6) Restore the original ADC / AFE configuration and return the result.
Note
The application is responsible for calling Cy_PPCA_CNFG_Init() and Cy_PPCA_Enable(), and for bringing up AREF, before calling this function. The ADC and AFE are enabled and restored by the test itself.

API Reference

 Macros
 
 Data Structures
 
 Functions