SPRUJ55D September 2023 – July 2025 AM263P2 , AM263P2-Q1 , AM263P4 , AM263P4-Q1
The Phase and Gain correction block can estimate and correct gain errors during rotation. The Phase and Gain correction will not work if there is no rotation. This diagnostics feature can be used for detecting drift in the gains of Sine and Cosine Inputs to RDC. The Phase and Gain Correction Block contains an Estimation Block and a Correction Block.
The below registers will contain the estimated values from the Phase and Gain estimation block, needed to estimate the respective gains. Note that 'sq' in the name of these registers indicate the gain is squared.
The diagnostic block would monitor these and compare with the set low and high Gain Drift thresholds. Typically select low and high Gain Drift thresholds of 0.7 and 0.9 respectively if the external signal conditioning circuitry(Analog Front End of RDC) will set external gain to 80%(0.8 times) of the ADC input range. These checks will be two indepedent parallel checks for Sine and Cosine signals.
Assuming minimum gain is 0.7 and maximum gain is 0.9 (1 being the normalized full-scale input range of the ADCs):
The below Table 7-129 shows the relevant diagnostics registers for both RDC0 and RDC1.
| RDC Instance | Diagnostic Register Name | Physical Address | Offset |
|---|---|---|---|
| RDC0 | DIAG14_0 | 502C B0CCh | 0CCh |
| DIAG15_0 | 502C B0D0h | 0D0h | |
| RDC1 | DIAG14_1 | 502C B22Ch | 29Ch |
| DIAG15_1 | 502C B238h | 2A0h |
The below Table 7-130 shows the corresponding bits to be programmed in the diagnostics registers.
| Diagnostic Register Name | Bit | Field | Type | Reset | Typical Programmed Value | Description |
|---|---|---|---|---|---|---|
| DIAG14_0 DIAG14_1 |
31:16 | gaindrift_threshold_lo | R/W | 0h | 16056 | Gain Drift Low Threshold |
| 15:0 | gaindrift_threshold_hi | R/W | 0h | 26542 | Gain Drift High Threshold | |
| DIAG15_0 DIAG15_1 |
7:0 | gaindrift_glitchcount | R/W | 0h | - | Counter limit for times drift error is detected before issuing and error |
The below Table 7-131 shows the register bits of IRQ registers to be used for Reading Status, Enabling/Disabling the Error Diagnostic check.
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 19 | gaindrift_cos_hi_err | R/W | 0h | Cosine Signal Gain Drift Crossing the High Threshold Error |
| 18 | gaindrift_cos_lo_err | R/W | 0h | Cosine Signal Gain Drift Crossing the Low Threshold Error |
| 17 | gaindrift_sin_hi_err | R/W | 0h | Sine Signal Gain Drift Crossing the High Threshold Error |
| 16 | gaindrift_sin_lo_err | R/W | 0h | Sine Signal Gain Drift Crossing the Low Threshold Error |
The typical steps for programming the Sine and Cosine DC Gain Drift checks are mentioned below.
Associated AM263Px MCU+ SDK API with this check: Diag_Mon_SinCos_Gain_drift_data