Programmable Window Comparator Uses A Single Reference

July 9, 2009
Based on a Microchip 12F675 MCU, this programmable window comparator lets users dynamically select the window characteristic and tolerance. It's aimed at voltage-monitoring applications.

A voltage monitor is a common hardware need. But beyond a simple compare, many systems must provide a tolerance around a specific value. Specifications of 2%, 5%, or 10% typically require a windowed comparator, with a voltage reference and resistive divider components for setting the tolerance. All are available in many forms.

The controller described here, based on the Microchip 12F675, allows the user to dynamically select the window characteristic as a tolerance. The voltage-referenced-based trip at pin 7 is converted by the analog-to-digital converter (ADC) at that input (AN0), and the selected tolerance (determined by a two-bit code at pins 4 and 5) is applied to the converter count (see the figure).

The program calculates and applies the two-bit coded tolerance to this measured count and then uses these limits to compare against the converted signal under test, VIN, at pin 6. (For the code listing) The programming code is simple enough, provided in assembly language, with a table-based tolerance map used to define the limit scaling processes. Coded tolerances in the map provide for a ±2, ±5, ±10, or ±20% window.

Pin 3 outputs a low true for “VIN in tolerance.” Pin 2 outputs a low true for “VIN less than the maximum tolerance.” Accounting for the converter, algorithm, and reference-based tolerances and variations, the trip error will be less than four or five steps. For this application, using 3.296 V (4.096 V × \\[4.12/5.12\\]) at the ADC (AN0) and 2% tolerance, the measured trip errors at ambient temperature were 2 to 5 mV. This is less than two converter steps.

The monitor’s responsiveness reflects its processing base. Using the 4-MHz internal oscillator option, the maximum response is less than 200 µs. For best performance, the voltage-based trip at pin 7 should be at least half the full-scale reference used for the converter, configured in this application to utilize the controller’s VDD pin. This allows the calculated ADC limits, based on the selected tolerance, to include the full resolution that’s available from the converter.

The reference value at pin 7 and tolerance settings at pins 4 and 5 are coded to be monitored and re-applied continuously. This single design, therefore, provides a dynamic multiple-tolerance control for applications that must support multiple characteristics. Also, the 10-bit ADC features of the controller can be reconfigured for other PIC controller products, such as the 12HV615.

Sponsored Recommendations

Understanding Thermal Challenges in EV Charging Applications

March 28, 2024
As EVs emerge as the dominant mode of transportation, factors such as battery range and quicker charging rates will play pivotal roles in the global economy.

Board-Mount DC/DC Converters in Medical Applications

March 27, 2024
AC/DC or board-mount DC/DC converters provide power for medical devices. This article explains why isolation might be needed and which safety standards apply.

Use Rugged Multiband Antennas to Solve the Mobile Connectivity Challenge

March 27, 2024
Selecting and using antennas for mobile applications requires attention to electrical, mechanical, and environmental characteristics: TE modules can help.

Out-of-the-box Cellular and Wi-Fi connectivity with AWS IoT ExpressLink

March 27, 2024
This demo shows how to enroll LTE-M and Wi-Fi evaluation boards with AWS IoT Core, set up a Connected Health Solution as well as AWS AT commands and AWS IoT ExpressLink security...

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!