APPLICATION NOTE. How to Securely Switch Atmel s LIN Transceiver ATA6662/ATA6662C to Sleep Mode ATA6662/ATA6662C. Concerning Atmel ATA6662

Similar documents
AVR134: Real Time Clock (RTC) Using the Asynchronous Timer. Features. Introduction. AVR 8-bit Microcontrollers APPLICATION NOTE

AVR42789: Writing to Flash on the New tinyavr Platform Using Assembly

AT60142H/HT. Rad-Hard 512Kx8 Very Low Power CMOS SRAM ERRATA-SHEET. Active Errata List. Errata History. Abbreviations. 1.

AT21CS Series Reset and Discovery. Introduction. Serial EEPROM APPLICATION NOTE

APPLICATION NOTE. AT11008: Migration from ATxmega16D4/32D4 Revision E to Revision I. Atmel AVR XMEGA. Introduction. Features

AT11512: SAM L Brown Out Detector (BOD) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

AT09381: SAM D - Debugging Watchdog Timer Reset. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

Ethernet1 Xplained Pro

AT03975: Getting Started with SAM L21. Descripton. Features. SMART ARM-Based Microcontroller APPLICATION NOTE

QT3 Xplained Pro. Preface. Atmel QTouch USER GUIDE

USER GUIDE. Atmel QT6 Xplained Pro. Preface

APPLICATION NOTE. AT6486: Using DIVAS on SAMC Microcontroller. SMART ARM-Based Microcontroller. Introduction. Features

APPLICATION NOTE. Atmel QT4 Xplained Pro User Guide ATAN0114. Preface

Atmel ATtiny1634 MCU Atmel ATA SBC LIN transceiver with integrated voltage regulator Touch. Three Atmel QTouch buttons One Atmel QTouch slider

ATtiny104 Xplained Nano. Preface. AVR 8-bit Microcontrollers USER GUIDE

Smart RF Device Family - Getting Started Guide. Features. Description. References ATAN0115 APPLICATION NOTE

AT03262: SAM D/R/L/C System Pin Multiplexer (SYSTEM PINMUX) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Atmel AT01080: XMEGA E Schematic Checklist. Atmel AVR XMEGA E. Features. Introduction

USER GUIDE. ATWINC1500 Xplained Pro. Preface

QT2 Xplained Pro. Preface. Atmel QTouch USER GUIDE

AVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro. Introduction. Features. AVR XMEGA Microcontrollers APPLICATION NOTE

ATtiny817 QTouch Moisture Demo User Guide. Description. Features. AVR 8-bit Microcontrollers USER GUIDE

APPLICATION NOTE. 3-lead CONTACT Package Usage. ATSHA204A, ATECC108A, and ATECC508A. Introduction. 3-lead CONTACT Package

EDBG. Description. Programmers and Debuggers USER GUIDE

AT88CK101 HARDWARE USER GUIDE. Atmel CryptoAuthentication Development Kit. Atmel CryptoAuthentication AT88CK101 Daughterboard

AT06467: Getting started with SAM D09/D10/D11. Features. Description. SMART ARM-based Microcontrollers APPLICATION NOTE

ATAES132A Firmware Development Library. Introduction. Features. Atmel CryptoAuthentication USER GUIDE

AT10942: SAM Configurable Custom Logic (CCL) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

This user guide describes how to run the Atmel ATWINC3400 Bluetooth Low Energy (BLE) Provisioning demo from out-of-box conditions.

SAM4 Reset Controller (RSTC)

APPLICATION NOTE. AT04470: Differences between SAM D21 Variants A, B, and L. 32-bit Microcontroller. Introduction

APPLICATION NOTE. AT05567: TC Capture on External Interrupt with the Event System on SAM D20. Preface ASF PROJECT DOCUMENTATION

APPLICATION NOTE. Atmel AVR3009: Driving QTouch Device with I 2 C Interface. Atmel QTouch. Introduction

SAMA5D2 Quad SPI (QSPI) Performance. Introduction. SMART ARM-based Microprocessor APPLICATION NOTE

I/O1 Xplained Pro. Preface. Atmel MCUs USER GUIDE

USER GUIDE. Atmel QT1 Xplained Pro. Preface

ATECC508A Public Key Validation. Introduction. Atmel CryptoAuthentication APPLICATION NOTE

ATECC108/ATSHA204 USER GUIDE. Atmel Firmware Library. Features. Introduction

APPLICATION NOTE. Generating Random Secrets. ATSHA204A, ATECC108A, and ATECC508A. Description. Topics

64K (8K x 8) Battery-Voltage Parallel EEPROM with Page Write and Software Data Protection AT28BV64B

USER GUIDE. Atmel OLED1 Xplained Pro. Preface

AVR1518: XMEGA-A1 Xplained Training - XMEGA Clock System. 8-bit Atmel Microcontrollers. Application Note. Prerequisites.

AT02667: XMEGA-E5 Xplained Hardware User's Guide. Features. Description. AVR XMEGA Microcontrollers APPLICATION NOTE

APPLICATION NOTE. Atmel AT03304: SAM D20 I 2 C Slave Bootloader SAM D20. Description. Features

DGILib USER GUIDE Atmel-42771A-DGILib_User Guide-09/2016

APPLICATION NOTE. Atmel AVR057: Internal RC Oscillator Calibration for ATtiny4/5/9/10/20/40. 8-bit Atmel Microcontrollers. Features.

APPLICATION NOTE. CryptoAuthentication Personalization Guide. ATSHA204A and ATECC508A. Introduction. Features

USER GUIDE. Atmel Segment LCD1 Xplained Pro. Preface

APPLICATION NOTE. AT03324: Atmel REB212BSMA-EK Quick Start Guide. Atmel MCU Wireless. Introduction

Native route discovery algorithm

Atmel AVR32847: Migration from/to the UC3L0 64/32/16 from/to the UC3L0 256/ bit Atmel Microcontrollers. Application Note.

APPLICATION NOTE. Atmel AVR1638: XMEGA RTC Calibration. 8-bit Atmel Microcontrollers. Features. Introduction

USER GUIDE. ATmega168 Xplained Mini User Guide. Introduction

ATZB-SAMR21-XPRO. Preface. SmartConnect USER GUIDE

AVR097: Migration between ATmega128 and ATmega1281/ATmega bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. Atmel AVR536: Migration from ATmega644 to ATmega644A. 8-bit Atmel Microcontrollers. Introduction

APPLICATION NOTE. Atmel AT03782: Using Low Power Modes in SAM4N Microcontroller. Atmel 32-bit Microcontroller. Features.

AVR4018: Inertial Two (ATAVRSBIN2) Hardware User's Guide. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

USER GUIDE EDBG. Description

APPLICATION NOTE. Atmel ATA6612/ATA6613/ATA6614 Development Board ATA6612/ATA6613/ATA6614. Features

SBAT90USB162 Atmel. SBAT90USB162 Development Board User s Manual

USER GUIDE. Atmel maxtouch Xplained Pro. Preface

USER GUIDE. ZigBit USB Stick User Guide. Introduction

AVR1303: Use and configuration of IR communication module. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

APPLICATION NOTE. AT07216: SAM G55 Schematic Checklist. Atmel SMART SAM G55. Introduction

LBAT90USB162 Atmel. LBAT90USB162 Development Board User s Manual

Atmel AVR1619: XMEGA-B1 Xplained Demonstration. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

AVR based 125kHz RFID Evaluation Kit (Re)Programming Guide ATA2270-EK1. Overview. Fuse Settings: ISP Programming

APPLICATION NOTE. Atmel AT03160: Migrating Bootloader from ATxmega128A1 to other Atmel XMEGA Devices. Atmel AVR XMEGA. Features.

Atmel AVR473: ATAVRSB202 Hardware User Guide. 8-bit Atmel Microcontrollers. Application Note. Features. 1 Introduction

Atmel ATMXT143E touchscreen controller Capacitive touch ITO 320 x 240 pixel LCD display with SPI interface LED backlight

APPLICATION NOTE. AT03197: Thermostat with Touch and Wireless Connectivity Hardware User's Guide. Atmel 32-bit Microcontroller. Description.

SMART ARM-based Microcontrollers ATSAMD21E16LMOTOR USER GUIDE

Embedded AVR Microcontroller Including RF Transmitter and Immobilizer LF Functionality for Remote Keyless Entry ATA5795. Summary.

USER GUIDE. Atmel PROTO1 Xplained Pro. Preface

Atmel QT600 Quick Start Guide Touch Solutions

AVR32917: picopower Board getting started. 32-bit Microcontrollers. Application Note. Preliminary. Features. 1 Introduction

Hardware Prerequisites Atmel Xplained Pro Evaluation Kit Atmel WINC1500 extension USB Micro Cable (TypeA / MicroB)

APPLICATION NOTE. Scope. Reference Documents. Software Ethernet Bridge on SAMA5D3/D4. Atmel SMART SAMA5D3/D4 Series

AVR532: Migration from ATmega48/88/168 to ATmega48A/88A/168A. 8-bit Microcontrollers. Application Note. 1 Introduction

AT07942: SAM4L Asynchronous Timer (AST) Driver. Introduction. SMART ARM-based Microcontrollers APPLICATION NOTE

APPLICATION NOTE ATAN0087. Introduction

ATmega328PB Xplained Mini. Introduction. AVR 8-bit Microcontrollers USER GUIDE

OLED display with pixels resolution Ambient light sensor CPU load Analog filter Quadrature Encoder with push button Digital I/O

AVR1922: Xplain Board Controller Firmware 8-bit Microcontrollers Application Note Features 1 Introduction

USER GUIDE. ATmega328P Xplained Mini User Guide. Introduction

Atmel CryptoAuthentication Starter Kit

AVR1503: Xplain training - XMEGA Programmable Multi Interrupt Controller 8-bit Microcontrollers Application Note Prerequisites

AN2825 Application Note

AT88RF04C. CryptoRF EEPROM Memory 13.56MHz, 4 Kilobits SUMMARY DATASHEET. Features

APPLICATION NOTE. Atmel AT03261: SAM D20 System Interrupt Driver (SYSTEM INTERRUPT) SAM D20 System Interrupt Driver (SYSTEM INTERRUPT)

AVR32752: Using the AVR32 UC3 Static Memory Controller. 32-bit Microcontrollers. Application Note. Features. 1 Introduction

AVR1315: Accessing the XMEGA EEPROM. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Application Note Using the ATV750, ATV750B, and ATF750C Erasable Programmable Logic Device Introduction 1.1 Device Names and Pin/Node Assignments

STK521. User Guide B AVR 01/12

Atmel LF-RFID Kit Comparison Chart. Application Note. Atmel LF-RFID Kit Comparison Chart. 1. Description

USER GUIDE. Wireless Production Test Reference Protocol Specification Document. Atmel MCU Wireless. Description

Preliminary MK-CY-043. Data Sheet. Amulet Capacitive 4.3 GEMmodule. Introduction:

Atmel AVR1924: XMEGA-A1 Xplained Hardware User's Guide. 8-bit Atmel Microcontrollers. Application Note. Preliminary. Features.

Transcription:

APPLICATION NOTE How to Securely Switch Atmel s LIN Transceiver ATA6662/ATA6662C to Sleep Mode ATA6662/ATA6662C Concerning Atmel ATA6662 The goal of this document is to describe how to switch the Atmel LIN transceiver ATA6662 into Sleep mode and how to securely handle undervoltage situations and immediate wakeups. This document contains simple code examples. These code examples assume that the part-specific header file is included before compilation. However, note that not all C compiler vendors include bit definitions in the header file. The code examples are dedicated to the AVR microcontrollers and the IAR C compiler. Figure 1 on page 2 shows the operating modes available in the Atmel ATA6662 as well as the transitions between them. It is only possible to switch the device to Sleep mode from Normal mode. 9155D-AUTO-06/15

Figure 1. Atmel ATA6662 Operating Modes Unpowered Mode V Batt = 0V b a a: V S > 5V b: V S < 5V c: Bus wake-up event d: wake-up from wake switch b Fail-safe Mode INH: high (INH internal high-side switch ON) Communication: OFF b = 1 d c Normal Mode INH: high (INH HS switch ON) Communication: ON Go to sleep command = 0; after 1 0 while TXD = 1 Local wake-up event = 1 Sleep Mode INH: high impedance (INH HS switch OFF) Communication: ON 2

1. Simple Switching of the Atmel ATA6662 to Sleep Mode In order to switch the Atmel ATA6662 to Sleep mode, the pin has to be pulled to GND and TXD has to remain at high level. After the time T sleep (beginning directly at the falling edge of the Enable signal) has expired, the device enters Sleep mode and the INH output is switched off. Figure 1-1. Switch to Sleep Mode Normal Mode Sleep Mode Delay time Sleep Mode T sleep_max = 12μs TXD LIN INH In a typical application, as depicted in Figure 1-2, switching off the INH-Pin switches off the voltage regulator of the module and thus the microcontroller is not longer supplied. Therefore, the complete module has very low current consumption until a wake-up occurs. Figure 1-2. Typical Application VBattery + Master node pull-up GND 5V 12V INH + 1kΩ GND VDD Microcontroller TXD WAKE RXD External switch RXD INH VS WAKE LIN TXD GND GND VS LIN LIN Sub Bus Either a remote wake-up via LIN or a local wake-up via the WAKE pin can be used to wake up the module. The device also wakes up with an undervoltage at the pin Vs. In all cases the LIN transceiver then enters the fail-safe mode, the INH output is switched on and the voltage regulator supplies the microcontroller. 3

1.1 Simple Switching C Routine The following C function can be used to switch the Atmel ATA6662 to Sleep mode. void Switch_ATA6662_To_SleepMode (void) { // Before setting the pin to low it has to be sure, that the TXD line // remains high. Therefore the pin PD1 (= TXD in at the ATmega88/168) has to be // set to output high here at the latest. The output high will be overwritten // by the UART as long as the UART transmitter is enabled. Therefore the UART // transmitter has to be disabled. PORTD I= (1<<PD1); // Set pin PD1 to output high (part 1) DDRD I= (1<<TX); // Set pin PD1 to output high (part 2) UCSRB &= ~(1<<TX); // Disable the UART transmitter. // Now the actual switching of the ATA6662 into the Sleep Mode takes place. // Assuming that the pin of the ATA6662 is connected to pin PD4 and that // this pin is already set to output. PORTD &= ~(1<<PD4); // Switch pin to low // From now on the proper supply of the microcontroller will be switched off // sooner or later. The microcontroller is waiting for this to happen. while (1) { // Active waiting for the power supply to be switched off _no_operation(); }; } 4

2. Potential Problems Using Simple Switching Without Additional Safety Precautions After switching the Atmel ATA6662 to Sleep mode, there are two scenarios which can lead to the situation where the connected microcontroller remains powered. With the implementation of the Go-to-Sleep mode function as shown under the heading Simple Switching C Routine on page 4, the microcontroller waits for the blocking capacitors to be discharged and the supply voltage to end; however, as this situation never occurs, the complete module ends in a dead-lock. 2.1 Immediate Wake-up after Going-to-sleep A very short low phase at the INH pin in combination with the blocking capacitors at the output of the voltage regulator is the basis for the first problem scenario. In order for this situation to occur, one possibility is the appearance of a Wake signal at the same time or slightly later than the falling edge of the signal. In this case, the device will wake up again and in the worst case, the INH pin has been at low level for just 12µs. The relevant signals during this scenario are illustrated below. Figure 2-1. Immediate Wake-up after Going-to-sleep Normal Mode Sleep Mode Failsafe Mode T sleep_min = 2μs WAKE T wake_min = 7μs TXD RXD INH T on_min = 5μs VCC T Normal_to_Sleep_to_Failsafe_min = 14μs Depending on the capacitances of the blocking capacitors at V cc and the current consumption of the microcontroller, it is possible that the microcontroller remains powered during the 12µs. 5

2.2 Undervoltage During Switching to Sleep Mode The second scenario that may lead to a dead-lock of the module occurs with battery voltages below +5V. In this case, the Atmel ATA6662 automatically switches into unpowered mode without providing information about this to the microcontroller. The unpowered mode is in general the same as the fail-safe mode; however, the Atmel ATA6662 does not change its state according to the pin. If the microcontroller does not change the state of the pin (the pin remains high) during this time, then the Atmel ATA6662 re-enters Normal mode after the battery voltage has automatically recovered. During the period of undervoltage, no data transmission via LIN is possible, which is in accordance to the LIN specification. If the Atmel ATA6662 device detects undervoltage and it has changed to unpowered mode, any further mode change via the pin does not lead to any action. During the unpowered mode, the INH pin switches to low level. Due to the blocking capacitors at the microcontroller s Vcc pin, the microcontroller remains active for a certain time. As the microcontroller has no information about the Atmel ATA6662 being in the unpowered mode, it is possible that the microcontroller intends to switch the device into the Sleep mode at or directly after this very point of time. This scenario is shown in Figure 2-2. Figure 2-2. Undervoltage During Switching to Sleep Mode V S Normal Mode Unpowered Mode Failsafe Mode V Sth INH V CC TXD RXD After the disappearance of the undervoltage at Vs, the Atmel ATA6662 switches from unpowered mode into fail-safe mode and therefore, the INH pin switches to high again. The Atmel ATA6662 stays in fail-safe mode as the pin is still low. However, the microcontroller expects the ATA6662 to have entered Sleep mode and it is caught in the active waiting loop for its power supply to be switched off. The microcontroller does not put the Atmel ATA6662 into Normal mode via the pin and the module remains in a dead-lock situation isolated from the LIN communication. 6

2.3 Behavior of the Atmel ATA6662 When Powered from a Voltage Slightly Above the Undervoltage Threshold In the third scenario, the behavior of the Atmel ATA6662 when using the software routine detailed in Section 1.1 Simple Switching C Routine on page 4 is the root cause for the potential dead-lock. Switching the Atmel ATA6662 into Sleep mode while the supply voltage of the Atmel ATA6662 is above the undervoltage voltage threshold but below the undervoltage voltage threshold +10% forces the device to enter the fail-safe mode typically 15µs after having entered the Sleep mode (10µs TINH_off 20µs). The reason for this is that the undervoltage detection of the Atmel ATA6662 is fed with a slightly increased reference voltage during the first microseconds in the Sleep mode. Therefore, the device changes into unpowered mode. In this mode the undervoltage detection is supplied with the correct reference voltage and therefore, no undervoltage is detected anymore and the Atmel ATA6662 switches directly to fail-safe mode. As the very short step through the unpowered mode is not important for the behavior itself it has been omitted in the following graph, which shows the scenario described above. Figure 2-3. Behavior at a Supply Voltage Slightly Above the Undervoltage Threshold V S Normal Mode Sleep Mode Failsafe Mode V Sth +10% V Sth INH T INH_off_typ = 15μs V CC TXD RXD 7

3. Solving the Potential Dead-lock Problems That the microcontroller remains powered while the Atmel ATA6662 has entered and left Sleep mode and remains in failsafe mode is common to all of the described dead-locked scenarios. The module s power supply has been switched off for a couple of microseconds, however this does not always lead to an undervoltage reset of the microcontroller due to the blocking capacitors. As the microcontroller is in an endless loop expecting either a reset signal or its supply voltage to disappear, both of which never occur, the module remains in a dead-lock. This scenario can be avoided using either a hardware solution or a software solution. 3.1 Hardware Solutions 3.1.1 Using an External Watchdog When the microcontroller remains alive and is waiting for its power supply to disappear, an external watchdog can reset the microcontroller. The precondition for this solution is, of course, that the microcontroller stops serving the watchdog before entering the waiting loop. 3.1.2 Using a Dedicated External Voltage Regulator with Reset Output As the Atmel ATA6662 indicates all of the above-mentioned scenarios with a low phase of the INH signal, which normally leads to an undervoltage reset of the connected microcontroller, the voltage regulator used should react on this INH signal quickly and directly. The voltage regulator should be able to generate a reset signal for the microcontroller as long as the INH input is low. Switching off the output voltage might not be sufficient as the remaining output voltage stored in the blocking capacitors can be sufficient to keep the microcontroller alive. 3.1.3 INH Monitoring for Resetting the Microcontroller If the voltage regulator cannot generate an INH-dependant reset signal, then the microcontroller itself can take over this task. The easiest solution is to connect the INH pin to a dedicated I/O-Pin of the microcontroller for monitoring the logic level of the INH pin. The microcontroller can then generate an internal reset according to the INH status. But as the INH pin is a battery-related output, special care must be taken when connecting this pin to the microcontroller. With an additional voltage divider between the INH output pin and ground the logical level of the INH output can easily be read out and the voltage level at the microcontroller input is limited to noncritical values. With this voltage divider it is also possible to monitor the battery voltage via the INH output pin. In this case the voltage divider has to be connected to an A/D converter input of the microcontroller as shown in Figure 3-1 on page 9. The current consumption of the module is not increased in Sleep Mode as the INH will be switched off in the Sleep Mode and therefore, the voltage divider is not active in this mode. 8

Figure 3-1. Monitoring the Battery Voltage VBattery + Master node pull-up GND 5V 12V + 1kΩ VDD ADC Microcontroller GND TXD WAKE RXD External switch RXD WAKE INH VS LIN TXD GND GND VS LIN LIN Sub Bus 3.2 Software Solution In addition to the hardware based solutions, it is also possible to identify when the Atmel ATA6662 is not in Sleep mode as expected via a software routine. When the microcontroller expects its power supply to disappear, an additional time-out can be implemented to cancel the waiting loop after the time-out has expired. The necessary time-out time mainly depends on the value of the blocking capacitor and on the output current of the voltage regulator. Using the following equations, the minimum time-out time necessary can be easily calculated. Q = C U (1-1) Q = I t (1-2) C U = I t (1-3) using (1-1) and (1-2) => t_min = C U/I (1-4) C: Total of all blocking capacitors at the power supply of the microcontroller I: Total output current of the voltage regulator to which the microcontroller is connected. U: Voltage difference of the nominal output voltage to the undervoltage reset threshold (if there is one) or the brown-out detection threshold. The resulting time is the minimum time for the blocking capacitors to be discharged. As the current output is almost never constant, the calculated time should be doubled (at least) to ensure that enough time has elapsed before leaving the endless loop. As the variable values are highly application-dependant it is not possible to state a fixed time-out time valid for all applications. In order to discharge the blocking capacitors as fast as possible resulting in an earlier undervoltage reset, the current consumption should not be reduced by the microcontroller while waiting for the power supply to disappear by entering a Current Save mode. 9

3.2.1 PAP The following programming flowchart shows a secure way of switching the Atmel ATA6662 to Sleep mode. The flowchart also identifies the previously described situations in which the microcontroller stays alive when using the C routine from Simple Switching C Routine on page 4. Figure 3-2. Flow Chart Send ATA6662 to Sleep Mode Set the TXD pin to output high and disable the UART Before setting the pin to low it has to be sure, that the TXD line remains high. Therefore the pin PD1 (= TXD pin at the ATmega88/168) has to be set to output high here at the latest. The output high will be overwritten by the UART as long as the UART transmitter is enabled. Therefore the UART transmitter has to be disabled. Start the Sleep sequence of the ATA6662 by setting the pin to low After 12μs the ATA6662 has entered the Sleep Mode at the latest Delay 12μs Set the TXD pin to input When the microcontroller remains active then the microcontroller can read the input level at the TXD pin in order to determine the reason Active waiting until the time-out has elapsed or the power supply has been disappeared The time-out should be long enough for allowing the external blocking capacitors at the Vcc pin to discharge A wake-up via pin WAKE Has been the reason for waking up Yes Is TXD low? No A short under-voltage at V S has occured or V S is slightly above V Sth Return WAKE Return Vs Using this flowchart, the calling function will report the reason why the Atmel ATA6662 has left Sleep mode and why the microcontroller remains active. The calling function then has to decide how to proceed. 10

3.2.2 C Routine unsigned char Switch_ATA6662_To_SleepMode (void) { // Before setting the pin to low it has to be sure, that the TXD line // remains high. Therefore the pin PD1 (= TXD pin at the ATmega88/168) has // to be set to output high here at the latest. The output high will be // overwritten by the UART as long as the UART transmitter is enabled. // Therefore the UART transmitter has to be disabled. PORTD I= (1<<PD1); // Set pin PD1 to output high (part 1) DDRD I= (1<<PD1); // Set pin PD1 to output high (part 1) UCSRB &= ~(1<<TX); // Disable the UART transmitter // Now the actual switching of the ATA6662 into the Sleep Mode takes place // Assuming that the pin of the ATA6662 is connected to pin PD4 and that // this pin is already set to output PORTD &= ~(1<<PD4); // Switch pin to low // From now on the power supply of the microcontroller will be switched // off sooner or later. The microcontroller is waiting for this to happen. // Delay 12µs // Assuming the device is running on a 1MHz RC oscillator // Including the file intrinsics.h is required for using the delay function _delay_cycles(12; // Set the TXD pin to input. The internal pull-ups will be active then // because of the former PORTD setting DDRD &= ~(1<<PD1); // Set pin PD1 to input // Delay 5ms for the power supply to be switched off. The time-out should // be adapted to the particular application _delay_cycles(5000); // Normally the microcontroller will never reach the following statements, // as the power supply should have been switched off long ago // If the TXD pin is high, then either a short undervoltage at V S was // present while switching to Sleep Mode or V S is slightly above the V S // undervoltage threshold and the ATA6662 has been woken because of this. // If the TXD pin is low, then an immediate and regular Wake-up via the // pin WAKE (local wake-up) was detected } if (PIND & (1<<PD1)) return VS; else return WAKE; VS and WAKE have to be defined as global parameters. 11

4. Revision History Please note that the following page numbers referred to in this section refer to the specific revision mentioned, not to this document. Revision No. 9155D-AUTO-06/15 9155C-AUTO-05/11 9155B-AUTO-03/11 History Put document in the latest template Section 4.1.3 INH Monitoring for Resetting the Microcontroller on page 8 updated ATA6662C on page 1 added 12

X X X X X X Atmel Corporation 1600 Technology Drive, San Jose, CA 95110 USA T: (+1)(408) 441.0311 F: (+1)(408) 436.4200 www.atmel.com 2015 Atmel Corporation. / Rev.: Atmel, Atmel logo and combinations thereof, Enabling Unlimited Possibilities, AVR, and others are registered trademarks or trademarks of Atmel Corporation in U.S. and other countries. Other terms and product names may be trademarks of others. DISCLAIMER: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN THE ATMEL TERMS AND CONDITIONS OF SALES LOCATED ON THE ATMEL WEBSITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMT. IN NO EVT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUTIAL, PUNITIVE, SPECIAL OR INCIDTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS AND PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMT, EV IF ATMEL HAS BE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and products descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. SAFETY-CRITICAL, MILITARY, AND AUTOMOTIVE APPLICATIONS DISCLAIMER: Atmel products are not designed for and will not be used in connection with any applications where the failure of such products would reasonably be expected to result in significant personal injury or death ( Safety-Critical Applications ) without an Atmel officer's specific written consent. Safety-Critical Applications include, without limitation, life support devices and systems, equipment or systems for the operation of nuclear facilities and weapons systems. Atmel products are not designed nor intended for use in military or aerospace applications or environments unless specifically designated by Atmel as military-grade. Atmel products are not designed nor intended for use in automotive applications unless specifically designated by Atmel as automotive-grade.