Mixed signals, on a power budget: Intelligent low-power analog in MCUs

Mixed signals, on a power budget: Intelligent low-power analog in MCUs



It goes without saying that battery-powered devices are sensitive to power draw, especially during periods of inactivity. One such use case is in sensor nodes or portable sensors—these devices passively monitor a specific condition. When the threshold is exceeded, they trigger an alarm or log the event for further analysis. Since most devices incorporate some form of microcontroller (MCU), selecting an MCU with intelligent analog peripherals can reduce the Bill of Materials (BOM) by performing the same functions of a discrete device while potentially saving power by disabling the analog functionality when not needed.

To demonstrate these features, we built two demos on the PIC16F17576 microcontroller family. One demo aims to use as little power as possible while detecting temperature changes, while the other utilizes the embedded op-amps to dynamically adjust the gain based on the input signal.

Power consumption

Let’s start at the top—power consumption. No matter how you slice it, all roads will lead to the same basic tenets:

  • Keep VDD as low as possible
  • Minimize oscillator frequency
  • Turn off all unused peripherals and external circuits, when possible, and as much as possible
  • Avoid floating nodes on digital I/O

Beyond this advice, it becomes a lot more application-specific. For instance, most op-amps and ADCs don’t have an OFF switch. This is where intelligent analog peripherals fit into designs.

The “intelligent” part of their name is derived from the fact that they can be controlled in software. While most analog peripherals would not be considered power hungry, when optimizing battery life, every little bit of current matters, and generally, there is a higher quiescent current draw that the discrete device would have due to process limitations.

However, there are special low-power peripherals that allow for ultra-low power operation, even when enabled all the time. For instance, the Low Power Voltage Reference (VREFLP) and Low Power Analog Comparator (CMPLP) in the PIC16F17576 family of MCUs draw minimal power but can trigger interrupts to wake the CPU if action is needed.

For devices without these lower power peripherals, another peripheral available in PIC MCUs is the Analog Peripheral Manager (APM). The APM is a specialized counter that can toggle power ON/OFF to the analog peripherals while allowing the CPU to remain continuously in sleep.

If an event occurs, requiring intervention from the CPU, the peripherals can generate an interrupt to wake the device. This avoids having to perform the following sequence: wake the CPU, power on the peripherals, check the results, perform an action, shut down the peripherals, and return to deep sleep.

Low-power demo

The objective of the low-power demo is to demonstrate the new CMPLP and VREFLP as a temperature alarm. This application could be used for cold asset tracking to log when an event over the expected temperature occurs. For the demo implementation, we designed a circuit to detect when a person touches the thermistor(s), causing a rise in temperature.

Figure 1 A finished low power demo prototype that will detects the temperature rise that occurs when a person touches the thermistor(s).

Theory of operation

This circuit is composed of two PIC16F17576 MCUs; one device acts like the device under test (DUT) while the other handles power measurement and display.

Power measurement and display

To measure the minuscule amount of current pulled by the MCU DUT, it was important to design a circuit that could perform high-side current sensing while also being capable of maintaining the power supply at 1.8 V, which is the lowest recommended operating voltage for this device family. For reference, the minimum operating voltage is 1.62 V, which provides a 10% margin on the power supply before the device is out of specified operating conditions.

To measure the quiescent current of the MCU and low-power analog peripherals, a precision 1:1 current mirror IC was used to supply current to the DUT (Figure 2). This IC has a settable compliance output limit, but the tolerancing and ranging on the internal reference was not acceptable for our purposes, so we overdrive the integrated circuit with an external 1.8-V reference (MCP1501-18E) to avoid having to calibrate each unit individually.

Figure 2 The high-side current circuit to measure the minuscule amount of current pulled by the MCU DUT, and 1.8-V DUT power supply.

This ensures the power rail for the DUT is as close as possible to 1.8 V. Guard rings and planes are placed on the PCB to minimize the leakage current of this rail as much as possible. The 1:1 current output goes through a sense resistor, and then a differential measurement of the voltage at the resistor is performed with a 24-bit delta-sigma ADC (MCP3564R) with an external 2.048-V voltage reference (MCP1501-20E). This is shown in Figure 3. The resulting measurement is then displayed on the OLED screen attached to the board.

Figure 3 The ADC implementation where the differential measurement of the voltage at the resistor is performed with a 24-bit delta-sigma ADC with an external 2.048-V voltage reference.

A (good) problem we discovered late in the process was that the current measurement in this configuration is so stable, it looks hard-coded on the display. Thankfully, this can be easily disproved by gently touching the DUT’s decoupling capacitors with a finger or other slightly conductive object and observing the change in measured current.

DUT

The DUT device performs a simple but crucial role in detecting temperature changes with as little power consumption as possible. For this, CMPLP and VREFLP are used together with the Peripheral Pin Select (PPS) system to output the state of the CMPLP without waking the CPU.

In an actual application, CMPLP’s output edge (LOW ↔ HIGH) would be used to wake the CPU to perform some action like logging a temperature event or sounding an alarm.

Using the high-side current measurement circuit designed, we found the current of the microcontroller in this state is ~2.2 to 2.4 μA, but there is room for a tiny bit of extra power savings.

VREFLP is comprised of two separate subsystems: a low-power 1-V reference and a low-power DAC. This application uses the slightly more power-hungry low-power DAC instead of the fixed 1-V reference because the temperature change from physical contact is very small, and the system must recalibrate the threshold on startup to account for environmental variance. In an application where a few degrees of tolerance are acceptable, using the 1-V reference would save a few fractions of a microamp.

Notably, this demo does not use the APM because the APM requires an oscillator to remain active, consuming a little bit more power (~2.8 μA) than simply leaving these ultra-low power modules on. In a situation where multiple analog peripherals are being used, such as the integrated op-amps, ADC, etc., the APM would provide significant savings in power.

Dynamic gain

Another feature of intelligent analog peripherals is the ability to adjust on the fly. In some cases, a signal may have a large dynamic range that is tricky to measure without clipping.

Clipping a signal is usually considered undesirable, as waveform information about the signal is lost. A simple example of this is a microphone: whispering requires a high gain while shouting requires a low gain. With a fixed gain, designers pick the worst (reasonable) conditions to avoid signal clipping, but this, in turn, reduces the signal resolution.

A way around this problem is to use embedded op-amps. These op-amps aren’t going to outmatch the high-end op-amps, but they are often comparable to general-purpose ones.

And, in many cases, the integrated op-amps contain built-in resistor networks that allow the op-amp(s) to adjust the circuit gain as needed. This requires no extra components or specialized circuitry as it’s already integrated into the die.

Dynamic gain demo

One of the main use cases for the integrated op-amps inside MCUs is to dynamically switch gains depending on how strong the signal is. This is often performed to avoid clipping the signal when the signal strength is high.

This application creates a simple demonstration of this use case by amplifying the output of a pressure sensor and displaying it visually on an LED bar graph.

Figure 4 A dynamic gain demo that amplifies the output of a pressure sensor and displays it visually on an LED bar graph.

Theory of operation

Pressure sensor

The pressure sensor in this application changes resistance depending on the amount of pressure applied. This resistor is used as part of a resistor divider network to generate an output signal from 0 to 2 V. Since both the discrete op-amp and the integrated op-amp have high-input impedances, the two circuits can share the same signal without loading down the network.

Dynamic gain circuit

The PIC16F17576 MCU has four op-amps, with two of them containing integrated resistor ladders. These ladders have eight steps, plus an additional option for unity gain (1x), for a total of nine options. Alternatively, resistors or other components can be connected to the I/O pins to assign an arbitrary gain or function, if desired.

In this demo, the MCU’s op-amp is switched between a gain of 2x (LOW) and 4x (HIGH) at runtime depending on the measured signal.

In most applications, when the signal strength is low, the gain would be HIGH. However, it is worth noting that in this demo, the inverse is true. This is purely for visual reasons; otherwise, the clipping condition would have more lights ON and thus appear “better” than the dynamic gain version at a glance. As the gain of the embedded op-amps is set up in software, it was easily reconfigured to match the desired behavior.

Measurement and display

The PIC16F17576 MCU also performs the measurement of both op-amp outputs to display on the LED bar graph. The internal Fixed Voltage Reference (FVR) is used to generate a stable 4.096 V from the +5-V (USB) supply for conversions. MCP23017 I2C I/O expanders are used to drive the LEDs of the display. 

Putting it all together

Adjusting the circuit gain without any external circuitry greatly simplifies designs where there are large signal ranges. These peripherals, of course, will not replace high-performance op-amps, ADCs, DACs, or voltage references, but embedded analog peripherals are a good way to handle signals that require some conditioning but aren’t particularly sensitive. This, coupled with low power functionality, makes them a useful tool to reduce circuit complexity, time to market, and ultimately the BOM in your design.

Robert Perkel is an application engineer for Microchip Technology. In this role, he develops technical content such as App Notes, contributed articles, and videos. He is also responsible for analyzing use cases of peripherals and the development of code examples and demonstrations. Perkel is a graduate of Virginia Tech, where he earned a Bachelor of Science degree in Computer Engineering.

Related Content

  • Developing a spectrophotometer with integrated analog peripherals
  • Deploying task-specific microcontrollers simplifies complex designs
  • Developing window security nodes with level shifting I/O – Part 2
  • Fundamentals of I3C interface communication
  • Slideshow: The most-popular MCUs ever

The post Mixed signals, on a power budget: Intelligent low-power analog in MCUs appeared first on EDN.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *