AVR538: Migrating from ATtiny2313 to ATtiny4313

AVR538: Migrating from ATtiny2313 to
ATtiny4313
8-bit
Microcontrollers
1 Introduction
The ATtiny4313 is an extension to the Atmel® tinyAVR® product family of lowpower, high-performance microcontrollers featuring the award winning Atmel
picoPower® technology. The ATtiny4313 is a new device in the 20-pin tinyAVR
family. It is code and pin-compatible with the ATtiny2313 (and with ATtiny2313A)
making end product upgrading fast and easy.
Application Note
The new 4K Flash version, ATtiny4313, expands Atmel’s product offering by giving
customers an easy upgrade path in applications where more code space is
required. On the same PCB more software features and refinements can be added
for product differentiation. This adds the end product value with minimum additional
cost. Atmel’s picoPower technology helps make the end application and product
more environment friendly with no tradeoffs in performance or features.
This application note outlines the differences between the two devices, ATtiny2313
and ATtiny4313, and the datasheets. There is also a detailed change log to assist
the user at the end of the ATtiny4313 datasheet.
Remember to always use the latest revision of the device datasheet.
Minor differences in typical characteristics are not discussed in this document as
long as the low and high limits remain the same. For detailed information about the
typical characteristics, see sections “Electrical Characteristics” and “Typical
Characteristics” of the device datasheets.
Note: This application note serves as a guide to ease migration. For complete
device details, always refer to the most recent version of the ATtiny4313 data
sheet.
Rev. 8283A-AVR-06/10
2 Changes in Characteristics
This section outlines such differences in characteristics that may have an effect on
the application in which the device is used. For detailed information, refer to the most
recent version of the device data sheets.
2.1 Current Consumption
Active and Idle mode current consumption of the device have been reduced. The
table below present typical current consumption figures at room temperature. All
values are taken from device datasheets.
Table 2-1. Typical Current Consumption of Device at Room Temperature
Mode
Active
Idle
Condition
ATtiny2313
ATtiny4313
Change
VCC = 2 V, f = 1 MHz
250 µA
200 µA
-20 %
VCC = 3 V, f = 4 MHz
1.5 mA
1.3 mA
-13 %
VCC = 5 V, f = 8 MHz
5 mA
3.9 mA
-22 %
VCC = 2 V, f = 1 MHz
80 µA
30 µA
-62 %
VCC = 3 V, f = 4 MHz
410 µA
250 µA
-39 %
VCC = 5 V, f = 8 MHz
1.6 mA
1.0 mA
-38 %
2.2 Reset
The table below summarizes the differences between the reset circuitry of ATtiny2313
and that of ATtiny4313.
Table 2-2. Changes in Power-On Reset
ATtiny2313
Symbol
Min
Max
Unit
Min
Typ
Max
VPOR
1.2
1.1
1.4
1.6
V
VPOA
1.1
0.6
1.3
1.6
V
0.01
-
-
V/ms
SRON
2
Typ
ATtiny4313
AVR538
8283A-AVR-06/10
AVR538
3 New or Updated Bits and Registers
In Table 3-1 are listed registers and bits that have been added or changed to the
device as a result of functional enhancements. Some bits were marked as reserved in
ATtiny2313 and some bits have another use in ATtiny4313.
Table 3-1. New or Updated Bits and Registers in ATtiny4313
Addr.
Name
0x07
BODCR
0x06
PRR
0x05
PCMSK2
0x04
PCMSK1
0x03
UCSRC
0x00
USIBR
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
PRTIM1
Bit 2
PRTIM0
Bit 1
Bit 0
BODS
BODSE
PRUSI PRUSART
PCINT17 PCINT16 PCINT15 PCINT14 PCINT13 PCINT12 PCINT11
PCINT10
PCINT9
PCINT8
UMSEL1 UMSEL0
USI Buffer Register
Table 3-2 lists interrupt vectors that have been added to ATtiny4313. Depending on
how the firmware is constructed the below additions may have an effect on the start
address of the program.
Table 3-2. New Interrupt Vectors in ATtiny4313
Vector
Address
Source
20
0x013
Pin Change Interrupt Request A
21
0x014
Pin Change Interrupt Request D
For more details on the functional enhancements, see ATtiny4313 datasheet.
4 Datasheet Changes
For a summary of changes, see the revision history at the end of the ATtiny4313 data
sheet.
5 Revision History
Revision No.
History
8283A-AVR-06/10
Initial revision
3
8283A-AVR-06/10
Disclaimer
Headquarters
International
Atmel Corporation
2325 Orchard Parkway
San Jose, CA 95131
USA
Tel: 1(408) 441-0311
Fax: 1(408) 487-2600
Atmel Asia
Unit 1-5 & 16, 19/F
BEA Tower, Millennium City 5
418 Kwun Tong Road
Kwun Tong, Kowloon
Hong Kong
Tel: (852) 2245-6100
Fax: (852) 2722-1369
Atmel Europe
Le Krebs
8, Rue Jean-Pierre Timbaud
BP 309
78054 Saint-Quentin-enYvelines Cedex
France
Tel: (33) 1-30-60-70-00
Fax: (33) 1-30-60-71-11
Atmel 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
Technical Support
[email protected]
Sales Contact
www.atmel.com/contacts
Product Contact
Web Site
www.atmel.com
Literature Request
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
CONDITIONS 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. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in,
automotive applications. Atmel’s products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life.
© 2010 Atmel Corporation. All rights reserved. Atmel®, Atmel logo and combinations thereof, AVR®, AVR® logo, tinyAVR®, picoPower® and
others, are the registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be
trademarks of others.
8283A-AVR-06/10