Doc 2537

3
AVR088: Migrating between ATmega8535 and ATmega16 Introduction This application note is a guide to help current ATmega8535 users convert existing designs to ATmega16. The information given will also help users migrating from ATmega16 to ATmega8535. AT90S8535 users should also read the application note AVR086: Replacing A90S8535 by ATmega8535. In addition to the differences described in this document, the following features are available on ATmega16: JTAG Interface (enabled by default) The electrical characteristics of the two devices are also different. Check the data sheets for detailed information. Memory Sizes Some memories are bigger in the ATmega16. Table 1 is a comparision of the individ- ual memories. The Boot Loader area is also changed. The following must be considered: Flash page size is 64 words instead of 32 words. The No-Read-While-Write section starts at word address 0x1C00 instead of 0xC00. Table 1. Memory Sizes ATmega8535 ATmega16 Flash 8k bytes 16k bytes RAM 512 bytes 1k bytes EEPROM 512 bytes 512 bytes 8-bit Microcontroller Application Note Rev. 2537C–AVR–01/04

description

Doc 2537

Transcript of Doc 2537

Page 1: Doc 2537

8-bit Microcontroller

Application Note

Rev. 2537C–AVR–01/04

AVR088: Migrating between ATmega8535 and ATmega16

IntroductionThis application note is a guide to help current ATmega8535 users convert existingdesigns to ATmega16. The information given will also help users migrating fromATmega16 to ATmega8535. AT90S8535 users should also read the application noteAVR086: Replacing A90S8535 by ATmega8535.

In addition to the differences described in this document, the following features areavailable on ATmega16:

• JTAG Interface (enabled by default)

The electrical characteristics of the two devices are also different. Check the datasheets for detailed information.

Memory SizesSome memories are bigger in the ATmega16. Table 1 is a comparision of the individ-ual memories.

The Boot Loader area is also changed. The following must be considered:

• Flash page size is 64 words instead of 32 words.

• The No-Read-While-Write section starts at word address 0x1C00 instead of0xC00.

Table 1. Memory Sizes

ATmega8535 ATmega16

Flash 8k bytes 16k bytes

RAM 512 bytes 1k bytes

EEPROM 512 bytes 512 bytes

Page 2: Doc 2537

Interrupt Vectors and Relative Jumps/Calls

The ATmega8535 uses 1-word Interrupt Vectors while the ATmega16 uses 2-wordInterrupt Vectors. 1-word Vectors can only contain RJMP instructions, which can notreach the entire 8k word memory range of ATmega16.

Since RJMP/RCALL can only jump 2k words in any direction, it wraps around the startor end of the 4k word Flash of the ATmega8535 to reach the entire memory span. Wrap-ping RJMP/RCALLs must be changed to JMP/CALLs when using the 8k wordATmega16.

The compiler or assembler will take care of most of these differences. It will either usethe correct instruction or issue an error message.

The Interrupt tables are equal.

Fuse Bits Two of the Fuse bits are different. Table 2 shows the Fuse bits.

Miscellaneous The following applies to ATmega16:

• Watchdog Safety Levels not implemented, meaning that the prescaler settings can be changed without the timed sequence used with ATmega8535.

• Watchdog Always On Mode is not implemented.

• Note that if the On-chip Debug System is enabled, the main clock will continue running in all sleep modes. This will contribute significantly to the total current consumption. Therefore the OCDEN fuse should be disabled if not needed.

Table 2. Fuse Bit Locations

Bit # ATmega8535 ATmega16

Fus

e H

igh

Byt

e

7 S8535C OCDEN

6 WDTON JTAGEN

5 SPIEN SPIEN

4 CKOPT CKOPT

3 EESAVE EESAVE

2 BOOTSZ1 BOOTSZ1

1 BOOTSZ0 BOOTSZ0

0 BOOTRST BOOTRST

Fus

e Lo

w B

yte

7 BODLEVEL BODLEVEL

6 BODEN BODEN

5 SUT1 SUT1

4 SUT0 SUT0

3 CKSEL3 CKSEL3

2 CKSEL2 CKSEL2

1 CKSEL1 CKSEL1

0 CKSEL0 CKSEL0

2 AVR088 2537C–AVR–01/04

Page 3: Doc 2537

Printed on recycled paper.

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

Atmel Corporation Atmel Operations

2325 Orchard ParkwaySan Jose, CA 95131, USATel: 1(408) 441-0311Fax: 1(408) 487-2600

Regional Headquarters

EuropeAtmel SarlRoute des Arsenaux 41Case Postale 80CH-1705 FribourgSwitzerlandTel: (41) 26-426-5555Fax: (41) 26-426-5500

AsiaRoom 1219Chinachem Golden Plaza77 Mody Road TsimshatsuiEast KowloonHong KongTel: (852) 2721-9778Fax: (852) 2722-1369

Japan9F, Tonetsu Shinkawa Bldg.1-24-8 ShinkawaChuo-ku, Tokyo 104-0033JapanTel: (81) 3-3523-3551Fax: (81) 3-3523-7581

Memory2325 Orchard ParkwaySan Jose, CA 95131, USATel: 1(408) 441-0311Fax: 1(408) 436-4314

Microcontrollers2325 Orchard ParkwaySan Jose, CA 95131, USATel: 1(408) 441-0311Fax: 1(408) 436-4314

La ChantrerieBP 7060244306 Nantes Cedex 3, FranceTel: (33) 2-40-18-18-18Fax: (33) 2-40-18-19-60

ASIC/ASSP/Smart CardsZone Industrielle13106 Rousset Cedex, FranceTel: (33) 4-42-53-60-00Fax: (33) 4-42-53-60-01

1150 East Cheyenne Mtn. Blvd.Colorado Springs, CO 80906, USATel: 1(719) 576-3300Fax: 1(719) 540-1759

Scottish Enterprise Technology ParkMaxwell BuildingEast Kilbride G75 0QR, Scotland Tel: (44) 1355-803-000Fax: (44) 1355-242-743

RF/AutomotiveTheresienstrasse 2Postfach 353574025 Heilbronn, GermanyTel: (49) 71-31-67-0Fax: (49) 71-31-67-2340

1150 East Cheyenne Mtn. Blvd.Colorado Springs, CO 80906, USATel: 1(719) 576-3300Fax: 1(719) 540-1759

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

Avenue de RochepleineBP 12338521 Saint-Egreve Cedex, FranceTel: (33) 4-76-58-30-00Fax: (33) 4-76-58-34-80

Literature Requestswww.atmel.com/literature

2537C–AVR–01/04

© Atmel Corporation 2003. All rights reserved. Atmel® and combinations thereof, AVR®, and AVR Studio® are the registered trademarks ofAtmel Corporation or its subsidiaries. Microsoft®, Windows®, Windows NT®, and Windows XP® are the registered trademarks of Microsoft Corpo-ration. Other terms and product names may be the trademarks of others