Each phase has a status field containing a
bitmask of the PHASE_STATUS flags: gMetrologyWorkingData.phases[0].status.
The following lists useful flag values
defined in the metrology_defines.h file:
- PHASE_STATUS_NEW_LOG (0x0001) –
The background has completed a measurement window; however, the foreground has not yet
processed the measurement.
- PHASE_STATUS_V_OVERRANGE
(0x0010) – The voltage ADC input hits the end stops (clipping detected).
- PHASE_STATUS_I_OVERRANGE
(0x0020) – The current ADC input hits the end stops.
- PHASE_STATUS_ZERO_CROSSING_MISSED (0x4000) – The expected zero crossing did not
occur within the valid window (frequency out of range or signal lost).
To check if a flag is set, display the
status field in hexadecimal format or use a bitwise AND expression:
gMetrologyWorkingData.phases[0].status and 0x4000 are non-zero if a zero crossing
was missed.
Note: For true real-time
monitoring without halting, enable CCS continuous refresh mode (requires an XDS debug probe
with real-time memory access capability). To enable continuous refresh mode:
- Right-select in the Expressions window → Continuous Refresh →
Enable.
- This polls the target memory periodically while the CPU continues running.
- This enablement adds to bus traffic
and can potentially affect real-time performance. Therefore, use this mode
sparingly.