Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AVR / datasheets / attiny_2313.pdf
Скачиваний:
46
Добавлен:
20.03.2015
Размер:
1.86 Mб
Скачать

 

 

ATtiny2313

Table of Contents

Features................................................................................................

1

 

Pin Configurations...............................................................................

2

 

Overview...............................................................................................

2

 

Block Diagram ......................................................................................................

3

 

Pin Descriptions....................................................................................................

5

 

About Code Examples.........................................................................

5

 

Disclaimer.............................................................................................

5

 

AVR CPU Core .....................................................................................

6

 

Introduction ...........................................................................................................

6

 

Architectural Overview..........................................................................................

6

 

ALU – Arithmetic Logic Unit..................................................................................

7

 

Status Register .....................................................................................................

7

 

General Purpose Register File .............................................................................

8

 

Stack Pointer ......................................................................................................

10

 

Instruction Execution Timing...............................................................................

10

 

Reset and Interrupt Handling..............................................................................

11

 

AVR ATtiny2313 Memories ...............................................................

13

 

In-System Reprogrammable Flash Program Memory ........................................

13

 

SRAM Data Memory...........................................................................................

14

 

EEPROM Data Memory......................................................................................

15

 

I/O Memory .........................................................................................................

20

 

System Clock and Clock Options ....................................................

21

 

Clock Systems and their Distribution ..................................................................

21

 

Clock Sources.....................................................................................................

22

 

Default Clock Source ..........................................................................................

22

 

Crystal Oscillator.................................................................................................

22

 

Calibrated Internal RC Oscillator ........................................................................

24

 

External Clock.....................................................................................................

26

 

128 kHz Internal Oscillator..................................................................................

27

 

Power Management and Sleep Modes.............................................

29

 

Idle Mode ............................................................................................................

29

 

Power-down Mode..............................................................................................

30

 

Standby Mode.....................................................................................................

30

 

Minimizing Power Consumption .........................................................................

30

 

System Control and Reset ................................................................

32

 

Internal Voltage Reference .................................................................................

37

 

Watchdog Timer .................................................................................................

38

 

 

i

2543H–AVR–02/05

Interrupts ............................................................................................

43

Interrupt Vectors in ATtiny2313 ..........................................................................

43

I/O-Ports..............................................................................................

45

Introduction .........................................................................................................

45

Ports as General Digital I/O ................................................................................

46

Alternate Port Functions .....................................................................................

50

Register Description for I/O-Ports.......................................................................

57

External Interrupts.............................................................................

58

Pin Change Interrupt Timing...............................................................................

58

8-bit Timer/Counter0 with PWM........................................................

62

Overview.............................................................................................................

62

Timer/Counter Clock Sources.............................................................................

63

Counter Unit........................................................................................................

63

Output Compare Unit..........................................................................................

64

Compare Match Output Unit ...............................................................................

65

Modes of Operation ............................................................................................

66

Timer/Counter Timing Diagrams.........................................................................

71

8-bit Timer/Counter Register Description ...........................................................

73

Timer/Counter0 and Timer/Counter1 Prescalers ............................

80

16-bit Timer/Counter1........................................................................

82

Overview.............................................................................................................

82

Accessing 16-bit Registers .................................................................................

84

Timer/Counter Clock Sources.............................................................................

88

Counter Unit........................................................................................................

88

Input Capture Unit...............................................................................................

89

Output Compare Units ........................................................................................

91

Compare Match Output Unit ...............................................................................

93

Modes of Operation ............................................................................................

94

Timer/Counter Timing Diagrams.......................................................................

102

16-bit Timer/Counter Register Description .......................................................

104

USART ..............................................................................................

111

Overview...........................................................................................................

111

Clock Generation ..............................................................................................

112

Frame Formats .................................................................................................

115

USART Initialization..........................................................................................

116

Data Transmission – The USART Transmitter .................................................

118

Data Reception – The USART Receiver ..........................................................

121

Asynchronous Data Reception .........................................................................

124

Multi-processor Communication Mode .............................................................

128

USART Register Description ............................................................................

129

ii ATtiny2313

2543H–AVR–02/05

ATtiny2313

Examples of Baud Rate Setting........................................................................

134

Universal Serial Interface – USI......................................................

138

Overview...........................................................................................................

138

Functional Descriptions ....................................................................................

139

Alternative USI Usage ......................................................................................

144

USI Register Descriptions.................................................................................

144

Analog Comparator .........................................................................

149

debugWIRE On-chip Debug System ..............................................

151

Features............................................................................................................

151

Overview...........................................................................................................

151

Physical Interface .............................................................................................

151

Software Break Points ......................................................................................

152

Limitations of debugWIRE ................................................................................

152

debugWIRE Related Register in I/O Memory ...................................................

152

Self-Programming the Flash...........................................................

153

Addressing the Flash During Self-Programming ..............................................

154

Memory Programming.....................................................................

158

Program And Data Memory Lock Bits ..............................................................

158

Fuse Bits...........................................................................................................

159

Signature Bytes ................................................................................................

160

Calibration Byte ................................................................................................

160

Page Size .........................................................................................................

160

Parallel Programming Parameters, Pin Mapping, and Commands ..................

161

Serial Programming Pin Mapping .....................................................................

163

Parallel Programming .......................................................................................

163

Serial Downloading...........................................................................................

172

Electrical Characteristics................................................................

177

Absolute Maximum Ratings*.............................................................................

177

DC Characteristics............................................................................................

177

External Clock Drive Waveforms ......................................................................

178

External Clock Drive .........................................................................................

178

Maximum Speed vs. VCC ........................................................................................................................

180

ATtiny2313 Typical Characteristics ...............................................

181

Register Summary ...........................................................................

211

Instruction Set Summary ................................................................

213

Ordering Information.......................................................................

215

 

iii

2543H–AVR–02/05

Packaging Information ....................................................................

216

20P3 .................................................................................................................

216

20S ...................................................................................................................

217

20M1.................................................................................................................

218

Errata ................................................................................................

219

ATtiny2313 Rev B.............................................................................................

219

ATtiny2313 Rev A.............................................................................................

219

Datasheet Revision History ............................................................

220

Changes from Rev. 2514F-08/04 to Rev. 2514G-10/04 ...................................

220

Changes from Rev. 2514F-08/04 to Rev. 2514G-10/04 ...................................

220

Changes from Rev. 2514E-04/04 to Rev. 2514F-08/04 ...................................

220

Changes from Rev. 2514D-03/04 to Rev. 2514E-04/04 ...................................

220

Changes from Rev. 2514C-12/03 to Rev. 2514D-03/04...................................

221

Changes from Rev. 2514B-09/03 to Rev. 2514C-12/03 ...................................

221

Changes from Rev. 2514A-09/03 to Rev. 2514B-09/03 ...................................

221

Table of Contents .................................................................................

i

iv ATtiny2313

2543H–AVR–02/05

Atmel Corporation

Atmel Operations

2325 Orchard Parkway

San Jose, CA 95131, USA

Tel: 1(408) 441-0311

Fax: 1(408) 487-2600

Regional Headquarters

Europe

Atmel Sarl

Route des Arsenaux 41 Case Postale 80 CH-1705 Fribourg Switzerland

Tel: (41) 26-426-5555 Fax: (41) 26-426-5500

Asia

Room 1219

Chinachem Golden Plaza

77 Mody Road Tsimshatsui

East Kowloon

Hong Kong

Tel: (852) 2721-9778

Fax: (852) 2722-1369

Japan

9F, Tonetsu Shinkawa Bldg.

1-24-8 Shinkawa

Chuo-ku, Tokyo 104-0033

Japan

Tel: (81) 3-3523-3551

Fax: (81) 3-3523-7581

Memory

2325 Orchard Parkway

San Jose, CA 95131, USA

Tel: 1(408) 441-0311

Fax: 1(408) 436-4314

Microcontrollers

2325 Orchard Parkway

San Jose, CA 95131, USA

Tel: 1(408) 441-0311

Fax: 1(408) 436-4314

La Chantrerie

BP 70602

44306 Nantes Cedex 3, France

Tel: (33) 2-40-18-18-18

Fax: (33) 2-40-18-19-60

ASIC/ASSP/Smart Cards

Zone Industrielle

13106 Rousset Cedex, France

Tel: (33) 4-42-53-60-00

Fax: (33) 4-42-53-60-01

1150 East Cheyenne Mtn. Blvd.

Colorado Springs, CO 80906, USA

Tel: 1(719) 576-3300

Fax: 1(719) 540-1759

Scottish Enterprise Technology Park

Maxwell Building

East Kilbride G75 0QR, Scotland

Tel: (44) 1355-803-000

Fax: (44) 1355-242-743

RF/Automotive

Theresienstrasse 2

Postfach 3535

74025 Heilbronn, Germany

Tel: (49) 71-31-67-0

Fax: (49) 71-31-67-2340

1150 East Cheyenne Mtn. Blvd.

Colorado Springs, CO 80906, USA

Tel: 1(719) 576-3300

Fax: 1(719) 540-1759

Biometrics/Imaging/Hi-Rel MPU/

High Speed Converters/RF Datacom

Avenue de Rochepleine

BP 123

38521 Saint-Egreve Cedex, France

Tel: (33) 4-76-58-30-00

Fax: (33) 4-76-58-34-80

Literature Requests

www.atmel.com/literature

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 ATMEL’S TERMS AND CONDI-

TIONS OF SALE LOCATED ON ATMEL’S WEB SITE, 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-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN 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 product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.

© Atmel Corporation 2005. All rights reserved. Atmel®, logo and combinations thereof, AVR®, and AVR Studio® are registered trademarks, and Everywhere You AreSM are the trademarks of Atmel Corporation or its subsidiaries. Microsoft®, Windows®, Windows NT®, and Windows XP® are the registered trademarks of Microsoft Corporation. Other terms and product names may be trademarks of others.

Printed on recycled paper.

2543H–AVR–02/05

Соседние файлы в папке datasheets