When analog signals need to be monitored, the most common components used for this task are ADCs. There is nothing wrong with ADCs for many different functions, but they are best used when precise measurements of a voltage level are needed. When a simpler measurement is needed, such as when a signal exceeds a certain voltage level, the typical approach is to use a comparator or a window comparator. For example, one common application in power monitoring is to monitor when a voltage is between two levels and notify an MCU when this voltage range is violated.
While this can be done with an ADC, this requires significant effort in the PCB layout and application development. Window comparator circuits are much simpler, and they can be made ultra compact using GreenPAK from Renesas. I'll show how to create these types of designs and why you should select a window comparator instead of an ADC for voltage monitoring.
A basic window comparator is shown in the circuit diagram below. A simple window comparator can be designed using two individual analog comparators and an XOR gate, where the positive power rail of the window comparators is set to the same logic level as the XOR gate. Due to the positive feedback in the comparators, each comparator will go high when the monitored voltage signal exceeds the reference voltage threshold. This ensures that only one of the comparators is on when the monitored signal is within the desired monitoring range.
The following image shows the output waveforms for this window comparator circuit. As we can see from the waveforms, the window comparator output from the XOR gate is only high when the monitored voltage is between the two reference threshold levels. Once the monitored voltage rises above the highest threshold, the comparator output drops to zero. Eventually, when the monitored voltage drops from its high level to zero, the comparator output exhibits a momentary glitch where the output goes high at the instant the higher threshold comparator turns off.
How do we typically deal with a glitch like this? In the purely analog domain, we might use a strong RC filter to dampen this glitch; this would only reduce the size or amplitude of the glitch, but it will not prevent the glitch from appearing on the output of the XOR gate.
The best way to completely eliminate the turnoff glitch is to apply a counter to the XOR gate so that the output is delayed by a few clock cycles. This would require constructing the XOR gate from flip-flops or an LUT, which will increase the complexity of the circuitry. With a small amount of delay on the output, the waveforms will look like the following:
The delay also helps in the reverse situation, where the window comparator is very quickly turned on and the monitored voltage passes above the high threshold momentarily. Adding a delay with a counter as shown here would typically require a CPLD or even a small FPGA.
Window comparators that require many functionalities require many components, typically at least a dual analog comparator IC, an XOR gate IC, and a counter or timer with some enable logic. Some designers might omit all this discrete logic and instead perform the individual comparator monitoring with a microcontroller, which then needs some code to perform the required sensing of the comparator outputs. When all of these parts can be consolidated into a single package, a window comparator can be made extremely small and no additional coding effort would be necessary.
The GreenPAK suite of components and developer tools from Renesas give developers exactly what they need to create ultra compact mixed-signal ASICs from a programmable off-the-shelf component. GreenPAK components function like a CPLD with integrated analog interfaces, making them fully programmable for custom applications. This includes the type of functionality needed in a window comparator, effectively acting as a development platform for a custom ASIC.
Within the Go Configure Software Hub, you just can select a GreenPAK part number with a small package, such as the TQFN package shown below.
A small 8-pin component like the SLG46108V from Renesas can be used to build a programmable window comparator with custom digital logic.
A window comparator example built in GreenPAK is shown below. This example integrates all of the analog blocks with programmable references; no external components are required to form this portion of the design. The output from the analog comparator section is then given to an XOR gate, which then outputs a high logic level indicating the monitored signal is within the desired limits. Because the XOR gate is formed from an LUT, it is easy to apply a counter delay which will eliminate the glitching mentioned earlier.
Basic window comparator example designed in Go Configure
Additional digital processing can be performed on the XOR gate output using programmable LUTs. This allows input logic signals from IO pins and the window comparator output to be used in custom logic, and the result can be given to an IO pin.
The mixed-signal processor components and developer tools in Renesas GreenPAK give designers the ability to develop fully custom mixed signal ASICs with window comparator functionality. These programmable mixed-signal processors allow consolidation of functions found in a range of commercially available ASICs and analog circuits, allowing for smaller, more efficient systems. To learn more, take a look at the GreenPAK components and reference examples.
Whether you need to build reliable power electronics or advanced digital systems, use the complete set of PCB design features and world-class CAD tools offered by Altium to implement your GreenPAK solutions. Altium provides the world’s premier electronic product development platform, complete with the industry’s best PCB design tools and cross-disciplinary collaboration features for advanced design teams. Contact an expert at Altium today!