attiny416/attiny417/attiny814/attiny816/attiny817 -...

627
ATtiny416/417/814/816/817 Automotive tinyAVR ® 1-series Introduction The ATtiny416/417/814/816/817 Automotive are members of the tinyAVR ® 1-series of microcontrollers, using the AVR ® processor with hardware multiplier, running at up to 16 MHz, with 4/8 KB Flash, 256/512 bytes of SRAM, and 128 bytes of EEPROM in a 14-, 20- or 24-pin package. The tinyAVR ® 1-series uses the latest technologies with a flexible, low-power architecture including Event System and SleepWalking, accurate analog features, and Core Independent Peripherals. Capacitive touch interfaces with driven shield are supported with the integrated QTouch ® peripheral touch controller. (1) Features CPU AVR ® CPU Running at up to 16 MHz Single-cycle I/O access Two-level interrupt controller Two-cycle hardware multiplier Memories 4/8 KB In-system self-programmable Flash memory 128B EEPROM 256/512B SRAM Write/erase endurance: Flash: 10,000 cycles EEPROM: 100,000 cycles Data retention: 40 years at 55°C System Power-on Reset (POR) Brown-out Detector (BOD) Clock options: 16 MHz low-power internal RC oscillator 32.768 kHz Ultra Low-Power (ULP) internal RC oscillator 32.768 kHz external crystal oscillator External clock input Single-pin Unified Program and Debug Interface (UPDI) Three sleep modes: Idle with all peripherals running for immediate wake-up © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 1

Upload: others

Post on 21-Mar-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

  • ATtiny416/417/814/816/817Automotive

    tinyAVR® 1-series

    Introduction

    The ATtiny416/417/814/816/817 Automotive are members of the tinyAVR® 1-series of microcontrollers,using the AVR® processor with hardware multiplier, running at up to 16 MHz, with 4/8 KB Flash, 256/512bytes of SRAM, and 128 bytes of EEPROM in a 14-, 20- or 24-pin package. The tinyAVR® 1-series usesthe latest technologies with a flexible, low-power architecture including Event System and SleepWalking,accurate analog features, and Core Independent Peripherals. Capacitive touch interfaces with drivenshield are supported with the integrated QTouch® peripheral touch controller.(1)

    Features

    • CPU– AVR® CPU– Running at up to 16 MHz– Single-cycle I/O access– Two-level interrupt controller– Two-cycle hardware multiplier

    • Memories– 4/8 KB In-system self-programmable Flash memory– 128B EEPROM– 256/512B SRAM– Write/erase endurance:

    • Flash: 10,000 cycles• EEPROM: 100,000 cycles

    – Data retention: 40 years at 55°C• System

    – Power-on Reset (POR)– Brown-out Detector (BOD)– Clock options:

    • 16 MHz low-power internal RC oscillator• 32.768 kHz Ultra Low-Power (ULP) internal RC oscillator• 32.768 kHz external crystal oscillator• External clock input

    – Single-pin Unified Program and Debug Interface (UPDI)– Three sleep modes:

    • Idle with all peripherals running for immediate wake-up

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 1

  • • Standby– Configurable operation of selected peripherals– SleepWalking peripherals

    • Power-Down with full data retention• Peripherals

    – One 16-bit Timer/Counter Type A (TCA) with a dedicated period register and three comparechannels

    – One 16-bit Timer/Counter Type B (TCB) with input capture– One 12-bit Timer/Counter Type D (TCD) optimized for control applications– One 16-bit Real-Time Counter (RTC) running from external crystal or internal RC oscillator– Watchdog Timer (WDT) with Window mode, with a separate on-chip oscillator– One USART with fractional baud rate generator, auto-baud, and start-of-frame detection– One master/slave Serial Peripheral Interface (SPI)– One Two-Wire Interface (TWI) with dual address match

    • Philips I2C compatible• Standard mode (Sm, 100 kHz)• Fast mode (Fm, 400 kHz)• Fast mode plus (Fm+, 1 MHz)

    – One Analog Comparator (AC) with a low propagation delay– One 10-bit 115 ksps Analog-to-Digital Converter (ADC)– One 8-bit Digital-to-Analog Converter (DAC)– Multiple voltage references (VREF):

    • 0.55V• 1.1V• 1.5V• 2.5V• 4.3V

    – Event System (EVSYS) for CPU independent and predictable inter-peripheral signaling– Configurable Custom Logic (CCL) with two programmable look-up tables– Automated CRC memory scan (CRCSCAN)– Peripheral Touch Controller (PTC)(1)

    • Capacitive touch buttons, sliders, wheels and 2D surfaces• Wake-up on touch• Driven shield for improved moisture and noise handling performance• Up to six self capacitance channels• Up to nine mutual capacitance channels

    – External interrupt on all general purpose pins• I/O and Packages:

    – 12/18/22 programmable I/O lines– 14-pin SOIC150– 20-pin VQFN 3x3 mm with wettable flanks– 20-pin SOIC300– 24-pin VQFN 4x4 mm with wettable flanks

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 2

  • • Temperature Ranges:– -40°C to 105°C– -40°C to 125°C

    • Speed Grades:– 0-8 MHz @ 2.7V – 5.5V– 0-16 MHz @ 4.5V – 5.5V

    Note: 1. Only available in devices with 8 KB Flash.

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 3

  • Table of Contents

    Introduction......................................................................................................................1

    Features.......................................................................................................................... 1

    1. Silicon Errata and Data Sheet Clarification Document............................................ 11

    2. tinyAVR® 1-series Overview....................................................................................122.1. Configuration Summary..............................................................................................................12

    3. Block Diagram......................................................................................................... 14

    4. Pinout...................................................................................................................... 174.1. 14-Pin SOIC............................................................................................................................... 174.2. 20-Pin SOIC............................................................................................................................... 184.3. 20-Pin VQFN..............................................................................................................................194.4. 24-Pin VQFN..............................................................................................................................20

    5. I/O Multiplexing and Considerations........................................................................215.1. Multiplexed Signals.................................................................................................................... 21

    6. Automotive Quality Grade....................................................................................... 22

    7. Memories.................................................................................................................237.1. Overview.................................................................................................................................... 237.2. Memory Map.............................................................................................................................. 247.3. In-System Reprogrammable Flash Program Memory................................................................247.4. SRAM Data Memory.................................................................................................................. 257.5. EEPROM Data Memory............................................................................................................. 257.6. User Row....................................................................................................................................267.7. Signature Bytes..........................................................................................................................267.8. Memory Section Access from CPU and UPDI on Locked Device..............................................267.9. I/O Memory.................................................................................................................................287.10. Configuration and User Fuses (FUSE).......................................................................................30

    8. Peripherals and Architecture................................................................................... 468.1. Peripheral Module Address Map................................................................................................468.2. Interrupt Vector Mapping............................................................................................................478.3. System Configuration (SYSCFG)...............................................................................................49

    9. AVR CPU.................................................................................................................529.1. Features..................................................................................................................................... 529.2. Overview.................................................................................................................................... 529.3. Architecture................................................................................................................................ 529.4. Arithmetic Logic Unit (ALU)........................................................................................................549.5. Functional Description................................................................................................................559.6. Register Summary - CPU...........................................................................................................60

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 4

  • 9.7. Register Description...................................................................................................................60

    10. Nonvolatile Memory Controller (NVMCTRL)........................................................... 6410.1. Features..................................................................................................................................... 6410.2. Overview.................................................................................................................................... 6410.3. Functional Description................................................................................................................6510.4. Register Summary - NVMCTRL.................................................................................................7210.5. Register Description...................................................................................................................72

    11. Clock Controller (CLKCTRL)................................................................................... 8011.1. Features..................................................................................................................................... 8011.2. Overview.................................................................................................................................... 8011.3. Functional Description................................................................................................................8211.4. Register Summary - CLKCTRL..................................................................................................8711.5. Register Description...................................................................................................................87

    12. Sleep Controller (SLPCTRL)................................................................................... 9712.1. Features..................................................................................................................................... 9712.2. Overview.................................................................................................................................... 9712.3. Functional Description................................................................................................................9812.4. Register Summary - SLPCTRL................................................................................................ 10112.5. Register Description.................................................................................................................101

    13. Reset Controller (RSTCTRL).................................................................................10313.1. Features................................................................................................................................... 10313.2. Overview.................................................................................................................................. 10313.3. Functional Description..............................................................................................................10413.4. Register Summary - RSTCTRL................................................................................................10713.5. Register Description.................................................................................................................107

    14. CPU Interrupt Controller (CPUINT)....................................................................... 11014.1. Features................................................................................................................................... 11014.2. Overview...................................................................................................................................11014.3. Functional Description.............................................................................................................. 11214.4. Register Summary - CPUINT................................................................................................... 11914.5. Register Description................................................................................................................. 119

    15. Event System (EVSYS).........................................................................................12415.1. Features................................................................................................................................... 12415.2. Overview.................................................................................................................................. 12415.3. Functional Description..............................................................................................................12715.4. Register Summary - EVSYS.................................................................................................... 12915.5. Register Description.................................................................................................................129

    16. Port Multiplexer (PORTMUX)................................................................................ 13716.1. Overview.................................................................................................................................. 13716.2. Register Summary - PORTMUX.............................................................................................. 13816.3. Register Description.................................................................................................................138

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 5

  • 17. I/O Pin Configuration (PORT)................................................................................14317.1. Features................................................................................................................................... 14317.2. Overview.................................................................................................................................. 14317.3. Functional Description..............................................................................................................14517.4. Register Summary - PORT...................................................................................................... 14917.5. Register Description - Ports..................................................................................................... 14917.6. Register Summary - VPORT.................................................................................................... 16117.7. Register Description - Virtual Ports.......................................................................................... 161

    18. Brown-Out Detector (BOD)....................................................................................16618.1. Features................................................................................................................................... 16618.2. Overview.................................................................................................................................. 16618.3. Functional Description..............................................................................................................16818.4. Register Summary - BOD.........................................................................................................17018.5. Register Description.................................................................................................................170

    19. Voltage Reference (VREF)....................................................................................17719.1. Features................................................................................................................................... 17719.2. Overview.................................................................................................................................. 17719.3. Functional Description..............................................................................................................17719.4. Register Summary - VREF.......................................................................................................17919.5. Register Description.................................................................................................................179

    20. Watchdog Timer (WDT).........................................................................................18220.1. Features................................................................................................................................... 18220.2. Overview.................................................................................................................................. 18220.3. Functional Description..............................................................................................................18420.4. Register Summary - WDT........................................................................................................ 18820.5. Register Description.................................................................................................................188

    21. 16-bit Timer/Counter Type A (TCA).......................................................................19221.1. Features................................................................................................................................... 19221.2. Overview.................................................................................................................................. 19221.3. Functional Description..............................................................................................................19621.4. Register Summary - TCA in Normal Mode (CTRLD.SPLITM=0)............................................. 20621.5. Register Description - Normal Mode........................................................................................ 20621.6. Register Summary - TCA in Split Mode (CTRLD.SPLITM=1)..................................................22621.7. Register Description - Split Mode.............................................................................................226

    22. 16-bit Timer/Counter Type B (TCB).......................................................................24222.1. Features................................................................................................................................... 24222.2. Overview.................................................................................................................................. 24222.3. Functional Description..............................................................................................................24522.4. Register Summary - TCB......................................................................................................... 25322.5. Register Description.................................................................................................................253

    23. 12-Bit Timer/Counter Type D (TCD)...................................................................... 265

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 6

  • 23.1. Features................................................................................................................................... 26523.2. Overview.................................................................................................................................. 26523.3. Functional Description..............................................................................................................26923.4. Register Summary - TCD.........................................................................................................29123.5. Register Description.................................................................................................................291

    24. Real-Time Counter (RTC)......................................................................................31124.1. Features................................................................................................................................... 31124.2. Overview...................................................................................................................................31124.3. RTC Functional Description..................................................................................................... 31424.4. PIT Functional Description....................................................................................................... 31424.5. Events...................................................................................................................................... 31624.6. Interrupts.................................................................................................................................. 31724.7. Sleep Mode Operation............................................................................................................. 31724.8. Synchronization........................................................................................................................31824.9. Configuration Change Protection............................................................................................. 31824.10. Register Summary - RTC.........................................................................................................31924.11. Register Description.................................................................................................................319

    25. Universal Synchronous and Asynchronous Receiver and Transmitter (USART)..33525.1. Features................................................................................................................................... 33525.2. Overview.................................................................................................................................. 33525.3. Functional Description..............................................................................................................33825.4. Register Summary - USART.................................................................................................... 35425.5. Register Description.................................................................................................................354

    26. Serial Peripheral Interface (SPI)............................................................................37326.1. Features................................................................................................................................... 37326.2. Overview.................................................................................................................................. 37326.3. Functional Description..............................................................................................................37626.4. Register Summary - SPI...........................................................................................................38426.5. Register Description.................................................................................................................384

    27. Two-Wire Interface (TWI)...................................................................................... 39127.1. Features................................................................................................................................... 39127.2. Overview.................................................................................................................................. 39127.3. Functional Description..............................................................................................................39327.4. Register Summary - TWI..........................................................................................................40727.5. Register Description.................................................................................................................407

    28. Cyclic Redundancy Check Memory Scan (CRCSCAN)........................................ 42528.1. Features................................................................................................................................... 42528.2. Overview.................................................................................................................................. 42528.3. Functional Description..............................................................................................................42728.4. Register Summary - CRCSCAN...............................................................................................43028.5. Register Description.................................................................................................................430

    29. Configurable Custom Logic (CCL).........................................................................434

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 7

  • 29.1. Features................................................................................................................................... 43429.2. Overview.................................................................................................................................. 43429.3. Functional Description..............................................................................................................43629.4. Register Summary - CCL......................................................................................................... 44529.5. Register Description.................................................................................................................445

    30. Analog Comparator (AC).......................................................................................45230.1. Features................................................................................................................................... 45230.2. Overview.................................................................................................................................. 45230.3. Functional Description..............................................................................................................45430.4. Register Summary - AC........................................................................................................... 45630.5. Register Description.................................................................................................................456

    31. Analog-to-Digital Converter (ADC)........................................................................ 46131.1. Features................................................................................................................................... 46131.2. Overview.................................................................................................................................. 46131.3. Functional Description..............................................................................................................46531.4. Register Summary - ADCn.......................................................................................................47331.5. Register Description.................................................................................................................473

    32. Digital-to-Analog Converter (DAC)........................................................................ 49132.1. Features................................................................................................................................... 49132.2. Overview.................................................................................................................................. 49132.3. Functional Description..............................................................................................................49332.4. Register Summary - DAC.........................................................................................................49532.5. Register Description.................................................................................................................495

    33. Peripheral Touch Controller (PTC)........................................................................ 49833.1. Overview.................................................................................................................................. 49833.2. Features................................................................................................................................... 49833.3. Block Diagram..........................................................................................................................49933.4. Signal Description.................................................................................................................... 49933.5. System Dependencies............................................................................................................. 50033.6. Functional Description..............................................................................................................501

    34. Unified Program and Debug Interface (UPDI).......................................................50334.1. Features................................................................................................................................... 50334.2. Overview.................................................................................................................................. 50334.3. Functional Description..............................................................................................................50634.4. Register Summary - UPDI........................................................................................................52634.5. Register Description.................................................................................................................526

    35. Electrical Characteristics....................................................................................... 53735.1. Disclaimer.................................................................................................................................53735.2. Absolute Maximum Ratings .....................................................................................................53735.3. General Operating Ratings ......................................................................................................53835.4. Power Consumption for ATtiny416/417/814/816/817 Automotive............................................53935.5. Wake-Up Time..........................................................................................................................540

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 8

  • 35.6. Power Consumption of Peripherals..........................................................................................54035.7. BOD and POR Characteristics.................................................................................................54135.8. External Reset Characteristics.................................................................................................54235.9. Oscillators and Clocks..............................................................................................................54235.10. I/O Pin Characteristics............................................................................................................. 54435.11. USART..................................................................................................................................... 54535.12. SPI........................................................................................................................................... 54635.13. TWI...........................................................................................................................................54735.14. VREF........................................................................................................................................55035.15. ADC..........................................................................................................................................55135.16. DAC..........................................................................................................................................55335.17. AC............................................................................................................................................ 55435.18. PTC..........................................................................................................................................55535.19. Programming Time...................................................................................................................555

    36. Typical Characteristics...........................................................................................55736.1. Power Consumption.................................................................................................................55736.2. GPIO........................................................................................................................................ 56536.3. VREF Characteristics...............................................................................................................57136.4. BOD Characteristics.................................................................................................................57336.5. ADC Characteristics.................................................................................................................57536.6. AC Characteristics....................................................................................................................58036.7. OSC20M Characteristics..........................................................................................................58436.8. OSCULP32K Characteristics................................................................................................... 58636.9. TWI SDA Hold timing .............................................................................................................. 58736.10. PTC Characteristics................................................................................................................. 588

    37. Ordering Information..............................................................................................59037.1. Product Information..................................................................................................................59037.2. Product Identification System...................................................................................................590

    38. Package Drawings.................................................................................................59238.1. Online Package Drawings........................................................................................................59238.2. 14-Pin SOIC150....................................................................................................................... 59338.3. 20-Pin SOIC300....................................................................................................................... 59738.4. 20-Pin VQFN............................................................................................................................60138.5. 24-Pin VQFN............................................................................................................................605

    39. Thermal Considerations........................................................................................ 60939.1. Thermal Resistance Data.........................................................................................................60939.2. Junction Temperature...............................................................................................................609

    40. Instruction Set Summary....................................................................................... 610

    41. Conventions...........................................................................................................61541.1. Numerical Notation...................................................................................................................61541.2. Memory Size and Type.............................................................................................................61541.3. Frequency and Time.................................................................................................................615

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 9

  • 41.4. Registers and Bits.................................................................................................................... 616

    42. Acronyms and Abbreviations.................................................................................617

    43. Errata.....................................................................................................................62043.1. Errata - ATtiny416/417/814/816/817 Automotive..................................................................... 620

    44. Data Sheet Revision History..................................................................................62144.1. Rev. C - 04/2019...................................................................................................................... 62144.2. Rev. B - 05/2018.......................................................................................................................62244.3. Rev.A - 03/2018........................................................................................................................623

    The Microchip Website................................................................................................624

    Product Change Notification Service...........................................................................624

    Customer Support....................................................................................................... 624

    Microchip Devices Code Protection Feature............................................................... 624

    Legal Notice.................................................................................................................625

    Trademarks................................................................................................................. 625

    Quality Management System...................................................................................... 626

    Worldwide Sales and Service......................................................................................627

    ATtiny416/417/814/816/817 Automotiv...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 10

  • 1. Silicon Errata and Data Sheet Clarification DocumentOur intention is to provide our customers with the best documentation possible to ensure successful useof Microchip products. Between data sheet updates, a Silicon Errata and Data Sheet ClarificationDocument will contain the most recent information for the data sheet. The ATtiny416/417/814/816/817Automotive Silicon Errata and Data Sheet Clarification Document is available at the device product pageon https://www.microchip.com.

    ATtiny416/417/814/816/817 Automotiv...Silicon Errata and Data Sheet Clarification ...

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 11

    http://www.microchip.com/mymicrochip/filehandler.aspx?ddocname=en610553http://www.microchip.com/mymicrochip/filehandler.aspx?ddocname=en610553https://www.microchip.com

  • 2. tinyAVR® 1-series OverviewThe figure below shows the tinyAVR® 1-series devices, laying out pin count variants and memory sizes:

    • Vertical migration upwards is possible without code modification, as these devices are pin compatibleand provide the same or more features. Downward migration may require code modification due tofewer available instances of some peripherals.

    • Horizontal migration to the left reduces the pin count and therefore, the available features.

    Figure 2-1. tinyAVR® 1-series Overview

    16 KB

    8 KB

    4 KB

    2 KB

    8 14 20 24Pins

    Flash

    ATtiny816 ATtiny817

    ATtiny417

    ATtiny1616 ATtiny1617

    ATtiny416

    32 KB ATtiny3217

    ATtiny1614

    ATtiny3216

    ATtiny814

    ATtiny414ATtiny412

    ATtiny212 ATtiny214

    Devices with different Flash memory size typically also have different SRAM and EEPROM.

    Related Links7. Memories

    2.1 Configuration Summary

    2.1.1 Peripheral SummaryTable 2-1. Peripheral Summary

    ATtin

    y416

    ATtin

    y417

    ATtin

    y814

    ATtin

    y816

    ATtin

    y817

    Pins 20 24 14 20 24SRAM 256B 256B 512B 512B 512BFlash 4 KB 4 KB 8 KB 8 KB 8 KBEEPROM 128B 128B 128B 128B 128BMax. frequency (MHz) 16 16 16 16 1616-bit Timer/Counter type A (TCA) 1 1 1 1 116-bit Timer/Counter type B (TCB) 1 1 1 1 1

    ATtiny416/417/814/816/817 Automotiv...tinyAVR® 1-series Overview

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 12

  • ...........continued

    ATtin

    y416

    ATtin

    y417

    ATtin

    y814

    ATtin

    y816

    ATtin

    y817

    12-bit Timer/Counter type D (TCD) No 1 1 1 1Real-Time Counter (RTC) 1 1 1 1 1USART 1 1 1 1 1SPI 1 1 1 1 1TWI (I2C) 1 1 1 1 1ADC 1 1 1 1 1ADC channels 12 12 10 12 12DAC 1 1 1 1 1AC 1 1 1 1 1Peripheral Touch Controller (PTC)(1) No No 1 1 1PTC number of self capacitance channels(1) - - 6 6 6PTC number of mutual capacitance channels(1) - - 9 9 9Configurable Custom Logic 1 1 1 1 1Window Watchdog 1 1 1 1 1Event System channels 6 6 6 6 6General purpose I/O 18 22 12 18 22External interrupts 18 22 12 18 22CRCSCAN 1 1 1 1 1

    Note: 1. The PTC takes control over the ADC while the PTC is used.

    ATtiny416/417/814/816/817 Automotiv...tinyAVR® 1-series Overview

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 13

  • 3. Block DiagramFigure 3-1. ATtiny416/ATtiny417 Automotive Block Diagram

    IN/OUT

    DATABUS

    Clock generation

    BUS Matrix

    USART0

    SPI0

    CCL

    AC0

    ADC0

    TCA0

    TCB0

    AINP0AINN0

    OUT

    AIN[11:0]

    WO[5:0]

    RXDTXDXCK

    XDIR

    MISOMOSISCK

    SS

    PORTS

    System Management

    SLPCTRL

    RSTCTRL

    CLKCTRL

    EVENT

    ROUTING

    NETWORK

    DATABUS

    UPDICRC

    SRAM

    NVMCTRL

    Flash

    EEPROM

    OSC20M

    OSC32K

    Detectors/references

    BOD/VLM

    POR

    Bandgap

    WDT

    RTC

    CPUINT

    M M

    S

    MS

    S

    RST

    S

    EXTCLK

    LUTn-IN[2:0]LUTn-OUT

    WO

    CLKOUT

    PA[7:0]PB[5:0]PC[3:0]

    GPIOR

    TWI0SDASCL

    TCD0WO[A,B,C,D]

    XOSC32k

    TOSC2

    TOSC1

    To detectors

    UPDI / RESET

    EVSYS EVOUT[n:0]

    DAC0OUT

    CPUOCD

    ATtiny416/417/814/816/817 Automotiv...Block Diagram

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 14

  • Figure 3-2. ATtiny814 Automotive Block Diagram

    AIN[11:0] X[5:0] Y[5:0]

    IN/OUT

    DATABUS

    Clock generation

    BUS Matrix

    USART0

    SPI0

    CCL

    AC0

    ADC0 / PTC

    TCA0

    TCB0

    AINP0AINN0

    OUT

    WO[5:0]

    RXDTXDXCK

    XDIR

    MISOMOSISCK

    SS

    PORTS

    System Management

    SLPCTRL

    RSTCTRL

    CLKCTRL

    EVENT

    ROUTING

    NETWORK

    DATABUS

    UPDICRC

    SRAM

    NVMCTRL

    Flash

    EEPROM

    OSC20M

    OSC32K

    Detectors/references

    BOD/VLM

    POR

    Bandgap

    WDT

    RTC

    CPUINT

    M M

    S

    MS

    S

    RST

    S

    EXTCLK

    LUTn-IN[2:0]LUTn-OUT

    WO

    PA[7:0]PB[3:0]

    GPIOR

    TWI0SDASCL

    TCD0WO[A,B,C,D]

    XOSC32k

    TOSC2

    TOSC1

    To detectors

    UPDI / RESET

    EVSYS EVOUT[n:0]

    DAC0OUT

    CPUOCD

    ATtiny416/417/814/816/817 Automotiv...Block Diagram

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 15

  • Figure 3-3. ATtiny816/817 Automotive Block Diagram

    AIN[11:0] X[5:0] Y[5:0]

    IN/OUT

    DATABUS

    Clock generation

    BUS Matrix

    USART0

    SPI0

    CCL

    AC0

    ADC0 / PTC

    TCA0

    TCB0

    AINP0AINN0

    OUT

    WO[5:0]

    RXDTXDXCK

    XDIR

    MISOMOSISCK

    SS

    PORTS

    System Management

    SLPCTRL

    RSTCTRL

    CLKCTRL

    EVENT

    ROUTING

    NETWORK

    DATABUS

    UPDICRC

    SRAM

    NVMCTRL

    Flash

    EEPROM

    OSC20M

    OSC32K

    Detectors/references

    BOD/VLM

    POR

    Bandgap

    WDT

    RTC

    CPUINT

    M M

    S

    MS

    S

    RST

    S

    EXTCLK

    LUTn-IN[2:0]LUTn-OUT

    WO

    CLKOUT

    PA[7:0]PB[5:0]PC[3:0]

    GPIOR

    TWI0SDASCL

    TCD0WO[A,B,C,D]

    XOSC32k

    TOSC2

    TOSC1

    To detectors

    UPDI / RESET

    EVSYS EVOUT[n:0]

    DAC0OUT

    CPUOCD

    ATtiny416/417/814/816/817 Automotiv...Block Diagram

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 16

  • 4. Pinout

    4.1 14-Pin SOIC

    1

    2

    3

    4

    5

    6

    7 8

    9

    13

    10

    11

    12

    14VDD GND

    PA1

    PA2

    PA4

    PA5

    PA7

    PA6

    PB0

    PB1

    PA3/EXTCLK

    TOSC

    2

    /PB3

    TOSC

    1

    /PB2

    PA0/RESET/UPDI

    GPIO VDD power domain

    Clock, crystal

    Programming, Debug, ResetInput supply

    Ground

    Analog function

    Digital function only

    ATtiny416/417/814/816/817 Automotiv...Pinout

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 17

  • 4.2 20-Pin SOIC

    1

    2

    3

    4

    5

    6

    7

    13

    11

    12

    14

    VDD GND

    PA1

    PA2

    PA4

    PA5

    PA7

    PA6

    PB0

    8

    9

    10

    15

    20

    19

    18

    17

    16

    PB1

    PB4

    PB5

    PC0

    PC2

    PC3

    PC1

    PA0/RESET/UPDI

    PA3/EXTCLK

    TOSC2/PB3TOSC1

    /PB2

    GPIO VDD power domain

    Clock, crystal

    Programming, Debug, ResetInput supply

    Ground

    Analog function

    Digital function only

    ATtiny416/417/814/816/817 Automotiv...Pinout

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 18

  • 4.3 20-Pin VQFN

    1

    2

    3

    4

    5

    6 7 8

    20 19 18 179

    13

    14

    15

    1610

    11

    12

    PA1

    PA4PA

    7

    PA6

    PB0

    PB1

    PB4

    PB5

    PC2

    PC3

    PA5

    GND

    VDD

    PA2 PC0

    PC1

    PA0/

    RES

    ET/U

    PDI

    PB3/

    TOSC2

    EXTCLK /PA3

    PB2/

    TOSC1

    GPIO VDD power domain

    Clock, crystal

    Programming, Debug, ResetInput supply

    Ground

    Analog function

    Digital function only

    ATtiny416/417/814/816/817 Automotiv...Pinout

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 19

  • 4.4 24-Pin VQFN

    1

    2

    3

    4

    5

    6

    7 8

    24 23 22 21 20 19

    18

    17

    9 10 11 12

    13

    14

    15

    16PA

    1

    PC3

    PC2

    PA2

    PA4

    PA5

    PA7

    PA6

    PC5

    PC4

    PC0

    PC1

    GND

    VDD

    PB4

    PB5

    PB6

    PB7

    PB0

    PB1

    EXTCLK /PA3

    PB3/

    TOSC2PB2/

    TOSC1

    PA0/

    RES

    ET/U

    PDI

    GPIO VDD power domain

    Clock, crystal

    Programming, Debug, ResetInput supply

    Ground

    Analog function

    Digital function only

    ATtiny416/417/814/816/817 Automotiv...Pinout

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 20

  • 5. I/O Multiplexing and Considerations

    5.1 Multiplexed SignalsTable 5-1. PORT Function Multiplexing

    VQFN

    24-

    Pin

    VQFN

    20-

    Pin

    SOIC

    20-

    Pin

    SOIC

    14-

    Pin Pin Name (1,2) Other/Special ADC0 PTC(4) AC0 DAC0 USART0 SPI0 TWI0 TCA0 TCB0 TCD0 CCL

    23 19 16 10 PA0 RESET/ UPDI AIN0 LUT0-IN024 20 17 11 PA1 AIN1 TxD(3) MOSI SDA(3) LUT0-IN11 1 18 12 PA2 EVOUT0 AIN2 RxD(3) MISO SCL(3) LUT0-IN22 2 19 13 PA3 EXTCLK AIN3 XCK(3) SCK WO33 3 20 14 GND4 4 1 1 VDD5 5 2 2 PA4 AIN4 X0/Y0 XDIR(3) SS WO4 WOA LUT0-OUT6 6 3 3 PA5 AIN5 X1/Y1 OUT WO5 WO WOB7 7 4 4 PA6 AIN6 X2/Y2 AINN0 OUT8 8 5 5 PA7 AIN7 X3/Y3 AINP0 LUT1-OUT9 PB710 PB611 9 6 PB5 CLKOUT AIN8 AINP1 WO2(3)

    12 10 7 PB4 AIN9 AINN1 WO1(3) LUT0-OUT(3)

    13 11 8 6 PB3 TOSC1 RxD WO0(3)

    14 12 9 7 PB2 TOSC2, EVOUT1 TxD WO215 13 10 8 PB1 AIN10 X4/Y4 XCK SDA WO116 14 11 9 PB0 AIN11 X5/Y5 XDIR SCL WO017 15 12 PC0 SCK(3) WO(3) WOC18 16 13 PC1 MISO(3) WOD LUT1-OUT(3)

    19 17 14 PC2 EVOUT2 MOSI(3)

    20 18 15 PC3 SS(3) WO3(3) LUT1-IN021 PC4 WO4(3) LUT1-IN122 PC5 WO5(3) LUT1-IN2

    Note: 1. Pin names are of type Pxn, with x being the PORT instance (A, B) and n the pin number. Notation

    for signals is PORTx_PINn. All pins can be used as event input.2. All pins can be used for external interrupt, where pins Px2 and Px6 of each port have full

    asynchronous detection.3. Alternate pin positions. For selecting the alternate positions, refer to the PORTMUX documentation.4. PTC is only available in devices with 8 KB Flash (ATtiny814/ATtiny816/ATtiny817 Automotive).

    Every PTC line can be configured as X- or Y-line.

    ATtiny416/417/814/816/817 Automotiv...I/O Multiplexing and Considerations

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 21

  • 6. Automotive Quality GradeThe devices have been manufactured according to the most stringent requirements of the internationalstandard ISO/TS 16949. This data sheet contains limit values extracted from the results of extensivecharacterization (temperature and voltage).

    The quality and reliability have been verified during regular product qualification as per AEC-Q100 grade1 (–40°C to +125°C) and grade 2 (–40°C to +105°C).

    Table 6-1. Temperature Grade Identification for Automotive Products

    Temperature (°C) Temperature Identifier Comments

    –40 to +125 Z Automotive temperature grade 1

    –40 to +105 B Automotive temperature grade 2

    ATtiny416/417/814/816/817 Automotiv...Automotive Quality Grade

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 22

  • 7. Memories

    7.1 OverviewThe main memories are SRAM data memory, EEPROM data memory, and Flash program memory. Inaddition, the peripheral registers are located in the I/O memory space.

    Table 7-1. Physical Properties of Flash Memory

    Property ATtiny416/ATtiny417Automotive

    ATtiny814/ATtiny816/ATtiny817Automotive

    Size 4 KB 8 KB

    Page size 64B 64B

    Number of pages 64 128

    Start address 0x8000 0x8000

    Table 7-2. Physical Properties of SRAM

    Property ATtiny416/ATtiny417Automotive

    ATtiny814/ATtiny816/ATtiny817Automotive

    Size 256B 512B

    Start address 0x3F00 0x3E00

    Table 7-3. Physical Properties of EEPROM

    Property ATtiny416/ATtiny417Automotive

    ATtiny814/ATtiny816/ATtiny817Automotive

    Size 128B 128B

    Page size 32B 32B

    Number of pages 4 4

    Start address 0x1400 0x1400

    Related Links7.9 I/O Memory

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 23

  • 7.2 Memory MapFigure 7-1. Memory Map: Flash 4/8 KB, Internal SRAM 256/512B, EEPROM 128B

    (Reserved)

    (Reserved)

    NVM I/O Registers and data

    64 I/O Registers

    960 Ext I/O Registers

    0x0000 – 0x003F

    0x0040 – 0x0FFF

    0x1400 - 0x1480EEPROM128B

    Flash code

    0x1000 – 0x13FF

    Internal SRAM256/512B

    0x3F00 (for SRAM 256B)/0x3E00 (for SRAM 512B)

    4/8KB

    0x8FFF (for Flash 4K)/0x9FFF (for Flash 8K)

    0x8000

    0x3FFF

    Flash code4/8KB

    0x0000

    CPU Code space UPDI/CPU Data space

    7.3 In-System Reprogrammable Flash Program MemoryThe ATtiny416/417/814/816/817 Automotive contains 8/4 KB on-chip in-system reprogrammable Flashmemory for program storage. Since all AVR instructions are 16 or 32 bits wide, the Flash is organized as4K x 16. For write protection, the Flash program memory space can be divided into three sections (seethe illustration below): Bootloader section, application code section, and application data section, withrestricted access rights among them.

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 24

  • The Program Counter (PC) is 11/12-bits wide to address the whole program memory. The procedure forwriting Flash memory is described in detail in the documentation of the Nonvolatile Memory Controller(NVMCTRL) peripheral.

    The entire Flash memory is mapped in the memory space and is accessible with normal LD/STinstructions as well as the LPM instruction. For LD/ST instructions, the Flash is mapped from address0x8000. For the LPM instruction, the Flash start address is 0x0000.

    The ATtiny416/417/814/816/817 Automotive also has a CRC peripheral that is a master on the bus.

    Figure 7-2. Flash and the Three SectionsFLASHSTART: 0x8000

    BOOTEND>0: 0x8000+BOOTEND*256

    BO OT

    APPEND>0: 0x8000+APPEND*256

    AP PL ICA TIO NCO DE

    AP PLICA TIO NDA TA

    FLASH

    FLASHENDRelated Links2.1 Configuration Summary10. Nonvolatile Memory Controller (NVMCTRL)

    7.4 SRAM Data MemoryThe 256B/512B SRAM is used for data storage and stack.

    Related Links9. AVR CPU9.5.4 Stack and Stack Pointer

    7.5 EEPROM Data MemoryThe ATtiny416/417/814/816/817 Automotive has 128 bytes of EEPROM data memory, see Memory Mapsection. The EEPROM memory supports single byte read and write. The EEPROM is controlled by theNonvolatile Memory Controller (NVMCTRL).

    Related Links7.2 Memory Map10. Nonvolatile Memory Controller (NVMCTRL)

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 25

  • 7.6 User RowIn addition to the EEPROM, the ATtiny416/417/814/816/817 Automotive has one extra page of EEPROMmemory that can be used for firmware settings, the User Row (USERROW). This memory supports singlebyte read and write as the normal EEPROM. The CPU can write and read this memory as normalEEPROM and the UPDI can write and read it as a normal EEPROM memory if the part is unlocked. TheUser Row can be written by the UPDI when the part is locked. USERROW is not affected by a chip erase.

    Related Links7.2 Memory Map10. Nonvolatile Memory Controller (NVMCTRL)34. Unified Program and Debug Interface (UPDI)

    7.7 Signature BytesAll tinyAVR® microcontrollers have a 3-byte signature code that identifies the device. The three bytesreside in a separate address space. For the device, the signature bytes are given in the following table.

    Note:  When the device is locked, only the System Information Block (SIB) can be accessed.

    Table 7-4. Device ID

    Device Name Signature Bytes Address

    0x00 0x01 0x02

    ATtiny417 0x1E 0x92 0x20

    ATtiny416 0x1E 0x92 0x28

    ATtiny817 0x1E 0x93 0x20

    ATtiny816 0x1E 0x93 0x21

    ATtiny814 0x1E 0x93 0x22

    Related Links34.3.6 System Information Block

    7.8 Memory Section Access from CPU and UPDI on Locked DeviceThe device can be locked so that the memories cannot be read using the UPDI. The locking protects boththe Flash (all BOOT, APPCODE, and APPDATA sections), SRAM, and the EEPROM including the FUSEdata. This prevents successful reading of application data or code using the debugger interface. Regularmemory access from within the application still is enabled.

    The device is locked by writing any non-valid value to the LOCKBIT bit field in FUSE.LOCKBIT.

    Table 7-5. Memory Access in Unlocked Mode (FUSE.LOCKBIT Valid)(1)

    Memory Section CPU Access UPDI Access

    Read Write Read Write

    SRAM Yes Yes Yes Yes

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 26

  • ...........continuedMemory Section CPU Access UPDI Access

    Read Write Read Write

    Registers Yes Yes Yes Yes

    Flash Yes Yes Yes Yes

    EEPROM Yes Yes Yes Yes

    USERROW Yes Yes Yes Yes

    SIGROW Yes No Yes No

    Other Fuses Yes No Yes Yes

    Table 7-6. Memory Access in Locked Mode (FUSE.LOCKBIT Invalid)(1)

    Memory Section CPU Access UPDI Access

    Read Write Read Write

    SRAM Yes Yes No No

    Registers Yes Yes No No

    Flash Yes Yes No No

    EEPROM Yes No No No

    USERROW Yes Yes No Yes(2)

    SIGROW Yes No No No

    Other Fuses Yes No No No

    Note: 1. Read operations marked No in the tables may appear to be successful, but the data is corrupt.

    Hence, any attempt of code validation through the UPDI will fail on these memory sections.2. In Locked mode, the USERROW can be written blindly using the fuse Write command, but the

    current USERROW values cannot be read out.

    Important:  The only way to unlock a device is a CHIPERASE, which will erase all devicememories to factory default so that no application data is retained.

    Related Links7.10.3 Fuse Summary - FUSE7.10.4.9 LOCKBIT34. Unified Program and Debug Interface (UPDI)34.3.7 Enabling of KEY Protected Interfaces

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 27

  • 7.9 I/O MemoryAll ATtiny416/417/814/816/817 Automotive I/Os and peripherals are located in the I/O memory space.The I/O address range from 0x00 to 0x3F can be accessed in a single cycle using IN and OUTinstructions. The extended I/O memory space from 0x0040 - 0x0FFF can be accessed by theLD/LDS/LDD and ST/STS/STD instructions, transferring data between the 32 general purpose workingregisters and the I/O memory space.

    I/O registers within the address range 0x00 - 0x1F are directly bit accessible using the SBI and CBIinstructions. In these registers, the value of single bits can be checked by using the SBIS and SBICinstructions. Refer to the Instruction Set section for more details.

    For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved I/Omemory addresses should never be written.

    Some of the interrupt flags are cleared by writing a '1' to them. On ATtiny416/417/814/816/817Automotive devices, the CBI and SBI instructions will only operate on the specified bit, and can be usedon registers containing such interrupt flags. The CBI and SBI instructions work with registers 0x00 - 0x1Fonly.

    General Purpose I/O RegistersThe ATtiny416/417/814/816/817 Automotive devices provide four general purpose I/O registers. Theseregisters can be used for storing any information, and they are particularly useful for storing globalvariables and interrupt flags. general purpose I/O registers, which reside in the address range 0x1C -0x1F, are directly bit accessible using the SBI, CBI, SBIS, and SBIC instructions.Related Links7.2 Memory Map8.1 Peripheral Module Address Map40. Instruction Set Summary

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 28

  • 7.9.1 Register Summary - GPIOR

    Offset Name Bit Pos.

    0x00 GPIOR0 7:0 GPIOR[7:0]0x01 GPIOR1 7:0 GPIOR[7:0]0x02 GPIOR2 7:0 GPIOR[7:0]0x03 GPIOR3 7:0 GPIOR[7:0]

    7.9.2 Register Description - GPIOR

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 29

  • 7.9.2.1 General Purpose I/O Register n

    Name:  GPIOROffset:  0x00 + n*0x01 [n=0..3]Reset:  0x00Property:  -

    These are general purpose registers that can be used to store data, such as global variables and flags, inthe bit accessible I/O memory space.

    Bit 7 6 5 4 3 2 1 0 GPIOR[7:0]

    Access R/W R/W R/W R/W R/W R/W R/W R/W Reset 0 0 0 0 0 0 0 0

    Bits 7:0 – GPIOR[7:0] GPIO Register byte

    7.10 Configuration and User Fuses (FUSE)Fuses are part of the nonvolatile memory and hold factory calibration data and device configuration. Thefuses are available from device power-up. The fuses can be read by the CPU or the UPDI, but can onlybe programmed or cleared by the UPDI. The configuration and calibration values stored in the fuses arewritten to their respective target registers at the end of the start-up sequence.

    The content of the Signature Row fuses (SIGROW) is pre-programmed and cannot be altered. SIGROWholds information such as device ID, serial number, and calibration values.

    The fuses for peripheral configuration (FUSE) are pre-programmed but can be altered by the user.Altered values in the configuration fuse will be effective only after a Reset.Note:  When writing the fuses write all reserved bits to ‘1’.

    This device provides a User Row fuse area (USERROW) that can hold application data. The USERROWcan be programmed on a locked device by the UPDI. This can be used for final configuration withouthaving programming or debugging capabilities enabled.

    Related Links7.10.2 Signature Row Description7.10.4 Fuse Description

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 30

  • 7.10.1 SIGROW - Signature Row Summary

    Offset Name Bit Pos.

    0x00 DEVICEID0 7:0 DEVICEID[7:0]0x01 DEVICEID1 7:0 DEVICEID[7:0]0x02 DEVICEID2 7:0 DEVICEID[7:0]0x03 SERNUM0 7:0 SERNUM[7:0]0x04 SERNUM1 7:0 SERNUM[7:0]0x05 SERNUM2 7:0 SERNUM[7:0]0x06 SERNUM3 7:0 SERNUM[7:0]0x07 SERNUM4 7:0 SERNUM[7:0]0x08 SERNUM5 7:0 SERNUM[7:0]0x09 SERNUM6 7:0 SERNUM[7:0]0x0A SERNUM7 7:0 SERNUM[7:0]0x0B SERNUM8 7:0 SERNUM[7:0]0x0C SERNUM9 7:0 SERNUM[7:0]0x0D

    ...0x21

    Reserved

    0x22 OSC16ERR3V 7:0 OSC16ERR3V[7:0]0x23 OSC16ERR5V 7:0 OSC16ERR5V[7:0]

    7.10.2 Signature Row Description

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 31

  • 7.10.2.1 Device ID n

    Name:  DEVICEIDnOffset:  0x00 + n*0x01 [n=0..2]Reset:  [Device ID]Property:  -

    Each device has a device ID identifying the device and its properties; such as memory sizes, pin count,and die revision. This can be used to identify a device and hence, the available features by software. TheDevice ID consists of three bytes: SIGROW.DEVICEID[2:0].

    Bit 7 6 5 4 3 2 1 0 DEVICEID[7:0]

    Access R R R R R R R R Reset x x x x x x x x

    Bits 7:0 – DEVICEID[7:0] Byte n of the Device ID

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 32

  • 7.10.2.2 Serial Number Byte n

    Name:  SERNUMnOffset:  0x03 + n*0x01 [n=0..9]Reset:  [device serial number]Property:  -

    Each device has an individual serial number, representing a unique ID. This can be used to identify aspecific device in the field. The serial number consists of ten bytes: SIGROW.SERNUM[9:0].

    Bit 7 6 5 4 3 2 1 0 SERNUM[7:0]

    Access R R R R R R R R Reset x x x x x x x x

    Bits 7:0 – SERNUM[7:0] Serial Number Byte n

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 33

  • 7.10.2.3 OSC16 Error at 3V

    Name:  OSC16ERR3VOffset:  0x22Reset:  [Oscillator frequency error value]Property:  -

    Bit 7 6 5 4 3 2 1 0 OSC16ERR3V[7:0]

    Access R R R R R R R R Reset x x x x x x x x

    Bits 7:0 – OSC16ERR3V[7:0] OSC16 Error at 3VThese registers contain the signed oscillator frequency error value when running at internal 16 MHz at 3V,as measured during production.

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 34

  • 7.10.2.4 OSC16 Error at 5V

    Name:  OSC16ERR5VOffset:  0x23Reset:  [Oscillator frequency error value]Property:  -

    Bit 7 6 5 4 3 2 1 0 OSC16ERR5V[7:0]

    Access R R R R R R R R Reset x x x x x x x x

    Bits 7:0 – OSC16ERR5V[7:0] OSC16 Error at 5VThese registers contain the signed oscillator frequency error value when running at internal 16 MHz at 5V,as measured during production.

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 35

  • 7.10.3 Fuse Summary - FUSE

    Offset Name Bit Pos.

    0x00 WDTCFG 7:0 WINDOW[3:0] PERIOD[3:0]0x01 BODCFG 7:0 LVL[2:0] SAMPFREQ ACTIVE[1:0] SLEEP[1:0]0x02 OSCCFG 7:0 OSCLOCK FREQSEL[1:0]0x03 Reserved 0x04 TCD0CFG 7:0 CMPDEN CMPCEN CMPBEN CMPAEN CMPD CMPC CMPB CMPA0x05 SYSCFG0 7:0 CRCSRC[1:0] RSTPINCFG[1:0] EESAVE0x06 SYSCFG1 7:0 SUT[2:0]0x07 APPEND 7:0 APPEND[7:0]0x08 BOOTEND 7:0 BOOTEND[7:0]0x09 Reserved 0x0A LOCKBIT 7:0 LOCKBIT[7:0]

    7.10.4 Fuse Description

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 36

  • 7.10.4.1 Watchdog Configuration

    Name:  WDTCFGOffset:  0x00Reset:  -Property:  -

    Bit 7 6 5 4 3 2 1 0 WINDOW[3:0] PERIOD[3:0]

    Access R R R R R R R R Reset 0 0 0 0 0 0 0 0

    Bits 7:4 – WINDOW[3:0] Watchdog Window Time-out PeriodThis value is loaded into the WINDOW bit field of the Watchdog Control A register (WDT.CTRLA) duringReset.

    Bits 3:0 – PERIOD[3:0] Watchdog Time-out PeriodThis value is loaded into the PERIOD bit field of the Watchdog Control A register (WDT.CTRLA) duringReset.Related Links20.4 Register Summary - WDT13. Reset Controller (RSTCTRL)

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 37

  • 7.10.4.2 BOD Configuration

    Name:  BODCFGOffset:  0x01Reset:  -Property:  -

    The settings of the BOD will be reloaded from this Fuse after a Power-on Reset. For all other Resets, theBOD configuration remains unchanged.

    Bit 7 6 5 4 3 2 1 0 LVL[2:0] SAMPFREQ ACTIVE[1:0] SLEEP[1:0]

    Access R R R R R R R R Reset 0 0 0 0 0 0 0 0

    Bits 7:5 – LVL[2:0] BOD LevelThis value is loaded into the LVL bit field of the BOD Control B register (BOD.CTRLB) during Reset.Value Name Description0x2 BODLEVEL2 2.6V0x7 BODLEVEL7 4.2V

    Bit 4 – SAMPFREQ BOD Sample FrequencyThis value is loaded into the SAMPFREQ bit of the BOD Control A register (BOD.CTRLA) during Reset.Value Description0x0 Sample frequency is 1 kHz0x1 Sample frequency is 125 Hz

    Bits 3:2 – ACTIVE[1:0] BOD Operation Mode in Active and IdleThis value is loaded into the ACTIVE bit field of the BOD Control A register (BOD.CTRLA) during Reset.Value Description0x0 Disabled0x1 Enabled0x2 Sampled0x3 Enabled with wake-up halted until BOD is ready

    Bits 1:0 – SLEEP[1:0] BOD Operation Mode in SleepThis value is loaded into the SLEEP bit field of the BOD Control A register (BOD.CTRLA) during Reset.Value Description0x0 Disabled0x1 Enabled0x2 Sampled0x3 Reserved

    Related Links18.4 Register Summary - BOD13. Reset Controller (RSTCTRL)

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 38

  • 7.10.4.3 Oscillator Configuration

    Name:  OSCCFGOffset:  0x02Reset:  -Property:  -

    Bit 7 6 5 4 3 2 1 0 OSCLOCK FREQSEL[1:0]

    Access R R R Reset 0 0 1

    Bit 7 – OSCLOCK Oscillator LockThis fuse bit is loaded to LOCK in CLKCTRL.OSC20MCALIBB during Reset.Value Description0 Calibration registers of the OSC20M oscillator are accessible1 Calibration registers of the OSC20M oscillator are locked

    Bits 1:0 – FREQSEL[1:0] Frequency SelectThese bits select the operation frequency of the OSC20M oscillator and determine the respective factorycalibration values to be written to CAL20M in CLKCTRL.OSC20MCALIBA and TEMPCAL20M inCLKCTRL.OSC20MCALIBBValue Description0x1 Run at 16 MHz with corresponding factory calibrationOther Reserved

    Related Links11.4 Register Summary - CLKCTRL13. Reset Controller (RSTCTRL)

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 39

  • 7.10.4.4 Timer Counter Type D Configuration

    Name:  TCD0CFGOffset:  0x04Reset:  -Property:  -

    The bit values of this fuse register are written to the corresponding bits in the TCD.FAULTCTRL registerof TCD0 at start-up.The CMPEN and CMP settings of the TCD will only be reloaded from the FUSE values after a Power-onReset. For all other resets, the corresponding TCD settings of the device will remain unchanged.

    Bit 7 6 5 4 3 2 1 0 CMPDEN CMPCEN CMPBEN CMPAEN CMPD CMPC CMPB CMPA

    Access R R R R R R R R Reset 0 0 0 0 0 0 0 0

    Bits 4, 5, 6, 7 – CMPEN Compare x EnableValue Description0 Compare x output on Pin is disabled1 Compare x output on Pin is enabled

    Bits 0, 1, 2, 3 – CMP Compare xThis bit selects the default state of Compare x after Reset, or when entering debug if FAULTDET is '1'.Value Description0 Compare x default state is 01 Compare x default state is 1

    Related Links23.4 Register Summary - TCD13. Reset Controller (RSTCTRL)

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 40

  • 7.10.4.5 System Configuration 0

    Name:  SYSCFG0Offset:  0x05Reset:  0xC4Property:  -

    Bit 7 6 5 4 3 2 1 0 CRCSRC[1:0] RSTPINCFG[1:0] EESAVE

    Access R R R R R Reset 1 1 0 1 0

    Bits 7:6 – CRCSRC[1:0] CRC SourceSee the CRC description for more information about the functionality.Value Name Description00 FLASH CRC of full Flash (boot, application code and application data)01 BOOT CRC of the boot section10 BOOTAPP CRC of application code and boot sections11 NOCRC No CRC

    Bits 3:2 – RSTPINCFG[1:0] Reset Pin ConfigurationThese bits select the Reset/UPDI pin configuration.Value Description0x0 GPIO0x1 UPDI0x2 RESET0x3 Reserved

    Note:  When configuring the Reset Pin as GPIO, there is a potential conflict between the GPIO activelydriving the output, and a 12V UPDI enable sequence initiation. To avoid this, the GPIO output driver isdisabled for 768 OSC32K cycles after a System Reset. Enable any interrupts for this pin only after thisperiod.

    Bit 0 – EESAVE EEPROM Save During Chip EraseIf the device is locked, the EEPROM is always erased by a chip erase, regardless of this bit.Value Description0 EEPROM erased during chip erase1 EEPROM not erased under chip erase

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 41

  • 7.10.4.6 System Configuration 1

    Name:  SYSCFG1Offset:  0x06Reset:  -Property:  -

    Bit 7 6 5 4 3 2 1 0 SUT[2:0]

    Access R R R Reset 1 1 1

    Bits 2:0 – SUT[2:0] Start-Up Time SettingThese bits select the start-up time between power-on and code execution.Value Description0x0 0 ms0x1 1 ms0x2 2 ms0x3 4 ms0x4 8 ms0x5 16 ms0x6 32 ms0x7 64 ms

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 42

  • 7.10.4.7 Application Code End

    Name:  APPENDOffset:  0x07Reset:  -Property:  -

    Bit 7 6 5 4 3 2 1 0 APPEND[7:0]

    Access R R R R R R R R Reset 0 0 0 0 0 0 0 0

    Bits 7:0 – APPEND[7:0] Application Code Section EndThese bits set the end of the application code section in blocks of 256 bytes. The end of the applicationcode section should be set as BOOT size plus application code size. The remaining Flash will beapplication data. A value of 0x00 defines the Flash from BOOTEND*256 to end of Flash as applicationcode. When both FUSE.APPEND and FUSE.BOOTEND are 0x00, the entire Flash is BOOT section.Related Links10. Nonvolatile Memory Controller (NVMCTRL)10.3.1.1 Flash

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 43

  • 7.10.4.8 Boot End

    Name:  BOOTENDOffset:  0x08Reset:  -Property:  -

    Bit 7 6 5 4 3 2 1 0 BOOTEND[7:0]

    Access R R R R R R R R Reset 0 0 0 0 0 0 0 0

    Bits 7:0 – BOOTEND[7:0] Boot Section EndThese bits set the end of the boot section in blocks of 256 bytes. A value of 0x00 defines the whole Flashas BOOT section. When both FUSE.APPEND and FUSE.BOOTEND are 0x00, the entire Flash is BOOTsection.Related Links10. Nonvolatile Memory Controller (NVMCTRL)10.3.1.1 Flash

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 44

  • 7.10.4.9 Lockbits

    Name:  LOCKBITOffset:  0x0AReset:  -Property:  -

    Bit 7 6 5 4 3 2 1 0 LOCKBIT[7:0]

    Access R/W R/W R/W R/W R/W R/W R/W R/W Reset 0 0 0 0 0 0 0 0

    Bits 7:0 – LOCKBIT[7:0] LockbitsWhen the part is locked, UPDI cannot access the system bus, so it cannot read out anything but CS-space.Value Description0xC5 Valid key - the device is openother Invalid - the device is locked

    Related Links7.8 Memory Section Access from CPU and UPDI on Locked Device

    ATtiny416/417/814/816/817 Automotiv...Memories

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 45

  • 8. Peripherals and Architecture

    8.1 Peripheral Module Address MapThe address map shows the base address for each peripheral. For complete register description andsummary for each peripheral module, refer to the respective module chapters.

    Table 8-1. Peripheral Module Address Map

    Base Address Name Description

    0x0000 VPORTA Virtual Port A

    0x0004 VPORTB Virtual Port B

    0x0008 VPORTC Virtual Port C

    0x001C GPIO General Purpose I/O registers

    0x0030 CPU CPU

    0x0040 RSTCTRL Reset Controller

    0x0050 SLPCTRL Sleep Controller

    0x0060 CLKCTRL Clock Controller

    0x0080 BOD Brown-Out Detector

    0x00A0 VREF Voltage Reference

    0x0100 WDT Watchdog Timer

    0x0110 CPUINT Interrupt Controller

    0x0120 CRCSCAN Cyclic Redundancy Check Memory Scan

    0x0140 RTC Real-Time Counter

    0x0180 EVSYS Event System

    0x01C0 CCL Configurable Custom Logic

    0x0200 PORTMUX Port Multiplexer

    0x0400 PORTA Port A Configuration

    0x0420 PORTB Port B Configuration

    0x0440 PORTC Port C Configuration

    0x0600 ADC0 Analog-to-Digital Converter

    0x0670 AC0 Analog Comparator 0

    0x0680 DAC0 Digital-to-Analog Converter

    0x0800 USART0 Universal Synchronous Asynchronous Receiver Transmitter

    0x0810 TWI0 Two-Wire Interface

    ATtiny416/417/814/816/817 Automotiv...Peripherals and Architecture

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 46

  • ...........continuedBase Address Name Description

    0x0820 SPI0 Serial Peripheral Interface

    0x0A00 TCA0 Timer/Counter Type A instance 0

    0x0A40 TCB0 Timer/Counter Type B instance 0

    0x0A80 TCD0 Timer/Counter Type D instance 0

    0x0F00 SYSCFG System Configuration

    0x1000 NVMCTRL Nonvolatile Memory Controller

    0x1100 SIGROW Signature Row

    0x1280 FUSES Device-specific fuses

    0x1300 USERROW User Row

    8.2 Interrupt Vector MappingEach of the interrupt vectors is connected to one peripheral instance, as shown in the table below. Aperipheral can have one or more interrupt sources, see the Interrupt section in the Functional descriptionof the respective peripheral for more details on the available interrupt sources.

    When the interrupt condition occurs, an Interrupt Flag (nameIF) is set in the Interrupt Flags register of theperipheral (peripheral.INTFLAGS).

    An interrupt is enabled or disabled by writing to the corresponding Interrupt Enable bit (nameIE) in theperipheral's Interrupt Control register (peripheral.INTCTRL).

    The naming of the registers may vary slightly in some peripherals.

    An interrupt request is generated when the corresponding interrupt is enabled and the interrupt flag is set.The interrupt request remains active until the interrupt flag is cleared. See the peripheral's INTFLAGSregister for details on how to clear interrupt flags.

    Interrupts must be enabled globally for interrupt requests to be generated.Table 8-2. Interrupt Vector Mapping

    Vector Number Peripheral Source Definition

    0 RESET RESET

    1 CRCSCAN_NMI NMI - Non-Maskable Interrupt from CRC

    2 BOD_VLM VLM - Voltage Level Monitor

    3 PORTA_PORT PORTA - Port A

    4 PORTB_PORT PORTB - Port B

    5 PORTC_PORT PORTC - Port C

    6 RTC_CNT RTC - Real-Time Counter

    7 RTC_PIT PIT - Periodic Interrupt Timer (in RTC peripheral)

    ATtiny416/417/814/816/817 Automotiv...Peripherals and Architecture

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 47

  • ...........continuedVector Number Peripheral Source Definition

    8 TCA0_LUNF/TCA0_OVF TCA0 - Timer Counter Type A, LUNF/OVF

    9 TCA0_HUNF TCA0, HUNF

    10 TCA0_LCMP0/TCA0_CMP0 TCA0, LCMP0/CMP0

    11 TCA0_LCMP1/TCA0_CMP1 TCA0, LCMP1/CMP1

    12 TCA0_CMP2/TCA0_LCMP2 TCA0, LCMP2/CMP2

    13 TCB0_INT TCB0 - Timer Counter Type B

    14 TCD0_OVF TCD0 - Timer Counter Type D, OVF

    15 TCD0_TRIG TCD0, TRIG

    16 AC0_AC AC0 – Analog Comparator

    17 ADC0_RESRDY ADC0 – Analog-to-Digital Converter, RESRDY

    18 ADC0_WCOMP ADC0, WCOMP

    19 TWI0_TWIS TWI0 - Two-Wire Interface/I2C, TWIS

    20 TWI0_TWIM TWI0, TWIM

    21 SPI0_INT SPI0 - Serial Peripheral Interface

    22 USART0_RXC USART0 - Universal Asynchronous Receiver-Transmitter, RXC

    23 USART0_DRE USART0, DRE

    24 USART0_TXC USART0, TXC

    25 NVMCTRL_EE NVM - Nonvolatile Memory

    Related Links10. Nonvolatile Memory Controller (NVMCTRL)17. I/O Pin Configuration (PORT)24. Real-Time Counter (RTC)26. Serial Peripheral Interface (SPI)25. Universal Synchronous and Asynchronous Receiver and Transmitter (USART)27. Two-Wire Interface (TWI)28. Cyclic Redundancy Check Memory Scan (CRCSCAN)21. 16-bit Timer/Counter Type A (TCA)22. 16-bit Timer/Counter Type B (TCB)23. 12-Bit Timer/Counter Type D (TCD)30. Analog Comparator (AC)31. Analog-to-Digital Converter (ADC)

    ATtiny416/417/814/816/817 Automotiv...Peripherals and Architecture

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 48

  • 8.3 System Configuration (SYSCFG)The system configuration contains the revision ID of the part. The revision ID is readable from the CPU,making it useful for implementing application changes between part revisions.

    ATtiny416/417/814/816/817 Automotiv...Peripherals and Architecture

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 49

  • 8.3.1 Register Summary - SYSCFG

    Offset Name Bit Pos.

    0x01 REVID 7:0 REVID[7:0]

    8.3.2 Register Description - SYSCFG

    ATtiny416/417/814/816/817 Automotiv...Peripherals and Architecture

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 50

  • 8.3.2.1 Device Revision ID Register

    Name:  REVIDOffset:  0x01Reset:  [revision ID]Property:  -

    This register is read-only and displays the device revision ID.

    Bit 7 6 5 4 3 2 1 0 REVID[7:0]

    Access R R R R R R R R Reset

    Bits 7:0 – REVID[7:0] Revision IDThese bits contain the device revision. 0x00 = A, 0x01 = B, and so on.

    ATtiny416/417/814/816/817 Automotiv...Peripherals and Architecture

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 51

  • 9. AVR CPU

    9.1 Features• 8-Bit, High-Performance AVR RISC CPU:

    – 135 instructions– Hardware multiplier

    • 32 8-Bit Registers Directly Connected to the Arithmetic Logic Unit (ALU)• Stack in RAM• Stack Pointer Accessible in I/O Memory Space• Direct Addressing of up to 64 KB of Unified Memory:

    – Entire Flash accessible with all LD/ST instructions• True 16-Bit Access to 16-Bit I/O Registers• Efficient Support for 8-, 16-, and 32-Bit Arithmetic• Configuration Change Protection for System Critical Features

    9.2 OverviewAll AVR devices use the 8-bit AVR CPU. The CPU is able to access memories, perform calculations,control peripherals, and execute instructions in the program memory. Interrupt handling is described in aseparate section.

    Related Links7. Memories10. Nonvolatile Memory Controller (NVMCTRL)14. CPU Interrupt Controller (CPUINT)

    9.3 ArchitectureIn order to maximize performance and parallelism, the AVR CPU uses a Harvard architecture withseparate buses for program and data. Instructions in the program memory are executed with single-levelpipelining. While one instruction is being executed, the next instruction is prefetched from the programmemory. This enables instructions to be executed on every clock cycle.

    ATtiny416/417/814/816/817 Automotiv...AVR CPU

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 52

  • Figure 9-1. AVR CPU Architecture

    Register file

    Flash Program Memory

    Data Memory

    ALU

    R0R1R2R3R4R5R6R7R8R9R10R11R12R13R14R15R16R17R18R19R20R21R22R23R24R25

    R26 (XL)R27 (XH)R28 (YL)R29 (YH)R30 (ZL)R31 (ZH)

    Stack Pointer

    Program Counter

    Instruction Register

    Instruction Decode

    STATUS Register

    The Arithmetic Logic Unit (ALU) supports arithmetic and logic operations between registers or between aconstant and a register. Also, single-register operations can be executed in the ALU. After an arithmeticoperation, the STATUS register is updated to reflect information about the result of the operation.

    The ALU is directly connected to the fast-access register file. The 32 8-bit general purpose workingregisters all have single clock cycle access time allowing single-cycle arithmetic logic unit operation

    ATtiny416/417/814/816/817 Automotiv...AVR CPU

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 53

  • between registers or between a register and an immediate. Six of the 32 registers can be used as three16-bit Address Pointers for program and data space addressing, enabling efficient address calculations.

    The program memory bus is connected to Flash, and the first program memory Flash address is 0x0000.

    The data memory space is divided into I/O registers, SRAM, EEPROM, and Flash.

    All I/O Status and Control registers reside in the lowest 4 KB addresses of the data memory. This isreferred to as the I/O memory space. The lowest 64 addresses are accessed directly with single-cycleIN/OUT instructions, or as the data space locations from 0x00 to 0x3F. These addresses can be accessedusing load (LD/LDS/LDD) and store (ST/STS/STD) instructions. The lowest 32 addresses can even beaccessed with single-cycle SBI/CBI instructions and SBIS/SBIC instructions. The rest is the extendedI/O memory space, ranging from 0x0040 to 0x0FFF. The I/O registers here must be accessed as dataspace locations using load and store instructions.

    Data addresses 0x1000 to 0x1800 are reserved for memory mapping of fuses, the NVM controller andEEPROM. The addresses from 0x1800 to 0x7FFF are reserved for other memories, such as SRAM.

    The Flash is mapped in the data space from 0x8000 and above. The Flash can be accessed with all loadand store instructions by using addresses above 0x8000. The LPM instruction accesses the Flash similarto the code space, where the Flash starts at address 0x0000.

    For a summary of all AVR instructions, refer to the Instruction Set Summary section. For details of all AVRinstructions, refer to http://www.microchip.com/design-centers/8-bit.

    Related Links10. Nonvolatile Memory Controller (NVMCTRL)7. Memories40. Instruction Set Summary

    9.4 Arithmetic Logic Unit (ALU)The Arithmetic Logic Unit (ALU) supports arithmetic and logic operations between registers, or between aconstant and a register. Also, single-register operations can be executed.

    The ALU operates in direct connection with all 32 general purpose registers. Arithmetic operationsbetween general purpose registers or between a register and an immediate are executed in a single clockcycle, and the result is stored in the register file. After an arithmetic or logic operation, the Status register(CPU.SREG) is updated to reflect information about the result of the operation.

    ALU operations are divided into three main categories – arithmetic, logical, and bit functions. Both 8- and16-bit arithmetic are supported, and the instruction set allows for efficient implementation of 32-bitarithmetic. The hardware multiplier supports signed and unsigned multiplication and fractional format.

    9.4.1 Hardware MultiplierThe multiplier is capable of multiplying two 8-bit numbers into a 16-bit result. The hardware multipliersupports different variations of signed and unsigned integer and fractional numbers:

    • Multiplication of signed/unsigned integers• Multiplication of signed/unsigned fractional numbers• Multiplication of a signed integer with an unsigned integer• Multiplication of a signed fractional number with an unsigned one

    A multiplication takes two CPU clock cycles.

    ATtiny416/417/814/816/817 Automotiv...AVR CPU

    © 2019 Microchip Technology Inc. Complete Datasheet 40002014C-page 54

    http://www.microchip.com/design-centers/8-bit

  • 9.5 Functional Description

    9.5.1 Program FlowAfter Reset, the CPU will execute instructions from the lowest address in the Flash program memory,0x0000. The Program Counter (PC) addresses the next instruction to be fetched.

    Program flow is supported by conditional and unconditional JUMP and CALL instructions, capable ofaddressing the whole address space directly. Most AVR instructions use a 16-bit word format, and alimited number use a 32-bit format.

    During interrupts and subroutine calls, the return address PC is stored on the stack as a word pointer.The stack is allocated in the general data SRAM, and consequently, the stack size is only limited by thetotal SRAM size and the usage of the SRAM. After Reset, the Stack Point