AVR - High Performance and Low Power RISC Architecture
•
118 Powerful Instructions - Most Single Clock Cycle Execution
•
8K bytes of In-System Reprogrammable Flash
– SPI Serial Interface for Program Downloading
– Endurance: 1,000 Write/Eras e Cycles
•
512 bytes EEPROM
– Endurance: 100,000 Write/Erase Cycles
•
512 bytes Internal SRAM
•
32 x 8 General Purpose Working Registers
•
32 Programmable I/O Lines
•
Programmable Serial UART
•
SPI Serial Interface
•
VCC: 2.7 - 6.0V
•
Fully Static Operation
– 0 - 8 MHz 4.0 - 6.0V,
– 0 - 4 MHz 2.7 - 4.0V
•
Up to 8 MIPS Throughput at 8 MHz
•
One 8-Bit Timer/Counter with Separate Prescaler
•
One 16-Bit Timer/Counter with Separate Prescaler
and Compare and Capture Modes
•
Dual PWM
•
External and Internal Interrupt Sources
•
Programmable Watchdog Timer with On-Chip Oscillator
•
On-Chip Analog Comparator
•
Low Power Idle and Power Down Modes
•
Programming Lock for Software Security
8-Bit
Microcontr oller
with 8K bytes
In-System
Programmable
Flash
AT90S8515
Description
The AT90S8 515 is a low-p ower CMOS 8-bit mic rocontroll er based on the AVR
enhanced RISC architecture . By exe cuting powe rful instruc tions in a single clock
cycle, the AT90S8515 achieves throughpu ts approaching 1 MIPS per MHz allowing
the system designer to optimize power consumption versus processing speed.
The AVR core combines a rich instr uction set with 32 gene ral purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two indep endent r egisters to be acce ssed in one singl e instr uction execute d
in one clock cycle. Th e resulting arc hitecture is mor e code efficie nt while achievin g
throughputs up to ten times faster than conventional CISC microcontrollers.
(continued)
Pin Configurations
Preliminary
®
Rev. 0841DS–06/98
Note: This is a sumary document. For the complete
76 page document, please visit our Web site at
www.atmel.com
and request literature number 0841D.
or e-mail at
literature@atmel.com
1
Block Diagram
Figure 1.
The AT90S8515 Block Diagram
The AT90S8515 provides the following features: 8K bytes
of In-System Programmable Flash, 512 bytes EEPROM,
512 bytes SRAM, 32 gen eral purpo se I/O li nes, 3 2 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 pow er saving modes. T he Idl e Mode sto ps the
CPU while allowing the SRAM, timer/counters, SPI port
and interrupt syste m to contin ue functioning . The power
down mode saves the register contents but freezes the
oscillator, disabling all other chip functions until the next
interrupt or hardware reset.
2
AT90S8515
The device is manufac tured using Atmel’ s high density
non-volatile memory technology. The on-chip in-system
programmable Flash allows the program memory to be
reprogrammed in-sys tem th ro ugh an S PI se rial i nterface or
by a conventional n onvolatile memo ry programmer. By
combining an enhanced RISC 8-bit CPU wit h In-System
Programmable Flash on a monolithic chip, the Atmel
AT90S8515 is a powerful microcontroller that provides a
highly flexible and co st effect ive solution to many em bedded control applications.
The AT90S8515 AVR is supported with a full s uite of program and system development tools including: C compilers, macro assemblers, program debugger/si mulators, incircuit emulators, and evaluati on kits.
AT90S8515
Pin Descriptions
V
CC
Supply voltage
GND
Ground
Port A (PA7..PA0)
Port A is an 8 -bit b idirec tional I/O port. Port p ins ca n provide internal pull-up resistors (selected for each bit). The
Port A output buffers can sink 20mA and can drive LED displays directly. When pins PA0 to PA7 are used as inputs
and are externally pull ed low, they will source c urrent if the
internal pull-up resistors are activated.
Port A serves as Multiplexed Address/Data input/output
when using external SRAM.
Port B (PB7..PB0)
Port B is an 8-bit bidirectional I/O pins with internal pull-up
resistors. The Port B output buffers can sink 20 mA. As
inputs, Port B pins t hat a re ex ter nally pu ll ed l ow wi ll sour c e
current if the pull-up resistors are activated.
Port B also serves the fu nction s of vario us speci al feat ures
of the AT90S8515 as listed on page 46.
Port C (PC7..PC0)
Port C is an 8-bit bidirectional I/O port with internal pull-up
resistors. The Port C output buffers can sink 20 mA. As
inputs, Port C pins that are exter nal ly pul led low wil l sour ce
current if the pull-up resistors are activated.
Port C als o s erv es as Addr es s ou tp ut when us ing ext ern al
SRAM.
Port D (PD7..PD0)
Port D is an 8-bit bidirectional I/O port with internal pull-up
resistors. The Port D output buffers can sink 20 mA. As
inputs, Port D pins that are exter nal ly pul led low wil l sour ce
current if the pull-up resistors are activated.
Port D also serves th e fu nc tion s of v ario us sp ec ial fea tur es
of the AT90S8515 as listed on page 52.
RESET
Reset input. A low on th is pi n for two machi ne cy cles wh ile
the oscillator is running resets the device.
XTAL1
Input to the inverting os cillator amplifi er and input to th e
internal clock operating circuit.
XTAL2
Output from the inverting oscillator amplifier
ICP
ICP is the input pin for the Time r/Counter1 Inpu t 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 Ex ternal
Memory is enabled. The ALE strob e is used to latch the
low-order address (8 bits) into an address latch during the
first access cy cle, and the A D0-7 pins a re used for data
during the second access cycle.
Crystal Oscillator
XTAL1 and XTAL2 are input and output, respectively, of an
inverting amplifier which can be configured for use as an
on-chip oscillator, as shown in Figure 2. Either a quartz
crystal or a ceramic resonator may be used. To drive the
device from an external clock source, XTAL2 should be left
unconnected while XTAL1 is driven as shown in Figure 3.
Figure 2.
Figure 3.
Oscillator Connec tio ns
External Clock Drive Configuration
3
AT90S8515 Architectural Overview
The fast-access register file concept contains 32 x 8-bit
general purpose worki ng regi ster s with a sin gle cl ock c ycle
access time. This means that during one single clock cycle,
one ALU (Arithmetic Logic Unit) operation is executed. Two
operands are output from the register file, the operation is
executed, and the result is stored back in the register file in one clock cycle.
Six of the 32 registers can be used as three 16-bits indirect
address register pointers for Data Space addressing enabling efficient address calculati ons. One of the three
address pointers is also used as the address pointer for the
constant table look up function. These added function registers are the 16-bits X-register, Y-register and Z-register.
Figure 4.
The AT90S8515
AVR
Enhanced RISC Architecture
The ALU supports arithmetic and logic functions between
registers or be tween a const ant and a r egist er. Si ngle re gister operations are also executed in the ALU. Figure 4
shows the AT90S851 5 AVR Enhan ced RISC mi crocontro ller architecture .
In addition to the register operation, the conventional memory addressing mode s can be used on the re gister file as
well. This is e nabled by th e fact that t he register f ile is
assigned the 32 lowermost Data Space addresses ($00 $1F), allowing them to be accessed as though they were
ordinary memory locations.
The I/O memory space contains 64 addresses for CPU
peripheral functions as Control Registers, Timer/Counters,
A/D-converte rs, and ot her I/O fun ctions. T he I/O Mem ory
can be accessed dir ectly, or as the Da ta Space loca tions
following those of the register file, $20 - $5F.
4
AT90S8515
AVR
The
rate memories and buses fo r program and data. The pr ogram memory is executed with a two stage pipeline. While
one instruction is bein g executed, the next ins truction is
pre-fetched from the program memory. This co ncept
enables instructions to be executed in every clock cycle.
The program memory is in-system programmable Flash
memory.
With the relat ive jump an d call i nstructi ons, the w hole 4K
address space i s directl y access ed. Most AVR in struc tions
have a single 16-bit word format. Every program memory
address contains a 16- or 32-bit instruction.
During interrupts and su broutine calls, t he retur n addre ss
program counter (PC) is stor ed on the stack. The stack is
effectively allo cated i n the gene ral dat a SRAM, and cons equently the stack size is only limited by the total SRAM size
and the usage of the SR AM. All user progr ams must initial-
uses a Harvard architecture concept - with sepa-
AT90S8515
ize the SP in the reset routine (before subroutines or interrupts are execute d). The 16-bit stack pointer SP is
read/write accessib le in the I/O spac e.
The 512 bytes data SRAM can be easily access ed through
the five different addressing modes supported in th e AVR
architecture.
The memory spaces in the AVR
and regular memory maps.
A flexible interrupt module has its control registers in the
I/O space with an additional global interrupt enable bit in
the status register. All the different interrupts have a separate interrupt vector in the interrupt vector table at the
beginning of the program memory. The different interrupts
have priority in accordance with their interrupt vector position. The lower the interrupt vector address the higher the
priority.
ADDRd, RrAdd two RegistersRd ← Rd + RrZ,C,N,V,H1
ADCRd, RrAdd with Carry two RegistersRd ← Rd + Rr + CZ,C,N,V,H1
ADIWRdl,KAdd Immediate to WordRdh:Rdl ← Rdh:Rdl + KZ,C,N,V,S2
SUBRd, RrSubtract two RegistersRd ← Rd - RrZ,C,N,V,H1
SUBIRd, KSubtract Constant from Register Rd ← Rd - KZ,C,N,V,H1
SBCRd, RrSubtract with Carry two RegistersRd ← Rd - Rr - CZ,C,N,V,H1
SBCIRd, KSubtract with Carry Constant from Reg.Rd ← Rd - K - CZ,C,N,V,H1
SBIWRdl,KSubtract Immediate from WordRdh:Rdl ← Rdh:Rdl - KZ,C,N,V,S2
ANDRd, RrLogical AND RegistersRd ← Rd • RrZ,N,V1
ANDIRd, KLogical AND Register and ConstantRd ← Rd • KZ,N,V1
ORRd, RrLogical OR RegistersRd ← Rd v RrZ,N,V1
ORIRd, KLogical OR Register and ConstantRd ← Rd v KZ,N,V1
EORRd, RrExclusive OR RegistersRd ← Rd ⊕ RrZ,N,V1
COMRdOne’s ComplementRd ← $FF − RdZ,C,N,V1
NEGRdTwo’s ComplementRd ← $00 − RdZ,C,N,V,H1
SBRRd,KSet Bit(s) in RegisterRd ← Rd v KZ,N,V1
CBRRd,KClear Bit(s) in RegisterRd ← Rd • ($FF - K)Z,N,V1
INCRdIncrementRd ← Rd + 1Z,N,V1
DECRdDecrementRd ← Rd − 1 Z,N,V1
TSTRdTest for Zero or MinusRd ← Rd • Rd Z,N,V1
CLRRdClear RegisterRd ← Rd ⊕ RdZ,N,V1
SERRdSet RegisterRd ← $FFNone1
BRANCH INSTRUCTIONS
RJMPkRelative JumpPC ← PC + k + 1None2
IJMPIndirect Jump to (Z)PC ← Z None2
RCALLkRelative Subroutine Call PC ← PC + k + 1None3
ICALLIndirect Call to (Z)PC ← ZNone3
RETSubroutine ReturnPC ← ST A C KNone4
RETIInterrupt ReturnPC ← STACKI4
CPSERd,RrCompare, Skip if Equalif (Rd = Rr) PC ← PC + 2 or 3None1 / 2
CPRd,RrCompareRd − RrZ, N,V,C,H1
CPCRd,RrCompare with CarryRd − Rr − CZ, N,V,C,H1
CPIRd,KCompare Register with ImmediateRd − KZ, N,V,C,H1
SBRCRr, bSkip if Bit in Register Clearedif (Rr(b)=0) PC ← PC + 2 or 3 None1 / 2
SBRSRr, bSkip if Bit in Register is Setif (Rr(b)=1) PC ← PC + 2 or 3None1 / 2
SBICP, bSkip if Bit in I/O Register Clearedif (P(b)=0) PC ← PC + 2 or 3 None1 / 2
SBISP, bSkip if Bit in I/O Register is Setif (P(b)=1) PC ← PC + 2 or 3None1 / 2
BRBSs, kBranch if Status Flag Setif (SREG(s) = 1) then PC←PC+k + 1None1 / 2
BRBCs, kBranch if Status Flag Clearedif (SREG(s) = 0) then PC←PC+k + 1None1 / 2
BREQ kBranch if Equal if (Z = 1) then PC ← PC + k + 1None1 / 2
BRNE kBranch if Not Equalif (Z = 0) then PC ← PC + k + 1None1 / 2
BRCS kBranch if Carry Setif (C = 1) then PC ← PC + k + 1None1 / 2
BRCC kBranch if Carry Clearedif (C = 0) then PC ← PC + k + 1None1 / 2
BRSH kBranch if Same or Higher if (C = 0) then PC ← PC + k + 1None1 / 2
BRLO kBranch if Lowerif (C = 1) then PC ← PC + k + 1None1 / 2
BRMI kBranch if Minusif (N = 1) then PC ← PC + k + 1None1 / 2
BRPL kBranch if Plus if (N = 0) then PC ← PC + k + 1None1 / 2
BRGE kBranch if Greater or Equal, Signedif (N ⊕ V= 0) then PC ← PC + k + 1None1 / 2
BRLT kBranch if Less Than Zero, Signedif (N ⊕ V= 1) then PC ← PC + k + 1None1 / 2
BRHS kBranch if Half Carry Flag Setif (H = 1) then PC ← PC + k + 1None1 / 2
BRHC kBranch if Half Carry Flag Clearedif (H = 0) then PC ← PC + k + 1None1 / 2
BRTS kBranch if T Flag Setif (T = 1) then PC ← PC + k + 1None1 / 2
BRTC kBranch if T Flag Clearedif (T = 0) then PC ← PC + k + 1None1 / 2
BRVS kBranch if Overflow Flag is Setif (V = 1) then PC ← PC + k + 1None1 / 2
BRVC kBranch if Overflow Flag is Clearedif (V = 0) then PC ← PC + k + 1None1 / 2
BRIE kBranch if Interrupt Enabledif ( I = 1) then PC ← PC + k + 1None1 / 2
BRID kBranch if Interrupt Disabledif ( I = 0) then PC ← PC + k + 1None1 / 2
7
AT90S8515 Instruction Set Summary
MnemonicsOperandsDescriptionOperationFlags#Clocks
DATA TRANSFER INSTRUCTIONS
MOVRd, RrMove Bet ween Regi ster sRd ← RrNone1
LDIRd, KLoad Imm edia teRd ← KNone1
LDRd, XLoad IndirectRd ← (X)None2
LDRd, X+Load Indirect and Post-Inc.Rd ← (X), X ← X + 1None2
LDRd, - XLoad Indirect and Pre-Dec.X ← X - 1, Rd ← (X)None2
LDRd, YLoad IndirectRd ← (Y)None2
LDRd, Y+Load Indirect and Post-Inc.Rd ← (Y), Y ← Y + 1None2
LDRd, - YLoad Indirect and Pre-Dec.Y ← Y - 1, Rd ← (Y)None2
LDDRd,Y+qLoad Indirect with DisplacementRd ← (Y + q)None2
LDRd, ZLoad Indirect Rd ← (Z)None2
LDRd, Z+Load Indirect and Post-Inc.Rd ← (Z), Z ← Z+1None2
LDRd, -ZLoad Indirect and Pre-Dec.Z ← Z - 1, Rd ← (Z)None2
LDDRd, Z+qLoa d Indi r ect wit h Disp lace men tRd ← (Z + q)None2
LDSRd, kLoad Direct from SRAMRd ← (k)None2
STX, RrStore Indirect(X) ← RrNone2
STX+, RrStore Indirect and Post-Inc.(X) ← Rr, X ← X + 1None2
ST- X, RrStore Indirect and Pre-Dec.X ← X - 1, (X) ← RrNone2
STY, RrStore Indirect(Y) ← RrNone2
STY+, RrStore Indirect and Post-Inc.(Y) ← Rr, Y ← Y + 1None2
ST- Y, RrStore Indirect and Pre-Dec.Y ← Y - 1, (Y) ← RrNone2
STDY+q,RrStore Indirect with Displacement(Y + q) ← RrNone2
STZ, RrStore Indirect(Z) ← RrNone2
STZ+, RrStore Indirect and Post-Inc.(Z) ← Rr, Z ← Z + 1None2
ST-Z, RrStore Indirect and Pre-Dec.Z ← Z - 1, (Z) ← RrNone2
STDZ+q,RrStore Indirect with Displacement(Z + q) ← RrNone2
STSk, RrStore Direct to SRAM(k) ← RrNone2
LPMLoad Program MemoryR0 ← (Z)None3
INRd, PIn PortRd ← PNone1
OUTP, RrOut PortP ← RrNone1
PUSHR rPu sh Regi st er on St ackSTACK ← RrNone2
POPRdPop Register from StackRd ← STACKNone2
BIT AND BIT-TEST INSTRUCTIONS
SBIP,bSet Bit in I/O RegisterI/O(P,b) ← 1None2
CBIP,bClear Bit in I/O RegisterI/O(P,b) ← 0None2
LSLRdLogical Shift LeftRd(n+1) ← Rd(n), Rd(0) ← 0Z,C,N,V1
LSRRdLogical Shift RightRd(n) ← Rd(n+1), Rd(7) ← 0Z,C,N,V1
ROLRdRotate Left Through CarryRd(0)←C,Rd(n+1)← Rd(n),C←Rd(7)Z,C,N,V1
RORRdRotate Right Through CarryRd(7)←C,Rd(n)← Rd(n+1),C←Rd(0)Z,C,N,V1
ASRRdArithmetic Shift RightRd(n) ← Rd(n+1), n=0..6Z,C,N,V1
SWAPRdSwap NibblesRd(3..0)←Rd(7..4),Rd(7..4)←Rd(3..0)None1
BSETsFlag SetSREG(s) ← 1SREG(s)1
BCLRsFlag ClearSREG(s) ← 0 SREG(s)1
BSTRr, bBit Store from Register to TT ← Rr(b)T1
BLDRd, bBit load from T to RegisterRd(b) ← TNone1
SECSet CarryC ← 1C1
CLCClear CarryC ← 0 C1
SENSet Negative FlagN ← 1N1
CLNClear Negative FlagN ← 0 N1
SEZSet Zero FlagZ ← 1Z1
CLZClear Zero FlagZ ← 0 Z1
SEIGlobal Interrupt EnableI ← 1I1
CLIGlobal Interrupt DisableI ← 0 I1
SESSet Signed Test FlagS ← 1S1
CLSClear Signed Test FlagS ← 0 S1
SEVSet Twos Complement Overflow.V ← 1V1
CLVClear Twos Complement OverflowV ← 0 V1
SETSet T in SREGT ← 1T1
CLTClear T in SREGT ← 0 T1
SEHSet Half Carry Flag in SREGH ← 1H1
CLHClear Half Carry Flag in SREGH ← 0 H1
NOPNo OperationNone1
SLEEPSleep(see specific descr. for Sleep function)None3
WDRWatchdog Reset(see specific descr. for WDR/timer)None1
8
AT90S8515
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.