How To Prevent Power Supply Corruption On An 8Bit Microcontroller From Overheating



Similar documents
8-bit Microcontroller. Application Note. AVR400: Low Cost A/D Converter

8-bit RISC Microcontroller. Application Note. AVR182: Zero Cross Detector

How to Calculate the Capacitor of the Reset Input of a C51 Microcontroller 80C51. Application Note. Microcontrollers. Introduction

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

8-bit Microcontroller. Application Note. AVR105: Power Efficient High Endurance Parameter Storage in Flash Memory

8-bit Microcontroller. Application Note. AVR222: 8-point Moving Average Filter

AVR106: C functions for reading and writing to Flash memory. 8-bit Microcontrollers. Application Note. Features. Introduction

General Porting Considerations. Memory EEPROM XRAM

AVR134: Real Time Clock (RTC) using the Asynchronous Timer. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

AT89C5131A Starter Kit... Software User Guide

Tag Tuning/RFID. Application Note. Tag Tuning. Introduction. Antenna Equivalent Circuit

8-bit RISC Microcontroller. Application Note. AVR236: CRC Check of Program Memory

Quick Start Guide. CAN Microcontrollers. ATADAPCAN01 - STK501 CAN Extension. Requirements

AVR319: Using the USI module for SPI communication. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR305: Half Duplex Compact Software UART. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. C51 Bootloaders. C51 General Information about Bootloader and In System Programming. Overview. Abreviations

ATF15xx Product Family Conversion. Application Note. ATF15xx Product Family Conversion. Introduction

8-bit Microcontroller. Application Note. AVR314: DTMF Generator

AT91 ARM Thumb Microcontrollers. Application Note. Interfacing a PC Card to an AT91RM9200-DK. Introduction. Hardware Interface

AVR245: Code Lock with 4x4 Keypad and I2C LCD. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

8-bit Microcontroller. Application Note. AVR201: Using the AVR Hardware Multiplier

8-bit Microcontroller. Application Note. AVR461: Quick Start Guide for the Embedded Internet Toolkit. Introduction. System Requirements

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

8-bit Microcontroller. Application. Note. AVR204: BCD Arithmetics. Features. Introduction. 16-bit Binary to 5-digit BCD Conversion bin2bcd16

AVR120: Characterization and Calibration of the ADC on an AVR. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR. 8-bit Microcontrollers. Application Note. Features.

AVR241: Direct driving of LCD display using general IO. 8-bit Microcontrollers. Application Note. Features. Introduction AVR

3-output Laser Driver for HD-DVD/ Blu-ray/DVD/ CD-ROM ATR0885. Preliminary. Summary

AVR034: Mixing C and Assembly Code with IAR Embedded Workbench for AVR. 8-bit Microcontroller. Application Note. Features.

AVR442: PC Fan Control using ATtiny13. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

DIP Top View VCC A16 A15 A12 A7 A6 A5 A4 A3 A2 A1 A0 I/O0 I/O1 I/O2 GND A17 A14 A13 A8 A9 A11 A10 I/O7 I/O6 I/O5 I/O4 I/O3. PLCC Top View VCC A17

Table of Contents. Section 1 Introduction Section 2 Getting Started Section 3 Hardware Description

USB Test Environment ATUSBTEST- SS7400. Summary

AVR040: EMC Design Considerations. 8-bit Microcontrollers. Application Note PRELIMINARY. Scope. 1 Introduction

Application Note. USB Mass Storage Device Implementation. USB Microcontrollers. References. Abbreviations. Supported Controllers

AT91 ARM Thumb Microcontrollers. AT91SAM CAN Bootloader. AT91SAM CAN Bootloader User Notes. 1. Description. 2. Key Features

Supply voltage Supervisor TL77xx Series. Author: Eilhard Haseloff

256K (32K x 8) OTP EPROM AT27C256R 256K EPROM. Features. Description. Pin Configurations

2-Wire Serial EEPROM AT24C32 AT24C64. 2-Wire, 32K Serial E 2 PROM. Features. Description. Pin Configurations. 32K (4096 x 8) 64K (8192 x 8)

8-bit RISC Microcontroller. Application Note. AVR910: In-System Programming

Two-wire Automotive Serial EEPROM AT24C01A AT24C02 AT24C04 AT24C08 (1) AT24C16 (2)

USB 2.0 Full-Speed Host/Function Processor AT43USB370. Summary. Features. Overview

AVR32110: Using the AVR32 Timer/Counter. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. 8-bit Microcontrollers. AVR091: Replacing AT90S2313 by ATtiny2313. Features. Introduction

Allows the user to protect against inadvertent write operations. Device select and address bytes are Acknowledged Data Bytes are not Acknowledged

tinyavr Microcontrollers White Paper is the registered trademark of Atmel Corporation, 2325 Orchard Parkway, San Jose, CA Rev.

AAT3520/2/4 MicroPower Microprocessor Reset Circuit

8-bit RISC Microcontroller. Application Note. AVR155: Accessing an I 2 C LCD Display using the AVR 2-wire Serial Interface

AVR32100: Using the AVR32 USART. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

2-wire Serial EEPROM AT24C1024. Advance Information

AVR1321: Using the Atmel AVR XMEGA 32-bit Real Time Counter and Battery Backup System. 8-bit Microcontrollers. Application Note.

8-bit. Application Note. Microcontrollers. AVR282: USB Firmware Upgrade for AT90USB

Programmable Single-/Dual-/Triple- Tone Gong SAE 800

The Programming Interface

Step Motor Controller. Application Note. AVR360: Step Motor Controller. Theory of Operation. Features. Introduction

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

AVR444: Sensorless control of 3-phase brushless DC motors. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Tire pressure monitoring

AT86RF230 (2450 MHz band) Radio Transceiver... User Guide

Two-wire Serial EEPROM AT24C1024 (1)

DS1220Y 16k Nonvolatile SRAM

HANDLING SUSPEND MODE ON A USB MOUSE

Microprocessor Supervisory Circuits

TDA4605 CONTROL CIRCUIT FOR SWITCH MODE POWER SUPPLIES USING MOS TRANSISTORS

TLI4946. Datasheet TLI4946K, TLI4946-2K, TLI4946-2L. Sense and Control. May 2009

Application Note. 8-bit Microcontrollers. AVR280: USB Host CDC Demonstration. 1. Introduction

LM1084 5A Low Dropout Positive Regulators

DS1307ZN. 64 x 8 Serial Real-Time Clock

Atmel s Self-Programming Flash Microcontrollers

2-wire Serial EEPROM AT24C512

AVR353: Voltage Reference Calibration and Voltage ADC Usage. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note. Migrating from RS-232 to USB Bridge Specification USB Microcontrollers. Doc Control. References. Abbreviations

AVR32701: AVR32AP7 USB Performance. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

ICS514 LOCO PLL CLOCK GENERATOR. Description. Features. Block Diagram DATASHEET

AVR1900: Getting started with ATxmega128A1 on STK bit Microcontrollers. Application Note. 1 Introduction

AVR033: Getting Started with the CodeVisionAVR C Compiler. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

POWER-VOLTAGE MONITORING IC WITH WATCHDOG TIMER

AVR32138: How to optimize the ADC usage on AT32UC3A0/1, AT32UC3A3 and AT32UC3B0/1 series. 32-bit Microcontrollers. Application Note.

AVR068: STK500 Communication Protocol. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note 58 Crystal Considerations for Dallas Real-Time Clocks

DS1220Y 16k Nonvolatile SRAM

ATF1500AS Device Family. Application Note. In-System Programming of Atmel ATF1500AS Devices on the HP3070. Introduction.

CMOS, the Ideal Logic Family

3-output Laser Driver for HD-DVD/ Blu-ray/DVD/ CD-ROM ATR0885. Preliminary. Summary. Features. Applications. 1. Description

AVR1301: Using the XMEGA DAC. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

TRIPLE PLL FIELD PROG. SPREAD SPECTRUM CLOCK SYNTHESIZER. Features

AVR318: Dallas 1-Wire master. 8-bit Microcontrollers. Application Note. Features. Introduction

AVR055: Using a 32kHz XTAL for run-time calibration of the internal RC. 8-bit Microcontrollers. Application Note. Features.

Application Note 58 Crystal Considerations with Dallas Real Time Clocks

Atmel AVR1017: XMEGA - USB Hardware Design Recommendations. 8-bit Atmel Microcontrollers. Application Note. Features.

8-bit Microcontroller. Application Note. AVR410: RC5 IR Remote Control Receiver

unit : mm With heat sink (see Pd Ta characteristics)

Application Note. 8-bit Microcontrollers. AVR270: USB Mouse Demonstration

All-band AM/FM Receiver and Audio Amplifier IC U2510B

AVR125: ADC of tinyavr in Single Ended Mode. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

How To Use A Watt Saver On A Microcontroller (Watt Saver) On A Cell Phone Or Mp3 Player

APPLICATION NOTE. Atmel AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Atmel AVR 8-bit Microcontroller. Introduction.

unit:mm 3022A-DIP12F

ICS379. Quad PLL with VCXO Quick Turn Clock. Description. Features. Block Diagram

Transcription:

AVR180: External Brown-out Protection Features Low-voltage Detector Prevent Register and EEPROM Corruption Two Discrete Solutions Integrated IC Solution Extreme Low-cost Solution Extreme Low-power Solution Formulas for Component Value Calculations Complete with Example Schematics 8-bit Microcontroller Application Note Introduction This application note shows in detail how to prevent system malfunction during periods of insufficient power supply voltage. It describes techniques to prevent the CPU from executing code during periods of low power by use of external low voltage detectors. These events are often referred to as Brown-outs, where power supply voltage drops to an insufficient level, or Black-outs where power supply voltage is completely removed for a period of time. Two discrete solutions are discussed in detail, allowing the user to calibrate the system requirements. A complete guide to Integrated Circuit (IC) solutions is also included. By the use of these techniques, the following can be prevented in the situations described above: CPU Register Corruption I/O Register Corruption I/O-pin Random Toggling SRAM Corruption EEPROM Corruption External Non-volatile Memory Corruption Note that AVR internal Flash Program Memory contents are never affected by insufficient power supply voltage. Rev. 1

Theory of Operation Threshold Voltage Prevents CPU Register Corruption Prevents I/O Register Corruption Prevents I/O Pin Random Toggling Prevents SRAM Corruption For the CPU to successfully decode and execute instructions, the supplied voltage must always stay above the minimum voltage level set by the chosen operating frequency. When supplied voltage drops below this level, the CPU may start to execute some instructions incorrectly. The result is unexpected activity on the internal data and control lines. This activity may cause CPU Registers, I/O Registers and Data Memories to get corrupted. To avoid these problems, the CPU should be prevented from executing code during periods of insufficient supply voltage. This is best ensured by the use of an external Power Supply Low Voltage Detector. Below a fixed threshold voltage V T, the detector circuit forces the pin low (active). Forcing low immediately stops the CPU from executing code. While the supplied voltage is below the required threshold voltage V T, the MCU is halted, making sure the system stays in a known state. When the supplied voltage rises above this predefined voltage, the pin is again released, and the MCU starts to execute code beginning at the Reset Vector (0x0000). It is recommended to set the threshold voltage 5-15% below typical, to allow for small fluctuations in supplied voltage. The threshold voltage should always be selected to ensure that the detector will keep the device properly reset when supply voltage drops below the critical voltage required by the CPU. Care should be taken to ensure sufficiently high detector threshold voltage even in worst case situations. When the Detector keeps the MCU in Reset, all CPU activity is halted. When released from Reset, the CPU Registers will all be in their default state. For the duration of the Reset, the General Purpose Register File contents will be preserved. Without a Detector, random CPU activity such as described in the introduction may cause the CPU Registers to get corrupted. Also see Volatile Memory below. Note: The General Purpose Register File contents are not guaranteed to be preserved during Reset in the AT90S1200, the AT90S8515 and the AT90S4414. When using a Detector to keep the MCU in reset, all I/O Registers will be kept in their default state for the duration of the reset. Consequently, all On-chip peripherals will stay in their reset state. Without a Detector, random CPU activity such as described in the introduction may write an unknown value to any I/O Register. This may cause unexpected behavior of the onchip peripherals. A Detector will keep the MCU in Reset, and all I/O pins will be kept in their default state for the duration of the Reset. Without a Detector, random CPU activity such as described in the introduction may write a random value to the I/O Registers. This may cause random toggling of the I/O pins. By the use of a Detector to keep the MCU in Reset, there will be no accesses to the internal SRAM. The memory contents will keep their present contents for the duration of the Reset. Without a Detector, random CPU activity such as described in the introduction may write an unknown value to any SRAM location. Also see Volatile Memory below. Note: The guaranteed preservation of data in internal SRAM does not apply to the AT90S8515 and 4414. In this device, the SRAM data is not guaranteed to be preserved during Reset. 2 AVR180

AVR180 Prevents Non-volatile Memory Corruption Flash Program Memory Volatile Memory Implementation Design Hint: Supply Voltage Filtering Non-volatile memories like EPROM, EEPROM, and Flash are designed to keep their contents even when power is completely removed from the system. By the use of a Detector to keep the MCU in Reset, all activity on the control lines cease. The memory contents are such prevented from unintentional writes from the CPU for the duration of the Reset. Without a Detector, random CPU activity such as described in the introduction may initialize an unintended write to the non-volatile memory. This may cause random corruption of the memory contents. Notes: 1. As the AVR CPU is not capable of writing to its own program memory, the internal Flash Program memory contents are never affected by a power failure situation. 2. For any write to non-volatile memory, a minimum voltage is required to successfully write the new values into the memory. If supplied voltage at any time during the write cycle drops below the minimum voltage, the write will fail, corrupting the location written to. 3. In some AVR devices, when the reset activates during a write to the internal EEPROM, the EEPROM Address Register will be set to zero (0x000). The result may be seen as corruption of both the location being written, and of location zero (0x000). The Internal Flash Program Memory contents are never affected by a power failure situation. The AVR CPU is incapable of writing to its own program memory. Even when external low voltage detectors halts the CPU, volatile memory (like Registers and RAM) will eventually loose their contents if the supply voltage drops below the minimum voltage required for each memory cell to preserve its current value. When the CPU is halted, the minimum voltage where the AVR internal RAM is guaranteed to preserve the contents is typically 2.0 volts. Factory tests on actual silicon have shown that AVR devices may preserve the RAM contents even down to 0.5-1.0 volts. A variety of Integrated Circuit (IC) solutions are available from a range of manufacturers. These offer a high accuracy solution at a low price, typically guaranteeing the threshold voltage to be within ± 1%. Although the elementary three pin fixed voltage detector is available, there is also a whole range of devices offering additional features like Reset Pulse stretching, Power-on Reset Time-out, Watchdogs, Power regulation, dual supply switching for UPS operation and more. Included in this application note is a guide to the world of integrated circuit solutions. As an alternative, this application note also presents two discrete Low-Power Supply Voltage Detectors. Alternative 1: Minimum Power Consumption. Well-suited for battery-powered applications where power consumption is the most critical parameter. Alternative 2: Minimum Cost. This is a minimum component cost solution for applications where cost is a key parameter and power consumption is not critical. Alternative 3: High accuracy. High-quality semiconductor ICs are used to build an accurate Brown-out Detector with low-power consumption. Use low impedance capacitors (low ESR and ESL) on the and multi-layer PCB with power planes to improve transient rejection from the power supply. 3

Alternative 1: Lowpower Consumption Characteristics Very Low-power Consumption, (Typ 0.5µA@3V, 1µA@5V) Low-cost Large Hysteresis, Typ. 0.3 Volts Fast Output Transitions Accuracy ± 5-10% High Component Count Long Response Time on Figure 1. Low-power Consumption Brown-out Detector C3 R1 R2 C1 R3 R4 T1 C2 R5 <50K T3 T2 ISP OPTIONAL SWITCH AVR 100-500K GND Figure 2. These Oscilloscope Plots Show How the Voltage on Varies with 4 AVR180

AVR180 Introduction Theory of Operation The circuit in Figure 1 benefits from low-power consumption, which makes it suitable for battery operated applications. Standard discrete components give a low cost design. The voltage transition on the pin is very steep. Combined with the large hysteresis, the accuracy is high. On the other hand, the response time is slow, which makes it unsuitable for rapidly varying supply voltages. This Detector has two stages, the Detector and the Amplifier. In the Detector stage, the threshold voltage is set by the resistors R1 and R2 in relation to the critical voltage of transistor T1. Under normal operation, this transistor is conducting, When the supply voltage drops below the threshold voltage, the transistor shuts off. The output from this Detector is lead to the input of the ultra low power Amplifier stage. Under normal operation, the low voltage of the base of transistor T2 causes it to remain shut, allowing resistor R5 to pull the input high. The Amplifier stage also contains a hysteresis feedback loop through transistor T3, shorting resistor R3 in the amplifier when the output is kept low. Choosing Components T1, T2, and T3 The production spread of current gain β (or h FE ) in transistors T1 affects the threshold voltage V T (typically ± 0.2 volts). Most small signal transistors can be used, but low production spread transistors are recommended. Care should be taken if transistor T1 is changed from one type to another. The emitterbase threshold voltage of T1 affects the constant (0.4) in the equation for threshold voltage (below). As a consequence, a change of transistor could cause a change in the threshold voltage of the detector, which requires the voltage divider R1 + R2 to be recalculated. R1 and R2 R1 and R2 forms a voltage divider that defines the threshold voltage V T. As the threshold voltage depends on these resistors, it is recommended to choose resistors with 1% tolerance or better. Also see Noise Sensitivity below. R1 is usually chosen equal to 10 MΩ to ensure the lowest power consumption possible. R2 is then found by the equation below. The constant (0.4) in the equation may vary slightly with variations in transistor T1: 0,4 V T ( R1 + R2) ------- 0,4 R1 =, or R2 = -------------------- R2 V T 0,4 R3 R3 is a non-critical pull-up resistor which has very little influence on the threshold voltage. It should be selected as large as possible to minimize power consumption. A resistance of R3 greater than 10 MΩ is not recommended, see Noise Sensitivity below. R4 Resistor R4 defines the hysteresis of the threshold voltage (V T ). By choosing R4 to 3.3 MΩ, the resulting hysteresis will be approximately 0.3 volts. A smaller R4 will give a larger hysteresis, a larger R4 gives smaller hysteresis. A larger R4 will also result in a less sharp transition in the output slope. Large deviations from the recommended value will eventually alter the constant 0.4 in the threshold voltage equation above. As the hysteresis is only slightly changed with variation in R4 resistance, the accuracy is not critical. 5

R5 C1 and C2 C3 Reset Switch/In-System Programming Response Time Noise Sensitivity Threshold Accuracy Resistor R5 pulls the pin high in Normal Operating mode. A value less than 50 kω is recommended to tie sufficiently hard to. As no current passes through this resistor in normal operating mode, its value and accuracy is otherwise of little importance. When is pulled low, this resistor will start conducting a relatively large current. Capacitors C1 and C2 short RF noise picked up in the circuitry and amplified by the transistors. Both capacitors can be omitted, but a value greater than 1 nf is recommended. For maximum noise immunity, 100 nf (LF) or capacitors with lower ESR (HF) should be selected when possible. Also see Response Time below. The accuracy is not critical, but to ensure proper RF decoupling, the capacitors should have Z5U dielectric or better. Capacitor C3 decouples the power lines. It can be omitted if there is RF decoupling of the power lines somewhere nearby on the circuit board, otherwise 1 nf is recommended. For maximum noise immunity, 100 nf (LF) or low ESR (HF) should be selected. If a push button reset and/or ISP capabilities are required, they are simply connected in parallel as shown in Figure 1. As the switch/programmer will pull low, power consumption in R5 will be relatively high for the duration of the event. Also see Power Consumption below. Choosing large values for capacitors C1 and C2 will slow down the circuit s response time. This is not a problem with battery driven applications where the supply voltage decreases slowly over time. Observe that the response time also applies to the time immediately following Power-on. This might affect operation when a flat battery is loaded. When power can drop more rapidly, the longer response time should be taken into consideration. Choosing values of R1 and R3 greater than 10 MΩ is not recommended, as it makes the circuitry sensitive to thermal noise generated in the resistor. When noise is not critical, the values of R1 and R3 can be raised to 20 MΩ. Choosing larger values will result in the resistors not conducting sufficient current, giving in a non-functional Detector. If more noise immunity is required, these resistors can be chosen smaller, at the expense of increased power consumption. Capacitors C1, C2 and C3 are decoupling capacitors to minimize noise sensitivity to both RF and 50/60 Hz fields. They can all be omitted, but the noise immunity depend strongly on the values selected. As the threshold voltage is defined mainly by R1 and R2, inaccuracies in these resistors directly influence the threshold voltage accuracy. It is recommended to choose these with ± 1% tolerance. 6 AVR180

AVR180 Power Consumption The current consumption in normal operating mode (sufficiently high ) is found by: I --------------------------------------------------------- 1 1 = V ( R1 + R2) ( R3 + R4) CC -------------------- R1 + R2 + R3 -------------------- + R4 When reset switch or programmer force to GND, the current increases to: I ------------------------------------------------------------------------------------------------ ( R1 + R2) ( R3 + R4) R5 R When voltage drops to the level where the detector activates, transistor T1 closes, T2 opens and the current is: I ---------------------------------------------------------------- ( R1 + R2) R5 R As resistor R5 is usually chosen much smaller than the other resistors R1-R4, the last two expressions both simplify to: I R5 -------------------------------- R Table 1. Example Values Example Values Component 3.0V 4.5V Recommended Tolerance T1, T2 BC548/BC848/2N3904 I CE 2.5 ma, V CE 8 V, β/h FE 100 T3 BC558/BC858/2N3906 I CE 2.5 ma, V CE 8 V, β/h FE 100 R1 10 MΩ 1% R2 1.54 MΩ 976 kω 1% R3 10 MΩ 20% R4 3.3 MΩ 20% R5 47 kω 20% C1, C2, C3 100 nf 20%, Z5U dielectric or better 7

Alternative 2: Lowcost Characteristics Low-component Count Very Low-cost Small Footprint Short Response Time Small Hysteresis Output Drops Slowly with Low Accuracy (± 4-8%) High Current Consumption Sensitive to Component Variations Figure 3. Low-cost Brown-out Detector R2 R1 T1 R3 AVR 100-50K GND Figure 4. Low-cost Brown-out Detector with Manual Reset Button R2 R1 T1 R4 R3 ISP OPTIONAL SWITCH AVR 100-50K GND 8 AVR180

AVR180 Figure 5. These Oscilloscope Plots Show how the Voltage on Varies with Introduction Theory of Operation Figure 3 is showing a circuit that features low cost and small physical size. However, its high current consumption might make it unsuited for battery operated applications. As the voltage transition on the pin is fairly slow when drops, the circuit is sensitive to inaccuracies in component values. Due to inaccuracies in resistors R1 and R2, transistor T1 and AVR MCU threshold value, the threshold value V T should be chosen minimum 15% below nominal. During normal operation, the transistor T1 is open, keeping at. When the supply voltage drops below the threshold voltage (V T ), the transistor T1 closes. This allows resistor R3 to pull low (active). The closing of the transistor T1 occurs when the voltage from emitter to base drops below a certain value, usually 0.7 volts in small signal silicon transistors. R1 and R2 is a voltage divider that controls the emitter-base voltage. The threshold voltage, V T, is defined by: R1 R2 V T 0.7 -------------------- +, or R2 R1 V T ------ ------- 1 R2 0.7 9

Choosing Components T1 R1 and R2 Almost any small signal PNP transistor can be used. One with high gain (β/h FE ) is recommended as it gives faster transitions in the output voltage with variations in around the threshold voltage. Faster transitions make the circuit more immune to component variation, reducing the need to calibrate the Detector. Also see Threshold Accuracy on page 6. Calibration is also required if the threshold voltage for the transistor varies. This voltage is the constant 0.7 in the equation above. The voltage is stable for the same type of transistor, but take care when selecting a transistor. A change in this parameter will seriously affect the threshold voltage of the Detector. As the formula states, the threshold voltage V T is dependent upon R1 and R2. Resistor R1 should be about 200 kω or lower. This ensures that the current out of the transistor T1 s base will not influence the voltage divider R1-R2. (This is for an amplification (β/h FE ) value of at least 100.) R3 The AVR s pin has an internal pull-up resistor with a nominal value of 100-500 kω. When transistor T1 is off, the internal pull-up and R3 form a voltage divider. The resulting voltage has to be sufficiently low to assure that the MCU line is held active. The recommended value for resistor R3 is 50 kω or lower, which ensures that the voltage at is always less than 1/3. Reset Switch/In-System Programming Threshold Accuracy If push button reset and/or ISP capabilities are required, a series resistor R4 must be connected as shown in Figure 4. This resistor allows the reset switch/programmer to override the transistor T1 and pull the pin low. To ensure proper low voltage detector operation, the series resistance in R3 + R4 should not exceed the recommended 50 kω. As the threshold voltage is defined mainly by R1 and R2, inaccuracies in these resistors directly influence the threshold voltage. It is recommended to use resistors with ± 1% tolerance. Due to the slow transitions on the output of the detector, variations in threshold in the AVR MCU will lead to inaccuracies in threshold voltage. This inaccuracy is typically ± 0.15 volts, which equals ± 3% in a 5V system. (± 5% at 3.3V). This inaccuracy is lowered by choosing a transistor T1 with higher gain (β/h FE ) which increases the transition speed. 10 AVR180

AVR180 Power Consumption The current through the detector in normal operating mode (sufficiently high ) is found by: 1 1 I -------------------------------------- = V ( R1 + R2) R3 CC -------------------- + ------ R1 + R2 R3 When switch or programmer force to GND, the current increases to: I ----------------------------------------------------------------------------- ( R1 + R2) R3 R4 R When voltage drops to the level where the transistor T1 closes, the current drops to: I ------------------------------------------------------------------------------------ ( R1 + R2) ( R3 + R4 + R ) Table 2. Example Values Example Values Component V T = 3.0V V T = 4.5V Recommended Tolerance T1 BC558/BC858/2N3906 I CE 2.5 ma, V CE 8 V, β/h FE 100 R1 180 kω 1% R2 56 kω 33 kω 1% R3 47 kω 20% R4 4.7 k 20% 11

Alternative 3: Integrated Circuit Solutions Characteristics Introduction Easy to Mount Very Accurate Threshold Voltage Low Power Consumption Small Footprint Low Component Count Wide Variety in Additional Functionality A selection of integrated circuits is available from various semiconductor suppliers. They vary from simple 3-pin fixed voltage detectors to advanced circuitry containing Watchdog Timers and Power-on Reset (POR) Timeouts. Because all AVR MCUs have built-in Watchdog and POR circuitry, these functions do not require handling by the external IC. The threshold accuracy is better than ± 1% for most circuits. Current consumption is in the µa range. Make sure to choose a device with an active low output. A wide variety of package types are available, ranging from miniature 3-pin SOT-23 to large packages with high pin count. Figure 6. Detector with Push-pull Output DETECTOR LOGIC R1 1-4K OPTIONAL SWITCH ISP Figure 7. Detector with Open-drain Output DETECTOR LOGIC ISP OPTIONAL SWITCH Figure 8. Alternative Location of Manual Reset Switch GND 12 AVR180

AVR180 Output Driver The IC Reset output can be push-pull or open drain (open collector), either CMOS or TTL output levels. Open drain solutions allow easy connection of a manual reset button and/or In-System Programmers. This feature can also be implemented with push-pull outputs, with the addition of a resistor in series with the output. The ISP and/or manual button is connected between the resistor and the AVR input (see Figure 6 and Figure 7). Figure 9. Reset Pulse Stretching V T t BROWN-OUT WITHOUT PULSE STRETCHING t BROWN-OUT t RST WITH PULSE STRETCHING Reset Pulse Stretching Power Regulator Battery Backup Solutions An additional feature in some of these circuits is stretching of the reset pulse. The Reset is held active for a defined amount of time after the condition (Power-on Reset, Brownout Reset etc.) that caused the reset has returned to normal (see Figure 9). Some of these devices also provide this feature for the Manual Reset. The device senses the output level, detecting the closing and opening of a reset button. When the button is released, the device keeps the reset line active for an additional amount of time. WARNING! This feature will interfere with the operation of an In-System Programmer, which toggles the line actively. Several integrated power regulators includes the Low-voltage Detector, combining both functionalities in one device. This reduces part count, and often adds the functionality at no extra cost. Some systems contain a battery to supply power when the main power drops. The power regulator in such systems often provides a status signal to the MCU telling which source currently supplies power to the circuit. Connecting this signal to will shut the AVR down when battery power is used, preserving RAM contents but halting execution. Alternatively, connecting this signal to an input pin, the AVR can detect the event and execute a safe power down sequence, switching off power hungry peripheral equipment (motor, display etc.) before entering Power-down mode. (The power consumption in is the same as in Normal Active Running mode, whereas the consumption in power down mode is in the µa range.) When main power supply voltage returns to an acceptable level, the AVR should detect the event, wake up and resume execution where it left off. 13

Figure 10. Adding Hysteresis to Threshold Voltage R1 DETECTOR LOGIC R2 ISP R1 1-4K W OPTIONAL SWITCH Hysteresis Hysteresis in the Low-voltage Detector might be implemented in the integrated circuit, or can be added with external circuitry (Figure 10). This prevents the detector from oscillating when used in battery applications. Figure 11. Integrated Reset Circuit with Preset Threshold Voltage GND ISP OPTIONAL SWITCH AVR GND Figure 12. Integrated Reset Circuit with Adjustable Threshold Voltage V T R1 ISP AVR IN R2 GND OPTIONAL SWITCH GND Fixed/Adjustable Threshold Voltage Some circuits offer the threshold voltage V T to be tuned by external components, while others have a preset threshold voltage reference. The use of a fixed threshold voltage IC is shown in Figure 11. The typical connection for externally tuned threshold voltage is shown in Figure 12. This device offers an internal voltage reference and a comparator. If the voltage at the input pin is higher than the reference voltage, the output will be activated. The threshold voltage is easily defined by a voltage divider, R1 and R2. 14 AVR180

AVR180 Table 3. Example Devices Device Features ISP Support Cost Level (4) MAX809 (1) Fixed Threshold Voltage, Fixed Pulse Stretching Yes A MAX811 (1) Fixed Threshold Voltage, Fixed Pulse Stretching, Low Power, Manual Reset Input Yes A MAX821 (1) Fixed Threshold Voltage, Adjustable Pulse Stretching, Low Power Yes DS1811 (2) Fixed Threshold Voltage, Fixed Pulse Stretching Yes DS1813/18 (2) Fixed Threshold Voltage, Fixed Pulse Stretching, Feedback Monitor No V6301 (3) Fixed Threshold Voltage, Fixed Pulse Stretching, Low Power, Low Cost Yes C V6340 (3) Fixed Threshold Voltage, No Pulse Stretching, Low Cost Yes C Notes: 1. Offered by Maxim Integrated Product, Inc. 2. Offered by Dallas Semiconductors. 3. Offered by EM Microelectronic-Marin SA. 4. A = expensive. B = moderate. C = inexpensive. 15

Atmel Headquarters Corporate Headquarters 2325 Orchard Parkway San Jose, CA 95131 TEL 1(408) 441-0311 FAX 1(408) 487-2600 Europe Atmel Sarl Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland TEL (41) 26-426-5555 FAX (41) 26-426-5500 Asia Room 1219 Chinachem Golden Plaza 77 Mody Road Tsimhatsui East Kowloon Hong Kong TEL (852) 2721-9778 FAX (852) 2722-1369 Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 Japan TEL (81) 3-3523-3551 FAX (81) 3-3523-7581 Atmel Operations Memory 2325 Orchard Parkway San Jose, CA 95131 TEL 1(408) 441-0311 FAX 1(408) 436-4314 Microcontrollers 2325 Orchard Parkway San Jose, CA 95131 TEL 1(408) 441-0311 FAX 1(408) 436-4314 La Chantrerie BP 70602 44306 Nantes Cedex 3, France TEL (33) 2-40-18-18-18 FAX (33) 2-40-18-19-60 ASIC/ASSP/Smart Cards Zone Industrielle 13106 Rousset Cedex, France TEL (33) 4-42-53-60-00 FAX (33) 4-42-53-60-01 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906 TEL 1(719) 576-3300 FAX 1(719) 540-1759 Scottish Enterprise Technology Park Maxwell Building East Kilbride G75 0QR, Scotland TEL (44) 1355-803-000 FAX (44) 1355-242-743 RF/Automotive Theresienstrasse 2 Postfach 3535 74025 Heilbronn, Germany TEL (49) 71-31-67-0 FAX (49) 71-31-67-2340 1150 East Cheyenne Mtn. Blvd. Colorado Springs, CO 80906 TEL 1(719) 576-3300 FAX 1(719) 540-1759 Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom Avenue de Rochepleine BP 123 38521 Saint-Egreve Cedex, France TEL (33) 4-76-58-30-00 FAX (33) 4-76-58-34-80 e-mail literature@atmel.com Web Site http://www.atmel.com Atmel Corporation 2002. Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company s standard warranty which is detailed in Atmel s Terms and Conditions located on the Company s web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel s products are not authorized for use as critical components in life support devices or systems. ATMEL and AVR are the registered trademarks of Atmel. Other terms and product names may be the trademarks of others. Printed on recycled paper. 0M