Wednesday, June 15, 2022
HomeElectronicsEliminating stage shifters in microcontroller functions - Half 1

Eliminating stage shifters in microcontroller functions – Half 1


When designing a system, some of the vital design choices is selecting what voltage area(s) to make use of. Some voltage domains, resembling 5 V, are good for noisy and harsh working environments resembling these present in industrial functions, whereas different domains, resembling 3.3 V, are generally used for wi-fi communication. Nevertheless, every voltage area provides complexity to the design and requires a way to speak throughout domains. In Half 1 of this two-article sequence, a brand new level-shifting peripheral in microcontrollers referred to as multi-voltage I/O (MVIO) might be launched. MVIO reduces the design complexity and half rely required to speak throughout domains.

When designing a system, ideally just one voltage area is required, which retains the design course of easy. In lots of instances, a single area just isn’t attainable, as many sensors and modules are solely obtainable at particular logic ranges. Bluetooth and different wi-fi communication modules incessantly function within the 3.3-V area, whereas industrial functions have a tendency use 5-V logic for greater noise immunity in harsh working environments. The 1.8-V operation can also be frequent in microprocessors and different high-performance gadgets.

When speaking throughout voltage domains, it is extremely vital to translate from one area to the opposite. Most gadgets can not correctly deal with a better (than working) voltage utilized to their enter pins. This may occasionally trigger harm or sudden conduct from the system. For example, take into account an industrial 5-V sensor related to a 3.3-V microcontroller. The sensor will apply 5 V into the inputs of the microcontroller, which may doubtlessly harm the system or different related circuits. Determine 1 exhibits absolutely the most rankings of a tool from the AVR DB microcontroller household. On this state of affairs, the 5 V enter sign exceeds the ranking of the pins when powered from 3.3 V.

Determine 1 Instance of I/O pin limits has been created from Desk 39-1 within the AVR DB microcontroller datasheet. Supply: Microchip

One other attainable downside that might come up is that the sign enter won’t meet the required low or excessive enter voltage thresholds (Determine 2). This might lead to marginal working conduct. The design won’t work in any respect, or worse, it’d work besides in particular edge instances or working circumstances.

Determine 2 Instance of I/O pin thresholds has been created from Desk 39-7 within the AVR DB microcontroller datasheet. Supply: Microchip

The usual answer for this downside is so as to add an exterior stage shifter to the design. The extent shifter operates on each voltage domains and shifts from A to B, or vice-versa. However stage shifters deliver their very own prices and issues to the design. There are numerous totally different sizes and sorts of stage shifters, with various characteristic units.

A big and complicated design might have a number of variants of a stage shifter to satisfy the design necessities. For example, I2C have to be used with a bi-directional stage shifter, whereas serial buses, like SPI, will work higher with a sooner unidirectional stage shifter with devoted inputs and outputs on each domains. Moreover, every exterior stage shifter provides to the invoice of supplies (BOM) and PCB real-estate.

To get rid of the world and expense related to utilizing exterior stage shifters, Microchip has launched a brand new peripheral referred to as multi-voltage I/O or MVIO; it has been launched within the AVR DB microcontroller household. MVIO permits a port of the microcontroller to function in a separate voltage area than the remainder of the system. This particular port nonetheless retains the traditional digital configurability of microcontroller I/O. For the reason that MVIO options are clear to the {hardware}, digital peripherals will perform on the port as common (when powered). This permits for {hardware} based mostly I2C, SPI, UART, PWM and different peripherals to perform and enhance the microcontroller’s energy effectivity and efficiency (Determine 3).

Determine 3 An industrial software presents itself as a attainable use case of MVIO. Supply: Microchip

Key MVIO options

MVIO is true stage shifting. The MVIO port can function on higher- or lower- voltages than the remainder of the microcontroller. At present, MVIO has a really helpful working vary between 1.8 V and 5.5 V on the AVR DB household. Right here, MVIO requires a devoted energy provide to perform however doesn’t require energy provide sequencing. If both the first microcontroller energy provide or the MVIO energy provide is under the required minimums, then the MVIO pins are tri-stated.

The conduct of the pins when energy is restored relies on which provide misplaced energy. Within the case of the MVIO provide shedding energy, the I/O will return to its register settings when powered up. If the microcontroller provide loses energy, the pins will reset to the power-on-reset (PoR) defaults when the microcontroller restarts.

Throughout run time, the operation of the MVIO will be monitored by the microcontroller in 3 ways:

  • Polling the facility standing
  • Interrupting on energy state change
  • Measuring with the ADC

The MVIO standing register signifies whether or not the facility provide for the MVIO exceeds the minimal voltage requirement. This bit will be polled by the microcontroller, or an interrupt will be generated when it modifications state. Moreover, analog-to-digital converter (ADC) within the microcontroller can measure the MVIO energy provide via an inner 10x divider community.

Easy demonstration of MVIO

A visible method to present the MVIO is to modulate the availability voltages whereas observing a digital output. This creates mixed-signal waveforms that observe the power-supply of the MVIO whereas being gated by the digital I/O. The analog waveforms within the following demo have been created on the AVR DB microcontroller by way of the on-board digital-to-analog converter (DAC) and have been buffered by one of many inner op amps to energy the MVIO port.

The op amp can be utilized to energy the MVIO in different functions as nicely, nevertheless it comes with two vital caveats:

  • The utmost and minimal op amp output voltage is restricted by each the microcontroller energy provide and the quantity of output present.
  • The quiescent present of this setup is far greater than that of a devoted energy provide regulator.

On this demonstration, the worth within the DAC is up to date each 10 µs from a timer/counter B (TCB) interrupt service routine (ISR), as proven in Determine 4. The ISR both reads a price from a look-up desk or computes the DAC worth from a pre-programmed system. The precise conduct relies on the waveform being generated; the sine wave is synthesized from a set lookup desk, whereas different waveforms are computed by the microcontroller.

Determine 4 Block diagram of the MVIO demonstration that makes use of the AVR128DB48 microcontroller. Supply: Microchip

To point out the digital performance, a pulse width modulated (PWM) output was arrange on the MVIO port. A timer/counter D (TCD) creates a 250-kHz PWM sign with a 50% obligation cycle. However, because the TCD doesn’t have an output on the MVIO port, a cell of the configurable customized logic (CCL) is used to cross the sign via to an MVIO I/O pin.

The ensuing output waveform is proven in Determine 5 under. The DAC is producing a set 1-kHz sine wave for the MVIO provide, with a voltage offset so the MVIO provide doesn’t drop under the minimal working stage and shuts down.

Determine 5 Here’s what the ensuing output waveform of the demo seems to be like. Supply: https://github.com/microchip-pic-avr-examples/avr128db48-pam-generator-mplab

1.8 V interfacing with the MVIO

To display a extra sensible software of the MVIO, Microchip co-developed an indication with Melexis, one other provider of semiconductor options; the demo makes use of its MLX90392 3D magnetometer as a window safety sensor. Reed switches are a typical approach of detecting whether or not a window is open or closed, however the switches are weak to being tricked with an exterior magnet positioned close to them. In distinction, the MLX90392 magnetometer measures the magnetic discipline in three dimensions, making it far more immune to any such assault. The consumer may program a customized open/closed window threshold to permit the window to be barely opened with out disarming the system.

The MLX90392 magnetometer communicates with the microcontroller over I2C at 1.8 V. Usually, this might require an exterior stage shifter, however because the MVIO is obtainable on the microcontroller, no stage shifters are wanted. Moreover, an MLX90632 Far InfraRed (FIR) sensor was additionally carried out to carry out room temperature monitoring. This sensor is powered from 3.3 V however has a variant which might additionally talk on a 1.8 V I2C bus.

The second voltage area on this demo is 3.3 V. This area powers the microcontroller and the RN4870 Bluetooth module. Bluetooth communication was carried out to permit the demo to work together with smartphones with out utilizing specialised {hardware}. In a manufacturing software, different less complicated and lower-power wi-fi communication strategies, like Sub-GHz radio, might make a more sensible choice for every monitoring node.

This software might be mentioned in additional element in Half 2 of this two-article sequence. The supply code and documentation for this software are linked under.

Utility supply code and documentation: https://github.com/microchip-pic-avr-examples/avr128db28-smart-security-sensor-mplab

Robert Perkel is software engineer for 8-bit MCU enterprise unit at Microchip Expertise.

Associated Content material



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments