D/S Three Channel (Module 6*)68C3 Operations Manual North Atlantic Industries, Inc. 12/19/2014Rev: 2014-12-19-0947 www.naii.com Page 246 of 330Interrupt and Status Register Operation/ClarificationUnless otherwise specifically stated, the following represents a general operation/clarification note for the Interruptoperation and its associated/coinciding “latching” – type Status Register(s): An interrupt will be generated when the specific channel interrupt is enabled and there is a detection ofthe respective channel transition change in the appropriate channel of the corresponding Status Register. Status Register(s) are “latching”; as defined, any noted transitional change on any channel will “latch” theentire Status Register. Once latched, there will be no further state change “sensed” by the interrupt mechanism, hence, nofurther interrupts. The act of reading a Status Register will “unlatch” that particular status register (doesn’t necessarily clearimmediately, but will update and clear on the next internal loop cycle). Because transitional changes will “latch” the Status Register, and the interrupt mechanism uses theStatus Register as its trigger, before an interrupt is generated and after an interrupt is generated, theStatus Register must be read “until cleared”.The following is recommended for Interrupt and associated Status Register initialization and handling (assumingvectors and interrupt level (if appropriate) are being properly/appropriately initialized): Power-up Perform normal initializations (card/channel initializations/interrupt vector/interrupt enable/ etc.). Perform a software read loop (part of the host application software initialization routine(s)) on thespecific Status Registers of concern (“loop to clear”) - this would also be similar to an InterruptService Routine (ISR) “loop to clear” function.Ex: Running the ‘loop to clear’ on the appropriate Status Register(s) during the initialization (after I/Ofunction is programmed) will ensure any spurious transitions detected on power-up are “cleared” andthe channel(s) are primed and ready to trigger for interrupts. - for the specific interrupt enabled channels Initial interrupt should occur (if initialized/enabled) Interrupt Software Routine (ISR)The ISR is typically a software (SW) handling branch (part of host application software) structured to “loopto read and clear” the specific Status Register(s) associated with the interrupt type (i.e. H-L or L-Htransition). The SW loop should “read” the Status Register until cleared (typically, this is 2 or 3 times) toensure any other channel transitions are accounted for during the ISR process while the respectiveStatus Register(s) were “latched” – the act of reading the Status Register(s) allows the channel(s) that setthe transition/latch to clear and effectively “re-arm” for the next transition to occur.Ex: The ISR should have the ‘loop to clear’ – to ensure all transitions are accounted for – and thechannel(s) are ready to trigger for next event.Notes: Any channel on the Status Register could latch the register regardless if the channel(s) interrupts are enabled or not. For Status Registers that are bit mapped for either input or output, programming outputs that change transitions willalso “latch” the Status Register(s) – so, a subsequent read to the Status Register after the write operation should beperformed to ensure the Status Register is unlatched, clear and ready to trigger on next event.