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

 

ATmega8535(L)

Table of Contents

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

1

 

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

2

 

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

2

 

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

3

 

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

3

 

AT90S8535 Compatibility .....................................................................................

4

 

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

5

 

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

6

 

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

6

 

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

6

 

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

6

 

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

7

 

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

8

 

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

9

 

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

10

 

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

11

 

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

11

 

AVR ATmega8535 Memories .............................................................

14

 

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

14

 

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

15

 

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

16

 

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

21

 

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

22

 

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

22

 

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

23

 

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

23

 

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

23

 

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

26

 

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

26

 

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

27

 

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

29

 

Timer/Counter Oscillator .....................................................................................

29

 

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

30

 

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

31

 

ADC Noise Reduction Mode ...............................................................................

31

 

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

31

 

Power-save Mode ...............................................................................................

31

 

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

32

 

Extended Standby Mode ....................................................................................

32

 

 

i

2502B–AVR–09/02

 

 

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

33

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

34

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

39

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

39

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

43

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

44

Interrupt Vectors in ATmega8535 .......................................................................

44

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

49

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

49

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

50

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

54

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

63

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

65

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

68

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

68

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

69

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

69

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

70

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

72

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

73

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

77

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

79

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

83

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

85

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

85

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

88

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

91

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

91

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

92

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

94

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

96

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

97

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

105

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

107

8-bit Timer/Counter2 with PWM and Asynchronous Operation ...

114

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

114

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

115

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

116

ii ATmega8535(L)

2502B–AVR–09/02

ATmega8535(L)

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

116

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

118

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

119

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

123

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

125

Asynchronous Operation of the Timer/Counter ................................................

128

Timer/Counter Prescaler...................................................................................

131

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

133

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

137

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

140

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

141

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

141

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

142

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

145

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

146

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

148

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

151

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

154

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

158

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

159

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

160

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

166

Two-wire Serial Interface .................................................................

170

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

170

Two-wire Serial Interface Bus Definition...........................................................

170

Data Transfer and Frame Format .....................................................................

171

Multi-master Bus Systems, Arbitration and Synchronization ............................

173

Overview of the TWI Module ............................................................................

175

TWI Register Description ..................................................................................

177

Using the TWI ...................................................................................................

181

Transmission Modes.........................................................................................

184

Multi-master Systems and Arbitration ...............................................................

197

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

199

Analog Comparator Multiplexed Input ..............................................................

201

Analog-to-Digital Converter.............................................................

202

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

202

Operation ..........................................................................................................

203

Starting a Conversion .......................................................................................

204

Prescaling and Conversion Timing ...................................................................

205

Changing Channel or Reference Selection ......................................................

208

ADC Noise Canceler.........................................................................................

210

 

iii

2502B–AVR–09/02

ADC Conversion Result....................................................................................

214

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

220

Boot Loader Features .......................................................................................

220

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

220

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

220

Boot Loader Lock Bits.......................................................................................

222

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

223

Addressing the Flash during Self-Programming ...............................................

225

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

226

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

233

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

233

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

234

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

235

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

235

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

236

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

238

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

247

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

252

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

254

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

254

Two-wire Serial Interface Characteristics .........................................................

255

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

257

ADC Characteristics – Preliminary Data...........................................................

259

ATmega8535 Typical Characteristics – Preliminary Data.............

260

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

261

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

263

Ordering Information(1) .....................................................................

266

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

267

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

267

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

268

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

269

44M1-A .............................................................................................................

270

Data Sheet Change Log for ATmega8535 ......................................

271

Changes from Rev. 2502A-06/02 to Rev. 2502B-09/02 ...................................

271

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

i

iv ATmega8535(L)

2502B–AVR–09/02

Atmel Headquarters

Atmel Operations

 

Corporate Headquarters

Memory

RF/Automotive

2325 Orchard Parkway

2325 Orchard Parkway

Theresienstrasse 2

San Jose, CA 95131

San Jose, CA 95131

Postfach 3535

TEL 1(408) 441-0311

TEL 1(408) 441-0311

74025 Heilbronn, Germany

FAX 1(408) 487-2600

FAX 1(408) 436-4314

TEL (49) 71-31-67-0

 

 

FAX (49) 71-31-67-2340

Europe

Atmel Sarl

Route des Arsenaux 41 Case Postale 80

CH-1705 Fribourg Switzerland

TEL (41) 26-426-5555 FAX (41) 26-426-5500

Asia

Room 1219

Chinachem Golden Plaza

77 Mody Road Tsimhatsui

East Kowloon

Hong Kong

TEL (852) 2721-9778

FAX (852) 2722-1369

Japan

9F, Tonetsu Shinkawa Bldg.

1-24-8 Shinkawa

Chuo-ku, Tokyo 104-0033

Japan

TEL (81) 3-3523-3551

FAX (81) 3-3523-7581

Microcontrollers

2325 Orchard Parkway

San Jose, CA 95131

TEL 1(408) 441-0311

FAX 1(408) 436-4314

La Chantrerie BP 70602

44306 Nantes Cedex 3, France TEL (33) 2-40-18-18-18

FAX (33) 2-40-18-19-60

ASIC/ASSP/Smart Cards

Zone Industrielle

13106 Rousset Cedex, France

TEL (33) 4-42-53-60-00

FAX (33) 4-42-53-60-01

1150 East Cheyenne Mtn. Blvd.

Colorado Springs, CO 80906

TEL 1(719) 576-3300

FAX 1(719) 540-1759

Scottish Enterprise Technology Park

Maxwell Building

East Kilbride G75 0QR, Scotland

TEL (44) 1355-803-000

FAX (44) 1355-242-743

1150 East Cheyenne Mtn. Blvd.

Colorado Springs, CO 80906

TEL 1(719) 576-3300

FAX 1(719) 540-1759

Biometrics/Imaging/Hi-Rel MPU/ High Speed Converters/RF Datacom

Avenue de Rochepleine BP 123

38521 Saint-Egreve Cedex, France TEL (33) 4-76-58-30-00

FAX (33) 4-76-58-34-80

e-mail literature@atmel.com

Web Site

http://www.atmel.com

© Atmel Corporation 2002.

Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical components in life support devices or systems.

ATMEL® and AVR® are the registered trademarks of Atmel.

Other terms and product names may be the trademarks of others.

Printed on recycled paper.

2502B–AVR–09/02 0M

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