background image

 TB3287

 Getting Started with Multi-Voltage I/O (MVIO)

Introduction

Authors: Johan Vaarlid, Microchip Technology Inc.

The AVR

®

 DB Family of microcontrollers is equipped with a configurable integrated level shifter. The Multi-Voltage I/O

(MVIO) feature allows a subset of the I/O pins to be powered by a different I/O voltage domain VDDIO2. The rest of
the I/O pins runs on VDD. Both VDD and VDDIO2 have the same voltage range. Consult the 

Electrical

Characteristics

 section of the data sheet for the exact voltage range. This eliminates the need of having external level

shifters for communication or control of external components running on a different voltage level. Eliminating external
logic level shifters will, in turn, reduce the BOM and free up PCB real estate.

Figure 1. Multi-Voltage I/O can Completely Replace External Logic Level Converters

VDD

1.8-5.5V

VDD

VDD

VDDIO2

GND

GND

GND

GND

GND

VDDIO2

1.8-5.5V

Microcontroller

Logic 
Level

Converter

Sensor

MVIO

Sensor

Sensor

Sensor

This technical brief describes how the Multi-Voltage I/O feature works on the AVR DB Family of microcontrollers. It
covers the following use cases:

Polling VDDIO2 Status:

Checking if the VDDIO2 voltage is within the acceptable range by reading the Status bit.

Interrupt on VDDIO2 Status:

Make use of the interrupt that occurs when the Status bit changes state.

Measuring VDDIO2:

©

 2020 Microchip Technology Inc.

 Technical Brief

DS90003287A-page 1

Содержание TB3287

Страница 1: ...nal components running on a different voltage level Eliminating external logic level shifters will in turn reduce the BOM and free up PCB real estate Figure 1 Multi Voltage I O can Completely Replace External Logic Level Converters VDD 1 8 5 5V VDD VDD VDDIO2 GND GND GND GND GND VDDIO2 1 8 5 5V Microcontroller Logic Level Converter Sensor MVIO Sensor Sensor Sensor This technical brief describes ho...

Страница 2: ...th VDD at 1 8V A basic example of MVIO blinking an LED with a forward voltage higher than VDD Note The code examples were developed on AVR128DB48 Curiosity Nano EV35L43A and are available on GitHub TB3287 2020 Microchip Technology Inc Technical Brief DS90003287A page 2 ...

Страница 3: ...2 Status 10 6 Measuring VDDIO2 11 7 Blinking a 3V LED with VDD at 1 8V 15 8 References 17 9 Revision History 18 10 Appendix 19 The Microchip Website 22 Product Change Notification Service 22 Customer Support 22 Microchip Devices Code Protection Feature 22 Legal Notice 23 Trademarks 23 Quality Management System 24 Worldwide Sales and Service 25 TB3287 2020 Microchip Technology Inc Technical Brief D...

Страница 4: ...vide the same or more features Horizontal migration to the left reduces the pin count and therefore the available features Devices with different Flash memory sizes typically also have different SRAM and EEPROM Figure 1 1 AVR DB Family Overview Pins Flash AVR64DB28 AVR128DB28 AVR32DB28 AVR128DB32 AVR128DB48 AVR128DB64 AVR64DB32 AVR64DB48 AVR64DB64 AVR32DB32 AVR32DB48 28 48 64 32 32 KB 64 KB 128 KB...

Страница 5: ...ND GND AVDD PD4 Power Power Supply Ground Pin on AVDD Power Domain Functionality Programming Debug Clock Crystal Analog Function Digital Function Only Pin on VDD Power Domain Pin on VDDIO2 Power Domain These pins are capable of the same digital behavior as regular I O pins for example GPIO serial communication USART SPI I2C or connected to PWM peripherals The input Schmitt Trigger levels are scale...

Страница 6: ...DIO2 VDD PORTx 7 0 PORTy 7 0 VDDIO2 PORT VDDIO2S VDDIO2F Enable Int Req ADC Input Edge Detector Voltage Divider Voltage Monitor Voltage Monitor VDDCORE VDDCORE TB3287 Overview 2020 Microchip Technology Inc Technical Brief DS90003287A page 6 ...

Страница 7: ...onnect VDDIO2 to 3 3V of a second power voltage source 3 Connect VDDIO2 to GND of a second voltage source Refer to the AVR123DB48 Curiosity Nano User Guide for a guide on how to reverse this process Any voltage between 1 8V and 5 5V may be applied to VDDIO2 but for the following examples we will run at 3 3V Figure 3 1 AVR128DB48 Curiosity Nano MVIO 1 2 3 Figure 3 2 Snippet From the AVR128DB48 Curi...

Страница 8: ...stem Configuration 1 Name SYSCFG1 Offset 0x06 Default 0x08 Property The default value given in this fuse description is the factory programmed value and should not be mistaken for the Reset value Bit 7 6 5 4 3 2 1 0 SUT 2 0 Access R R R R R Default 0 1 0 0 0 Bits 4 3 MVSYSCFG 1 0 This bit field controls the power supply mode Value Name Description 0x00 Reserved 0x02 SINGLE Device used in a single ...

Страница 9: ...0 Bit 0 VDDIO2S VDDIO2 Status This bit shows the state of the VDDIO2 voltage level Writing to this bit has no effect Value Description 0 The VDDIO2 supply voltage is below the acceptable range for operation The MVIO pins are tri stated VDDIO2S The VDDIO2 supply voltage is within the acceptable range for operation The MVIO pin configurations are loaded from the corresponding PORT registers 1 Pollin...

Страница 10: ...he MVIO vector will be called when the interrupt is triggered Before returning from the Interrupt Service Routine ISR the VDDIO2 VDDIO2IF interrupt flag in the MVIO Interrupt Flags MVIO INTFLAGS register must be cleared This is done by writing a 1 to the flag Figure 5 2 MVIO INTFLAGS Clear VDDIO2 Interrupt Flag Bit 7 6 5 4 3 2 1 0 Access R W Reset 0 Bit 0 VDDIO2IF VDDIO2 Interrupt Flag This flag i...

Страница 11: ...elect This bit field controls the reference voltage level for ADC0 Note 1 The values given for internal references are only typical Refer to the Electrical Characteristics section for further details Value Name Description 0x1 2V048 Internal 2 048V reference 1 0x2 4V096 Internal 4 096V reference 1 0x3 2V500 Internal 2 500V reference 1 0x4 Reserved 0x5 VDD VDD as reference 0x6 VREFA External refere...

Страница 12: ...ilt in support for oversampling This is especially useful when measuring a DC voltage as it mitigates a lot of the periodic noise Figure 6 3 ADC0 CTRLB Enabling Oversampling with 16 Samples Bit 7 6 5 4 3 2 1 0 Access R W R W R W Reset 0 0 0 Bits 2 0 SAMPNUM 2 0 Sample Accumulation Number Select This bit field selects how many consecutive ADC sampling results are accumulated automatically When this...

Страница 13: ...ered when a result is ready in the Result ADC0 RES register Figure 6 6 ADC0 INTFLAGS Check RESRDY Interrupt Flag Bit 7 6 5 4 3 2 1 0 WCMP Access R W R W Reset 0 0 Bit 1 WCMP Window Comparator Interrupt Flag This window comparator flag is set when the measurement is complete and if the result matches the selected Window Comparator mode defined by the WINCM bit field in the Control E ADCn CTRLE regi...

Страница 14: ... This bit field constitutes the high byte of the ADCn RES register where the MSb is RES 15 Bits 7 0 RES 7 0 Result Low Byte This bit field constitutes the low byte of the ADCn RES register RES 15 8 RES 7 0 Read the RES register and shift the result 4 bits to compensate for the 16 oversamples uint16_t result ADC0 RES 4 TB3287 Measuring VDDIO2 2020 Microchip Technology Inc Technical Brief DS90003287...

Страница 15: ...figure below If a different LED is used the resistor value needs to change This is calculated using the following formula where VLED is the voltage drop of the LED and ALED is current through the LED 2 WARNING The AVR DB can not be programmed below 2V so to ensure proper operation set VDD to 3 3V by dragging and dropping the provided text file VDD3V3 txt onto the CURIOSITY drive on your PC When pr...

Страница 16: ...N0_bm Toggle LED pin void LED_PC0_toggle void PORTC OUTTGL PIN0_bm int main void LED_PC0_init while 1 Check if VDDIO2 is within acceptable range if MVIO STATUS MVIO_VDDIO2S_bm Blink LED at PC0 forever while 1 LED_PC0_toggle _delay_ms 250 The code for this example is available in the blinking a 3v0 led with vdd at 1v8 folder in these github repositories TB3287 Blinking a 3V LED with VDD at 1 8V 202...

Страница 17: ...8 product page www microchip com DevelopmentTools ProductDetails PartNO EV35L43A 4 AVR128DB48 Curiosity Nano User Guide www microchip com DS50003037 5 Curiosity Nano AVR128DB48 Schematics ww1 microchip com downloads en DeviceDoc AVR128DB48_Curiosity_Nano_Schematics pdf TB3287 References 2020 Microchip Technology Inc Technical Brief DS90003287A page 17 ...

Страница 18: ...9 Revision History Doc Rev Date Comments A 09 2020 Initial document release TB3287 Revision History 2020 Microchip Technology Inc Technical Brief DS90003287A page 18 ...

Страница 19: ...void PORTF DIRSET PIN5_bm void LED0_toggle void PORTF OUTTGL PIN5_bm int main void Enable the VDDIO2 interrupt MVIO INTCTRL MVIO_VDDIO2IE_bm Enable Global interrupts sei LED0_init Replace with your application code while 1 ISR MVIO_MVIO_vect The VDDIO2 interrupt has been triggered LED0_toggle Clear the CFD interrupt flag MVIO INTFLAGS MVIO_VDDIO2IF_bm Example 10 3 Measuring VDDIO2 define F_CPU 400...

Страница 20: ...e 16 oversamples uint16_t result ADC0 RES 4 return result int main void adc0_init Replace with your application code while 1 Read the VDDIO2 voltage continiously read_VDDIO2 Example 10 4 Blink a 3V LED with VDD at 1 8V define F_CPU 4000000ul include avr io h include util delay h void LED_PC0_init void PORTC DIRSET PIN0_bm void LED_PC0_toggle void PORTC OUTTGL PIN0_bm int main void LED_PC0_init whi...

Страница 21: ... TB3287 Appendix 2020 Microchip Technology Inc Technical Brief DS90003287A page 21 ...

Страница 22: ...stomers A listing of sales offices and locations is included in this document Technical support is available through the website at www microchip com support Microchip Devices Code Protection Feature Note the following details of the code protection feature on Microchip devices Microchip products meet the specifications contained in their particular Microchip Data Sheet Microchip believes that its...

Страница 23: ...T logo MPLAB OptoLyzer PackeTime PIC picoPower PICSTART PIC32 logo PolarFire Prochip Designer QTouch SAM BA SenGenuity SpyNIC SST SST Logo SuperFlash Symmetricom SyncServer Tachyon TempTrackr TimeSource tinyAVR UNI O Vectron and XMEGA are registered trademarks of Microchip Technology Incorporated in the U S A and other countries APT ClockWorks The Embedded Control Solutions Company EtherSynch Flas...

Страница 24: ...Quality Management System For information regarding Microchip s Quality Management Systems please visit www microchip com quality TB3287 2020 Microchip Technology Inc Technical Brief DS90003287A page 24 ...

Страница 25: ...China Xiamen Tel 86 592 2388138 China Zhuhai Tel 86 756 3210040 India Bangalore Tel 91 80 3090 4444 India New Delhi Tel 91 11 4160 8631 India Pune Tel 91 20 4121 0141 Japan Osaka Tel 81 6 6152 7160 Japan Tokyo Tel 81 3 6880 3770 Korea Daegu Tel 82 53 744 4301 Korea Seoul Tel 82 2 554 7200 Malaysia Kuala Lumpur Tel 60 3 7651 7906 Malaysia Penang Tel 60 4 227 8870 Philippines Manila Tel 63 2 634 906...

Отзывы: