Using microcontrollers to integrate analog comparators to provide power protection and reduce board space

Publisher:哈哈哈33Latest update time:2012-08-20 Source: EEWORLD Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction

Today, more and more designers are turning to electronic microcontrollers to control power stages in motor control and digital power systems. Using the integrated analog comparator functions of microcontrollers, such as the C2000™ Piccolo™ microcontrollers from Texas Instruments (TI), can protect system power supplies while also allowing designers to reduce the number of external analog components required at the board level. In such motor control and digital power systems, designers are still limited to the analog domain when it comes to protecting against overvoltage or undervoltage in the event of execution errors in the microcontroller itself. By using the integrated analog functions of the TI C2000 Piccolo microcontroller family, systems can be designed around a single controller without the need for external support circuitry. This primarily involves using analog comparators to monitor overvoltage or undervoltage and overcurrent or undercurrent events in the analog domain of the power stage.

Advantages of Piccolo Microprocessors

Piccolo microcontrollers use TI's high-performance TMS320C28x™ core to provide all the performance and peripherals required to control a system with a single standalone controller. With ample headroom and dedicated peripherals, Piccolo microcontrollers enable developers to implement more advanced control algorithms, further improving performance while reducing system cost.

The Piccolo microcontroller architecture has been optimized for digital control applications, with advanced architectural features and enhanced high-speed signal processing capabilities. The Piccolo's main CPU core has built-in digital signal processing (DSP) functions such as single-cycle 32×32-bit multiplication and accumulation units, which greatly improves the calculation speed. In addition, control peripherals such as analog-to-digital converters (ADCs) and pulse width modulators (PWMs) are designed to be very flexible and can be easily adapted to almost any purpose with minimal software overhead. For example, the ADC has an automatic sequencer that allows developers to program it to cycle through samples in a specific order so that the value is ready when the application needs it. With smarter control peripherals and a powerful CPU core, the control loop runs tighter, improving the dynamic characteristics of the control algorithm and reducing interference behavior.

Key Piccolo MCU features include:

• 40 to 90 MIPS of processing performance
• Full-featured operation from a single 3.3-V supply
• Dual internal high-precision oscillators; no external crystal required
• 12-bit ADC with 16 channels and a maximum sampling rate of 4.6 megasamples per second
• Up to 19 channels of PWM outputs with configurable automatic dead time
• Up to 8 of the 19 PWM channels can operate in high-resolution mode, which can be as low as 150 picoseconds
• Integrated analog comparators connect directly between dedicated inputs and PWM outputs (and dedicated output channels), eliminating the need for external analog components

Piccolo MCUs integrate analog comparators

TI's Piccolo microcontroller family offers two or three analog comparators, depending on the device family. In this article, we will focus on the F2802x Piccolo microcontroller family, which is equipped with two comparators. Although both comparators are integrated into the digital device, they operate similarly to traditional 30nS analog comparators. The two comparators are connected to the internal clock of the F2802/3x/6x microcontrollers.

Asynchronous – The comparator blocks operate as long as the device itself has power. The two comparators have two inputs (this is similar to a standard analog comparator, but they are connected to the device pins through the analog input/output (AIO) mux) and have the additional ability to provide an internal reference to the voltage by using the internal digital-to-analog converter (DAC) on the device. This internal DAC function is very important in digital power stage applications such as peak current mode control, because the DAC can be used as a ramp generator for the peak current mode trip point. The output of the comparator block can also be used internally by connecting to the PWM trip area, or referenced externally through the GPIO mux. This white paper focuses on the F2802x device family, but the internal comparator function can also be converted to the F2803x and F2806x Piccolo families.

Using the comparator externally (for F2802x Piccolo microcontrollers)

Because the comparators inside the Piccolo F2802x microcontrollers are implemented as true analog components, they can be used for control functions external to the processor. Referring to Figure 1 below, changes can be made in the general purpose input/output (GPIO) mux to connect the output of the comparator to an external device pin. Rather than having the comparator trigger an internal PWM event (such as when used for "peak current mode control"), the GPIO mux allows the comparator to output an active high or low signal external to the device. The analog input trip point can be characterized as either an internal or external reference with a maximum input of 3.3 volts.


Figure 1. Comparator output achieved with changes in the GPIO mux.

Let’s look at one of these use cases: For systems that use analog controllers in the power stage, the number of board-level components can be reduced when the F2802x Piccolo microcontroller is used as a “maintenance management” microcontroller. This is much the same as in digital control systems, where the analog comparator function can be used to enable or disable the power stage when used with a power device with an enable or disable pin. In many cases, analog comparators can also be used to trip relays in the system or initiate specific processor tasks. Now we can integrate these functions into the microcontroller itself instead of implementing them with external components, saving board space and cost.

Demonstrates the Analog Comparator on the F2802x Piccolo Microprocessor

Now that we have seen the structure and setup of the analog comparators within the Piccolo F2802x microcontroller family, we will now focus on how to use these comparators within the development environment of the TI C2000 LaunchPad evaluation kit. The C2000 LaunchPad is a low-cost evaluation kit that features the F28027 Piccolo microcontroller. The C2000 LaunchPad is equipped with pin headers that allow designers to test the various analog and digital inputs and outputs of the C2000 microcontroller. The kit also includes a separate USB to JTAG interface, which provides protection for the development PC while eliminating the need for expensive external emulator hardware. For the software setup in this example, we will demonstrate the VisSim model-based embedded graphical software tool provided by Visual Solutions, Inc. A two-month free trial of VisSim can be downloaded directly from the company's website at www.vissim.com.

Test case – Comparator event of external reference triggers PWM event

In this test case using the C2000 LaunchPad (Figure 2), we have a very simple VisSim graph that generates a 25Khz PWM signal to drive GPIO0 and GPIO1; it also has an externally referenced comparator signal that triggers a corresponding pair of high and low PWM events and GPIO trips. The example below is a screenshot of the VisSim graph, with the comparator output levels in blue and green and the voltage applied to the input A comparator pin in yellow. In the VisSim graph, the input voltage has been normalized to represent VDDA as 1. On the C2000 LaunchPad, VDDA is set to 3.3. As shown in the figure, we cycle the input signal between 0 and 3.3 V.

In the VisSim graph, the Comparator-1 DAC is set to 0.1 full scale (0.33V) and the Comparator-2 DAC is set to 0.9 full scale (2.97V). The DAC values ​​are graphically represented in red in the same subgraph as the input voltages so that it is obvious when a comparator trips. Additionally, we have configured Comparator-1 to fully turn the PWM on when the input voltage is below the DAC value of 0.33V. We have also configured Comparator-2 to fully turn the PWM off when the input voltage exceeds 2.97V, and it also trips GPIO-3 (the hardware also allows the PWM to enter HiZ mode when a comparator event occurs). When running the VisSim graph, the LEDs on the C2000 LaunchPad will display at medium brightness if the voltages provided are within the normal range of the comparators, or if no voltage is applied to ADCIN2 or ADCIN4. Therefore, when the input voltage is below 0.33V, the LED will be off, and when the input voltage is above 2.97V, the LED will be at full brightness. Since we also need to demonstrate the use of the comparator input and output, the output of COMP2DAC is also connected to GPIO3. This can indicate the use when an event is triggered external to the F28027 Piccolo microcontroller, such as shutting down an external power stage. When we connect ADCINA4 to 3.3V, the brightness of the two rightmost LEDs will be at full brightness, while the LED on GPIO3, which is on the leftmost, will be off. This indicates that the comparator is triggering GPIO3 high. We can also use an oscilloscope on pin J1-5 and see the logic level change when we connect or disconnect 3.3V to pin J1-6.

If a variable voltage source is not available, you can connect a jumper between the GND pin and ADCIN2 (jumper from J5-2 to J1-8), in which case the PWM will trip due to low input voltage and the LED will turn off. If we remove the jumper, the brightness of the LED will return to medium brightness. We can then connect 3.3V to ADCIN2 (jumper from J1-1 to J1-6), in which case the PWM will trip because the high threshold of the comparator is reached, the brightness of the LED will reach maximum and the LED on GPIO-3 will turn off. Removing the jumper again will return the LED to medium brightness, and the LED on the leftmost GPIO-3 of the C2000 LaunchPad will light up.


Figure 2. VisSim diagram of two comparator trigger events affecting the PWM output of the VisSim microcontroller.

The following figure (Figure 3) is a diagram of VisSim actually running on the C2000 LaunchPad hardware. When initializing the comparator DACs for the threshold levels, we use a fixed point constant of 0.1 for Comparator-1 and 0.9 for Comparator-2. (0.1@Fx6,16 corresponds to 0.33V and 0.9@Fx6,16 corresponds to 2.97V.) The C2000 LaunchPad will support ADC inputs between GND and 3.3V.

Note that in this example we were able to set up the entire structure including the PWM unit, ADC input, comparator, and corresponding GPIO output events without writing any code.


Figure 3. VisSim diagram running on C2000 LaunchPad hardware

This example of testing the comparator functionality on a C2000 LaunchPad can be obtained in VisSim by going to Embedded->Examples->Piccolo->Launchpad and selecting either PWMComparatorTRIP2.

in conclusion

In this article, we have discussed the possibilities of increasing system functionality while reducing external component requirements through the analog comparator functions of the Piccolo microcontroller unit, which helps save cost and board space. We have also taken a detailed look at the setup and demonstration of these functions using the low-cost C2000 LaunchPad platform and the fully graphical VisSim programming solution.

Learn more

For more examples of applications, hardware and software, see TI's controlSUITE™ software. This downloadable GUI software features C2000-based development tools, application notes, design guides, hardware schematics and software examples, including digital power and motor control libraries compatible with the F2802x Piccolo family of microcontrollers. Download this software from www.ti.com/controlsuite.

To learn more about Visual Solutions, Inc.'s VisSim simulation, modeling and programming software and to download a free trial version, visit the company's website at www.vissim.com.

For more information on peak current mode control using the internal comparator and slope compensation DAC, refer to the following technical application note:
Step-by-Step Design Guide for Digital Peak Current Mode Control: A Single-Chip Solution - Dr. Ali Shirsavar
Digital Peak Current Mode Control with Slope Compensation Using the TMS320F2803x - Dr. Ali Shirsavar and Richard Poley

Reference address:Using microcontrollers to integrate analog comparators to provide power protection and reduce board space

Previous article:“TMS320xF24xx to C2000™ Piccolo™ TMS320F280xx
Next article:Design of low-cost flammable gas leak alarm based on sensor

Latest sensor Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号