More and more designers are now turning to Electronic microcontrollers to control power stages in motor control and digital power systems. Using the integrated analog comparator function of a microcontroller, such as Texas Instruments’ (TI) C2000™ Piccolo™ microcontroller, protects system power 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 remain confined to the analog domain when preventing over- or under-voltages from occurring in the event of an execution error in the microcontroller itself. By using the integrated analog capabilities of TI’s C2000 Piccolo microcontroller family, systems can be designed around a single controller without the need for external support circuits. This mainly 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, which provides all the performance and peripherals required to control a system from 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 that enhance high-speed signal processing. Piccolo’s main CPU core has built-in digital signal processing (DSP) functions such as a single-cycle 32 x 32-bit multiply and accumulate unit, which greatly improves computing speed. In addition, control peripherals such as analog-to-digital converters (ADCs) and pulse-width modulators (PWMs) are designed to be flexible enough to be easily adapted to almost any use with minimal software overhead. For example, ADCs have automatic sequencers that allow developers to program to cycle through a specific order of samples so that values are ready when the application requires them. Using smarter control peripherals and powerful CPU cores, the control loop runs tighter, improving the dynamics of the control algorithm and reducing disturbing behavior.
Important Piccolo MCU features include:
• 40 to 90 MIPS processing performance
• Single 3.3-V supply supports full-featured operation
• Dual internal high precision oscillators; no external crystal required
• 12-bit ADC with 16 channels with a maximum sampling frequency 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 to 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 work similarly to traditional 30nS analog comparators.These two comparators are connected to the internal clock of the F2802/3x/6x microcontroller
Asynchronous – The comparator block works as long as the device itself has power. These two comparators have two inputs (similar to standard analog comparators, but they are connected to the device pins through an analog input/output (AIO) mux) and have the additional capability of using the internal on-device A digital-to-analog converter (DAC) provides an internal reference for the voltage. This internal DAC functionality is important in digital power stage applications such as peak current mode control, as the DAC acts as a ramp generator for the peak current mode trip point. The output of the comparator block can also be used internally by the device by connecting to the PWM trip area, or referenced externally through the GPIO mux. The focus of this white paper is on the F2802x device family, but the internal comparator functionality is also convertible for the F2803x and F2806x Piccolo families.
Use a 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. Instead of having the comparator trigger an internal PWM event (such as when used for “peak current mode control”), we can have the comparator output an active high or low signal external to the device via the GPIO mux. The analog input trip point is characterized as an internal or external reference with a maximum input of 3.3 volts.
Figure 1. Comparator output implemented with changes in the GPIO mux.
Let’s look at one of these use cases: For systems using analog controllers in the power stage, the number of board-level components can be reduced when the F2802x Piccolo microcontrollers are used as “maintenance management” microcontrollers. This is roughly the same as used in digital control systems, where the analog comparator function can be used to enable or disable the power stage when used with power devices with enable or disable pins. 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 through external components, saving board space and cost.
Demonstrates analog comparators on F2802x Piccolo microprocessors
Now that we have seen the structure and setup of the analog comparators inside the Piccolo F2802x microcontroller family, we will now focus on how to use these comparators in the development environment of the TI C2000 LaunchPad evaluation kit. The C2000 LaunchPad is a low-cost evaluation kit featuring 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 to protect the development PC without the need for expensive external emulator hardware. For the software setup in this example, we will demonstrate the model-based VisSim embedded graphical software tool provided by Visual Solutions, Inc. A two-month free trial version of VisSim can be downloaded directly from the company’s website at www.vissim.com.
Test Case – Externally Referenced Comparator Event Triggering PWM Event
In this test case using the C2000 LaunchPad (Figure 2), we have a very simple VisSim diagram that generates 25Khz PWM signals to drive GPIO0 and GPIO1; it also has externally referenced comparator signals that can be Triggers a corresponding pair of high PWM and low PWM events and trips the GPIO. The example below is a screenshot of a VisSim diagram with blue and green for the comparator output levels and yellow for the voltage applied to the input A comparator pin. In the VisSim diagram, the input voltage has been normalized to represent VDDA as 1. On the C2000 LaunchPad, VDDA is set to 3.3. As shown, we cycle the input signal between 0 and 3.3 V.
In the VisSim diagram, 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). In the same subgraph as the input voltage, the DAC value is graphed in red, so that it becomes apparent when the comparator trips. Additionally, we have configured Comparator-1 to fully turn on the PWM when the input voltage falls below the DAC value of 0.33V. We have also configured Comparator-2 to completely shut down the PWM when the input voltage exceeds 2.97V, in addition, it can also trip GPIO-3 (hardware also allows the PWM to enter HiZ mode when a Comparator event occurs) . When running the VisSim graph, if the supplied voltage is within the normal range of the comparator, or if no voltage is applied to ADCIN2 or ADCIN4, the LEDs on the C2000 LaunchPad will Display medium brightness. Therefore, when the input voltage is lower than 0.33V, the LED will be off, and when the input voltage is higher than 2.97V, the brightness of the LED will reach the maximum. Since we also need to demonstrate the use of the comparator input and output, the output of the COMP2DAC is also connected to GPIO3. It can indicate usage when events external to the F28027 Piccolo microcontroller are triggered, such as when an external power stage is turned off. When we connect ADCINA4 to 3.3V, the two LEDs on the far right will be at their maximum brightness, and at the same time, the LED on GPIO3 on the far left will be off. This means that the comparator triggers GPIO3 high. We can also use an oscilloscope on pins J1-5 and when we connect or disconnect 3.3V to or from pins J1-6 we will see the logic level change.
If a variable voltage source is not available, you can connect a jumper between the GND pin and ADCIN2 (J5-2 to J1-8 jumper), in this case the PWM will fail due to low input voltage will trip and the LED will turn off. If we open that jumper, the LED brightness will return to medium brightness. Then, we can connect 3.3V to ADCIN2 (jumper from J1-1 to J1-6), at this point, because the high threshold of the comparator is reached, the PWM will trip, the LED will be at maximum brightness and GPIO-3 The LED on will turn off. Removing the jumper will return the LED to medium brightness and the LED on GPIO-3 on the far left of the C2000 LaunchPad will turn on.
Figure 2. VisSim diagram of two comparator trigger events affecting the PWM output of a VisSim microcontroller.
The following diagram (Figure 3) is a VisSim diagram actually running on the C2000 LaunchPad hardware. When initializing the Comparator DAC for the threshold level, we use a fixed point constant of 0.1 for Comparator-1 and 0.9 for Comparator-2. ([email protected], 16 corresponds to 0.33V, [email protected], 16 corresponds to 2.97V.) The C2000 LaunchPad will support ADC input between GND and 3.3V.
Note that in this example we can set up the entire structure including the PWM unit, ADC inputs, comparators 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 the C2000 LaunchPad can be obtained in VisSim by going to Embedded->Examples->Picolo->Launchpad and selecting any PWMComparatorTRIP2.
In this article, we discuss the possibility of reducing the need for external components while increasing system functionality through the analog comparator function of the Piccolo microcontroller unit, which can help save cost and board space. We also took a detailed look at and demonstrated the setup of these features with the low-cost C2000 LaunchPad platform and fully graphical VisSim programming solution.
to know more information
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. Please 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 Web site at www.vissim.com.
For more information on peak current mode control using the internal comparator and slope compensation DAC, see the following technical application notes:
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 TMS320F2803x – Dr. Ali Shirsavar and Richard Poley
The Links: LFH8P4032B LTM11C011