8-Bit Microcontroller With 8K Bytes In-System Programmable Flash AT90S8515
8-Bit Microcontroller With 8K Bytes In-System Programmable Flash AT90S8515
8-Bit Microcontroller With 8K Bytes In-System Programmable Flash AT90S8515
Rev. 0841GS–09/01
2 AT90S8515
0841GS–09/01
AT90S8515
Description The AT90S8515 is a low-power CMOS 8-bit microcontroller based on the AVR RISC
architecture. By executing powerful instructions in a single clock cycle, the AT90S8515
achieves throughputs approaching 1 MIPS per MHz, allowing the system designer to
optimize power consumption versus processing speed.
The AVR core combines a rich instruction set with 32 general-purpose working regis-
ters. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in
3
0841GS–09/01
one clock cycle. The resulting architecture is more code efficient while achieving
throughputs up to ten times faster than conventional CISC microcontrollers.
The AT90S8515 provides the following features: 8K bytes of In-System Programmable
Flash, 512 bytes EEPROM, 512 bytes SRAM, 32 general-purpose I/O lines, 32 general-
purpose working registers, flexible timer/counters with compare modes, internal and
external interrupts, a programmable serial UART, programmable Watchdog Timer with
internal oscillator, an SPI serial port and two software-selectable power-saving modes.
The Idle Mode stops the CPU while allowing the SRAM, timer/counters, SPI port and
interrupt system to continue functioning. The Power-down mode saves the register con-
tents but freezes the oscillator, disabling all other chip functions until the next external
interrupt or hardware reset.
The device is manufactured using Atmel’s high-density nonvolatile memory technology.
The On-chip In-System Programmable Flash allows the program memory to be repro-
grammed In-System through an SPI serial interface or by a conventional nonvolatile
memory programmer. By combining an enhanced RISC 8-bit CPU with In-System Pro-
grammable Flash on a monolithic chip, the Atmel AT90S8515 is a powerful
microcontroller that provides a highly flexible and cost-effective solution to many embed-
ded control applications.
The AT90S8515 AVR is supported with a full suite of program and system development
tools including: C compilers, macro assemblers, program debugger/simulators, in-circuit
emulators and evaluation kits.
Pin Descriptions
GND Ground.
Port A (PA7..PA0) Port A is an 8-bit bi-directional I/O port. Port pins can provide internal pull-up resistors
(selected for each bit). The Port A output buffers can sink 20 mA and can drive LED dis-
plays directly. When pins PA0 to PA7 are used as inputs and are externally pulled low,
they will source current if the internal pull-up resistors are activated. The Port A pins are
tri-stated when a reset condition becomes active, even if the clock is not active.
Port A serves as multiplexed address/data input/output when using external SRAM.
Port B (PB7..PB0) Port B is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port B output
buffers can sink 20 mA. As inputs, Port B pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset
condition becomes active, even if the clock is not active.
Port B also serves the functions of various special features of the AT90S8515 as listed
on page 66.
Port C (PC7..PC0) Port C is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port C output
buffers can sink 20 mA. As inputs, Port C pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset
condition becomes active, even if the clock is not active.
Port C also serves as address output when using external SRAM.
Port D (PD7..PD0) Port D is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port D output
buffers can sink 20 mA. As inputs, Port D pins that are externally pulled low will source
4 AT90S8515
0841GS–09/01
AT90S8515
current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset
condition becomes active, even if the clock is not active.
Port D also serves the functions of various special features of the AT90S8515 as listed
on page 73.
RESET Reset input. A low level on this pin for more than 50 ns will generate a reset, even if the
clock is not running. Shorter pulses are not guaranteed to generate a reset.
XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
ICP ICP is the input pin for the Timer/Counter1 Input Capture function.
OC1B OC1B is the output pin for the Timer/Counter1 Output CompareB function.
ALE ALE is the Address Latch Enable used when the External Memory is enabled. The ALE
strobe is used to latch the low-order address (8 bits) into an address latch during the first
access cycle, and the AD0 - 7 pins are used for data during the second access cycle.
5
0841GS–09/01
Register Summary
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page
$3F ($5F) SREG I T H S V N Z C page 20
$3E ($5E) SPH SP15 SP14 SP13 SP12 SP11 SP10 SP9 SP8 page 21
$3D ($5D) SPL SP7 SP6 SP5 SP4 SP3 SP2 SP1 SP0 page 21
$3C ($5C) Reserved
$3B ($5B) GIMSK INT1 INT0 - - - - - - page 26
$3A ($5A) GIFR INTF1 INTF0 page 26
$39 ($59) TIMSK TOIE1 OCIE1A OCIE1B - TICIE1 - TOIE0 - page 27
$38 ($58) TIFR TOV1 OCF1A OCF1B - ICF1 - TOV0 - page 28
$37 ($57) Reserved
$36 ($56) Reserved
$35 ($55) MCUCR SRE SRW SE SM ISC11 ISC10 ISC01 ISC00 page 29
$34 ($54) Reserved
$33 ($53) TCCR0 - - - - - CS02 CS01 CS00 page 33
$32 ($52) TCNT0 Timer/Counter0 (8 Bits) page 34
... Reserved
$2F ($4F) TCCR1A COM1A1 COM1A0 COM1B1 COM1B0 - - PWM11 PWM10 page 35
$2E ($4E) TCCR1B ICNC1 ICES1 - - CTC1 CS12 CS11 CS10 page 36
$2D ($4D) TCNT1H Timer/Counter1 – Counter Register High Byte page 38
$2C ($4C) TCNT1L Timer/Counter1 – Counter Register Low Byte page 38
$2B ($4B) OCR1AH Timer/Counter1 – Output Compare Register A High Byte page 38
$2A ($4A) OCR1AL Timer/Counter1 – Output Compare Register A Low Byte page 38
$29 ($49) OCR1BH Timer/Counter1 – Output Compare Register B High Byte page 39
$28 ($48) OCR1BL Timer/Counter1 – Output Compare Register B Low Byte page 39
... Reserved
$25 ($45) ICR1H Timer/Counter1 – Input Capture Register High Byte page 39
$24 ($44) ICR1L Timer/Counter1 – Input Capture Register Low Byte page 39
... Reserved
$21 ($41) WDTCR - - - WDTOE WDE WDP2 WDP1 WDP0 page 42
$20 ($40) Reserved
$1F ($3F) EEARH - - - - - - - EEAR8 page 44
$1E ($3E) EEARL EEPROM Address Register Low Byte page 44
$1D ($3D) EEDR EEPROM Data Register page 44
$1C ($3C) EECR - - - - - EEMWE EEWE EERE page 44
$1B ($3B) PORTA PORTA7 PORTA6 PORTA5 PORTA4 PORTA3 PORTA2 PORTA1 PORTA0 page 63
$1A ($3A) DDRA DDA7 DDA6 DDA5 DDA4 DDA3 DDA2 DDA1 DDA0 page 63
$19 ($39) PINA PINA7 PINA6 PINA5 PINA4 PINA3 PINA2 PINA1 PINA0 page 63
$18 ($38) PORTB PORTB7 PORTB6 PORTB5 PORTB4 PORTB3 PORTB2 PORTB1 PORTB0 page 65
$17 ($37) DDRB DDB7 DDB6 DDB5 DDB4 DDB3 DDB2 DDB1 DDB0 page 65
$16 ($36) PINB PINB7 PINB6 PINB5 PINB4 PINB3 PINB2 PINB1 PINB0 page 65
$15 ($35) PORTC PORTC7 PORTC6 PORTC5 PORTC4 PORTC3 PORTC2 PORTC1 PORTC0 page 70
$14 ($34) DDRC DDC7 DDC6 DDC5 DDC4 DDC3 DDC2 DDC1 DDC0 page 71
$13 ($33) PINC PINC7 PINC6 PINC5 PINC4 PINC3 PINC2 PINC1 PINC0 page 71
$12 ($32) PORTD PORTD7 PORTD6 PORTD5 PORTD4 PORTD3 PORTD2 PORTD1 PORTD0 page 73
$11 ($31) DDRD DDD7 DDD6 DDD5 DDD4 DDD3 DDD2 DDD1 DDD0 page 73
$10 ($30) PIND PIND7 PIND6 PIND5 PIND4 PIND3 PIND2 PIND1 PIND0 page 73
$0F ($2F) SPDR SPI Data Register page 51
$0E ($2E) SPSR SPIF WCOL - - - - - - page 50
$0D ($2D) SPCR SPIE SPE DORD MSTR CPOL CPHA SPR1 SPR0 page 49
$0C ($2C) UDR UART I/O Data Register page 55
$0B ($2B) USR RXC TXC UDRE FE OR - - - page 55
$0A ($2A) UCR RXCIE TXCIE UDRIE RXEN TXEN CHR9 RXB8 TXB8 page 56
$09 ($29) UBRR UART Baud Rate Register page 58
$08 ($28) ACSR ACD - ACO ACI ACIE ACIC ACIS1 ACIS0 page 59
… Reserved
$00 ($20) Reserved
Notes: 1. For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved I/O memory addresses
should never be written.
2. Some of the status flags are cleared by writing a logical “1” to them. Note that the CBI and SBI instructions will operate on all
bits in the I/O register, writing a one back into any flag read as set, thus clearing the flag. The CBI and SBI instructions work
with registers $00 to $1F only.
6 AT90S8515
0841GS–09/01
AT90S8515
7
0841GS–09/01
Instruction Set Summary (Continued)
Mnemonic Operands Description Operation Flags # Clocks
DATA TRANSFER INSTRUCTIONS
MOV Rd, Rr Move between Registers Rd ← Rr None 1
LDI Rd, K Load Immediate Rd ← K None 1
LD Rd, X Load Indirect Rd ← (X) None 2
LD Rd, X+ Load Indirect and Post-inc. Rd ← (X), X ← X + 1 None 2
LD Rd, -X Load Indirect and Pre-dec. X ← X - 1, Rd ← (X) None 2
LD Rd, Y Load Indirect Rd ← (Y) None 2
LD Rd, Y+ Load Indirect and Post-inc. Rd ← (Y), Y ← Y + 1 None 2
LD Rd, -Y Load Indirect and Pre-dec. Y ← Y - 1, Rd ← (Y) None 2
LDD Rd, Y+q Load Indirect with Displacement Rd ← (Y + q) None 2
LD Rd, Z Load Indirect Rd ← (Z) None 2
LD Rd, Z+ Load Indirect and Post-inc. Rd ← (Z), Z ← Z + 1 None 2
LD Rd, -Z Load Indirect and Pre-dec. Z ← Z - 1, Rd ← (Z) None 2
LDD Rd, Z+q Load Indirect with Displacement Rd ← (Z + q) None 2
LDS Rd, k Load Direct from SRAM Rd ← (k) None 2
ST X, Rr Store Indirect (X) ← Rr None 2
ST X+, Rr Store Indirect and Post-inc. (X) ← Rr, X ← X + 1 None 2
ST -X, Rr Store Indirect and Pre-dec. X ← X - 1, (X) ← Rr None 2
ST Y, Rr Store Indirect (Y) ← Rr None 2
ST Y+, Rr Store Indirect and Post-inc. (Y) ← Rr, Y ← Y + 1 None 2
ST -Y, Rr Store Indirect and Pre-dec. Y ← Y - 1, (Y) ← Rr None 2
STD Y+q, Rr Store Indirect with Displacement (Y + q) ← Rr None 2
ST Z, Rr Store Indirect (Z) ← Rr None 2
ST Z+, Rr Store Indirect and Post-inc. (Z) ← Rr, Z ← Z + 1 None 2
ST -Z, Rr Store Indirect and Pre-dec. Z ← Z - 1, (Z) ← Rr None 2
STD Z+q, Rr Store Indirect with Displacement (Z + q) ← Rr None 2
STS k, Rr Store Direct to SRAM (k) ← Rr None 2
LPM Load Program Memory R0 ← (Z) None 3
IN Rd, P In Port Rd ← P None 1
OUT P, Rr Out Port P ← Rr None 1
PUSH Rr Push Register on Stack STACK ← Rr None 2
POP Rd Pop Register from Stack Rd ← STACK None 2
BIT AND BIT-TEST INSTRUCTIONS
SBI P, b Set Bit in I/O Register I/O(P,b) ← 1 None 2
CBI P, b Clear Bit in I/O Register I/O(P,b) ← 0 None 2
LSL Rd Logical Shift Left Rd(n+1) ← Rd(n), Rd(0) ← 0 Z,C,N,V 1
LSR Rd Logical Shift Right Rd(n) ← Rd(n+1), Rd(7) ← 0 Z,C,N,V 1
ROL Rd Rotate Left through Carry Rd(0) ← C, Rd(n+1) ← Rd(n), C ← Rd(7) Z,C,N,V 1
ROR Rd Rotate Right through Carry Rd(7) ← C, Rd(n) ← Rd(n+1), C ← Rd(0) Z,C,N,V 1
ASR Rd Arithmetic Shift Right Rd(n) ← Rd(n+1), n = 0..6 Z,C,N,V 1
SWAP Rd Swap Nibbles Rd(3..0) ← Rd(7..4), Rd(7..4) ← Rd(3..0) None 1
BSET s Flag Set SREG(s) ← 1 SREG(s) 1
BCLR s Flag Clear SREG(s) ← 0 SREG(s) 1
BST Rr, b Bit Store from Register to T T ← Rr(b) T 1
BLD Rd, b Bit Load from T to Register Rd(b) ← T None 1
SEC Set Carry C←1 C 1
CLC Clear Carry C←0 C 1
SEN Set Negative Flag N←1 N 1
CLN Clear Negative Flag N←0 N 1
SEZ Set Zero Flag Z←1 Z 1
CLZ Clear Zero Flag Z←0 Z 1
SEI Global Interrupt Enable I←1 I 1
CLI Global Interrupt Disable I←0 I 1
SES Set Signed Test Flag S←1 S 1
CLS Clear Signed Test Flag S←0 S 1
SEV Set Two’s Complement Overflow V←1 V 1
CLV Clear Two’s Complement Overflow V←0 V 1
SET Set T in SREG T←1 T 1
CLT Clear T in SREG T←0 T 1
SEH Set Half-carry Flag in SREG H←1 H 1
CLH Clear Half-carry Flag in SREG H←0 H 1
NOP No Operation None 1
SLEEP Sleep (see specific descr. for Sleep function) None 1
WDR Watchdog Reset (see specific descr. for WDR/timer) None 1
8 AT90S8515
0841GS–09/01
AT90S8515
Package Type
44A 44-lead, Thin (1.0 mm) Plastic Gull Wing Quad Flat Package (TQFP)
44J 44-lead, Plastic J-leaded Chip Carrier (PLCC)
40P6 40-lead, 0.600" Wide, Plastic Dual Inline Package (PDIP)
9
0841GS–09/01
Packaging Information
44A
44-lead, Thin (1.0mm) Plastic Quad Flat Package
(TQFP), 10x10mm body, 2.0mm footprint, 0.8mm pitch.
Dimension in Millimeters and (Inches)*
JEDEC STANDARD MS-026 ACB
12.25(0.482)
PIN 1 ID SQ
11.75(0.462)
PIN 1
0.45(0.018)
0.80(0.0315) BSC 0.30(0.012)
10.10(0.394)
SQ
9.90(0.386)
1.20(0.047) MAX
0.20(0.008) 0˚~7˚
0.09(0.004)
0.75(0.030) 0.15(0.006)
0.45(0.018) 0.05(0.002)
REV. A 04/11/2001
10 AT90S8515
0841GS–09/01
AT90S8515
44J
44-lead, Plastic J-leaded Chip Carrier (PLCC)
Dimensions in Milimeters and (Inches)*
JEDEC STANDARD MS-018 AC
16.00(0.630)
16.70(0.656) SQ
SQ 15.00(0.590)
0.813(0.032) 16.50(0.650) 0.533(0.021)
0.660(0.026) 17.70(0.695) 0.330(0.013)
SQ
17.40(0.685)
REV. A 04/11/2001
11
0841GS–09/01
40P6
40-lead, Plastic Dual Inline
Package (PDIP), 0.600" wide
Dimension in Millimeters and (Inches)*
JEDEC STANDARD MS-011 AC
52.71(2.075)
51.94(2.045) PIN
1
13.97(0.550)
13.46(0.530)
48.26(1.900) REF
4.83(0.190)MAX
SEATING
PLANE
3.56(0.140) 0.38(0.015)MIN
3.05(0.120)
0.56(0.022)
1.65(0.065)
0.38(0.015)
2.54(0.100)BSC 1.27(0.050)
15.88(0.625)
15.24(0.600)
17.78(0.700)MAX
REV. A 04/11/2001
12 AT90S8515
0841GS–09/01
Atmel Headquarters Atmel Product Operations
Corporate Headquarters Atmel Colorado Springs
2325 Orchard Parkway 1150 E. Cheyenne Mtn. Blvd.
San Jose, CA 95131 Colorado Springs, CO 80906
TEL (408) 441-0311 TEL (719) 576-3300
FAX (408) 487-2600 FAX (719) 540-1759
Europe Atmel Grenoble
Atmel SarL Avenue de Rochepleine
Route des Arsenaux 41 BP 123
Casa Postale 80 38521 Saint-Egreve Cedex, France
CH-1705 Fribourg TEL (33) 4-7658-3000
Switzerland FAX (33) 4-7658-3480
TEL (41) 26-426-5555
FAX (41) 26-426-5500 Atmel Heilbronn
Theresienstrasse 2
Asia POB 3535
Atmel Asia, Ltd. D-74025 Heilbronn, Germany
Room 1219 TEL (49) 71 31 67 25 94
Chinachem Golden Plaza FAX (49) 71 31 67 24 23
77 Mody Road Tsimhatsui
East Kowloon Atmel Nantes
Hong Kong La Chantrerie
TEL (852) 2721-9778 BP 70602
FAX (852) 2722-1369 44306 Nantes Cedex 3, France
TEL (33) 0 2 40 18 18 18
Japan FAX (33) 0 2 40 18 19 60
Atmel Japan K.K.
9F, Tonetsu Shinkawa Bldg. Atmel Rousset
1-24-8 Shinkawa Zone Industrielle
Chuo-ku, Tokyo 104-0033 13106 Rousset Cedex, France
Japan TEL (33) 4-4253-6000
TEL (81) 3-3523-3551 FAX (33) 4-4253-6001
FAX (81) 3-3523-7581
Atmel Smart Card ICs
Scottish Enterprise Technology Park
East Kilbride, Scotland G75 0QR
TEL (44) 1355-357-000
FAX (44) 1355-242-743
e-mail
[email protected]
Web Site
http://www.atmel.com
BBS
1-(408) 436-4309
0841GS–09/01/xM