JAJSHG4 May 2019
ADVANCE INFORMATION for pre-production products; subject to change without notice.
The internal digital window comparator (DWC) is available in all functional modes of the device (see the Device Functional Modes section for details). The digital window comparator controls output of the ALERT pin buffer. The ALERT pin can be configured as open-drain (default) or push-pull output using the ALERT_DRIVE bit in the ALERT_PIN_CFG register. Figure 7 shows a block diagram for the digital window comparator.
The low-side threshold, high-side threshold, event counter, and hysteresis parameters are independently programmable for each input channel. Figure 8 shows the events that can be monitored for every analog input channel by the window comparator.
To enable the digital window comparator, set the DWC_EN bit in the GENERAL_CFG register. By default, hysteresis is 0, the high threshold is 0xFFF, and the low threshold is 0x000. A 12-bit straight binary code cannot be higher than 0xFFF or lower than 0x000, thus the thresholds have no effect unless set to different values. Figure 8 shows the various types of event that can be detected by adjusting the thresholds. For detecting when a signal is in-band, the EVENT_RGN register must be configured. In each of the cases shown in Figure 8, either or both EVENT_HIGH_FLAG and EVENT_LOW_FLAG can be set.
The programmable event counter counts consecutive thresholds violations before alert flags can be set. The event count can be set to a higher value to avoid transients in the input signal setting the alert flags.
In order to assert the ALERT pin when the alert flag is set for a particular analog input channel, set the corresponding bit in the ALERT_CH_SEL register. Alert flags are set regardless of the ALERT_CH_SEL configuration if DWC_EN is 1 and the high or low thresholds are exceeded.