Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
20
Добавлен:
15.03.2016
Размер:
2.11 Mб
Скачать

 

ATmega8515(L)

Table of Contents

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

1

 

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

2

 

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

3

 

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

3

 

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

4

 

AT90S4414/8515 and ATmega8515 Compatibility...............................................

4

 

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

5

 

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

6

 

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

7

 

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

7

 

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

7

 

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

8

 

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

9

 

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

10

 

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

11

 

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

12

 

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

12

 

AVR ATmega8515 Memories ............................................................

15

 

In-System Reprogrammable Flash Program memory ........................................

15

 

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

16

 

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

18

 

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

23

 

External Memory Interface..................................................................................

24

 

XMEM Register Description................................................................................

28

 

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

33

 

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

33

 

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

34

 

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

34

 

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

34

 

Low-frequency Crystal Oscillator ........................................................................

36

 

External RC Oscillator ........................................................................................

37

 

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

38

 

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

39

 

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

40

 

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

41

 

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

41

 

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

42

 

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

42

 

 

i

2512G–AVR–03/05

 

 

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

44

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

49

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

49

Timed Sequences for Changing the Configuration of the Watchdog Timer .......

52

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

53

Interrupt Vectors in ATmega8515.......................................................................

53

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

58

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

58

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

59

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

63

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

74

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

76

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

79

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

79

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

80

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

80

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

81

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

83

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

84

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

88

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

90

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

94

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

96

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

96

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

99

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

102

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

102

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

103

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

105

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

107

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

108

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

116

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

118

Serial Peripheral Interface – SPI.....................................................

125

SS Pin Functionality..........................................................................................

129

Data Modes ......................................................................................................

132

ii ATmega8515(L)

2512G–AVR–03/05

ATmega8515(L)

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

133

Single USART...................................................................................................

133

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

135

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

138

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

139

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

140

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

143

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

146

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

149

Accessing UBRRH/UCSRC Registers..............................................................

151

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

153

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

157

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

162

Boot Loader Support – Read-While-Write Self-Programming.....

164

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

164

Application and Boot Loader Flash Sections ....................................................

164

Read-While-Write and No Read-While-Write Flash Sections...........................

164

Boot Loader Lock bits .......................................................................................

166

Entering the Boot Loader Program ...................................................................

167

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

169

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

170

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

177

Program and Data Memory Lock bits ...............................................................

177

Fuse bits ...........................................................................................................

178

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

179

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

179

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

179

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

180

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

182

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

191

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

191

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

195

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

197

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

197

SPI Timing Characteristics ...............................................................................

198

External Data Memory Timing ..........................................................................

200

ATmega8515 Typical Characteristics ............................................

205

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

237

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

239

 

iii

2512G–AVR–03/05

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

242

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

244

44A ...................................................................................................................

244

40P6 .................................................................................................................

245

44J ....................................................................................................................

246

44M1.................................................................................................................

247

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

248

ATmega8515(L) Rev. B ....................................................................................

248

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

249

Changes from Rev. 2512F-12/03 to Rev. 2512G-03/05 ...................................

249

Changes from Rev. 2512F-12/03 to Rev. 2512E-09/03 ...................................

249

Changes from Rev. 2512D-02/03 to Rev. 2512E-09/03 ...................................

249

Changes from Rev. 2512C-10/02 to Rev. 2512D-02/03...................................

249

Changes from Rev. 2512B-09/02 to Rev. 2512C-10/02 ...................................

249

Changes from Rev. 2512A-04/02 to Rev. 2512B-09/02 ...................................

250

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

i

iv ATmega8515(L)

2512G–AVR–03/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. Other terms and product names may be trademarks of others.

Printed on recycled paper.

2512G–AVR–03/05

Соседние файлы в папке компоненты_общие