4.2 Interrupts in Metrology Stage

Figure 4-2. Metrology Interrupts Flowchart

The application code can disable any IPC interrupts it does not need.

When an IPC IRQ interrupt arrives, the application code first determines which kind of interrupt occurred, and, then, it checks related Metrology Status Registers and executes its specific handler.

IPC interrupt is defined as the following:

3130292827262524
PULSE2_IRQPULSE1_IRQPULSE0_IRQ
2322212019181716
INIT_IRQSTATUS_IRQ
15141312111098
RZC_IRQ
76543210
CREEP_IRQHALF_CYCLE_IRQFULL_CYCLE_IRQINTEGRATION_IRQ
The sef lib provided by Microchip can be used to set this register:
  • PULSE0_IRQ, PULSE1_IRQ, PULSE2_IRQ: Pulse Interrupts
These interrupts are generated immediately after their respective pulse has computationally committed to be generated, but not necessarily occurred.
  • INIT_IRQ: Initialization Requirement Interrupt
This interrupt is used to inform the application code to initialize the metrology control registers and the ACC_T0, ACC_T1 and ACC_T2 if necessary. It can work with handshake enable.
  • STATUS_IRQ: STATUS Update Interrupt

This interrupt is used to inform the application code of change(s) in priority status bit(s). This feature is not implemented.

  • RZC_IRQ: Raw Zero Crossing Interrupt
This interrupt is generated on zero-crossings using the unfiltered “raw” 16 KHz data stream of the selected direction and selected voltage channel.
  • CREEP_IRQ: CREEP Detection Interrupt

This interrupt is used to inform the application code of detection of a creep condition. This feature is not implemented.

  • HALF_CYCLE_IRQ: Half Line Cycle Interrupt
This interrupt is generated every half line cycle. It means that swell and sag flags were updated. Unlike the RZC_IRQ, the HALF_CYCLE_IRQ uses the 4 KHz narrowband filtered voltage channels and exhibit a deterministic but frequency-dependent phase delay.
  • FULL_CYCLE_IRQ: Line Cycle Interrupt
This interrupt is generated every full line cycle. It means that the frequency and accumulated energy associated with pulse were updated. Unlike the RZC_IRQ, the FULL_CYCLE_IRQ uses the 4 KHz narrowband filtered voltage channels and exhibits a deterministic but frequency-dependent phase delay.
  • INTEGRATION_IRQ: Integration Period Interrupt

This interrupt is used to inform the application code that the whole integration period finishes. It means that all accumulated quantities and status N were updated.