Rainbow-electronics AT90S2313 User Manual

Browse online or download User Manual for Sensors Rainbow-electronics AT90S2313. Rainbow Electronics AT90S2313 User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 92
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
1
Features
Utilizes the AVR
®
RISC Architecture
AVR – High-performance and Low-power RISC Architecture
118 Powerful Instructions – Most Single Clock Cycle Execution
32x8GeneralPurposeWorkingRegisters
Up to 10 MIPS Throughput at 10 MHz
Data and Non-volatile Program Memory
2K Bytes of In-System Programmable Flash
Endurance 1,000 Write/Erase Cycles
128 Bytes of SRAM
128 Bytes of In-System Programmable EEPROM
Endurance: 100,000 Write/Erase Cycles
Programming Lock for Flash Program and EEPROM Data Security
Peripheral Features
One 8-bit Timer/Counter with Separate Prescaler
One 16-bit Timer/Counter with Separate Prescaler,
Compare, Capture Modes and 8-, 9-, or 10-bit PWM
On-chip Analog Comparator
Programmable Watchdog Timer with On-chip Oscillator
SPI Serial Interface for In-System Programming
–FullDuplexUART
Special Microcontroller Features
Low-power Idle and Power-down Modes
External and Internal Interrupt Sources
Specifications
Low-power, High-speed CMOS Process Technology
Fully Static Operation
Power Consumption at 4 MHz, 3V, 25°C
Active: 2.8 mA
Idle Mode: 0.8 mA
Power-down Mode: <1 µA
I/O and Packages
15 Programmable I/O Lines
20-pin PDIP and SOIC
Operating Voltages
2.7 - 6.0V (AT90S2313-4)
4.0 - 6.0V (AT90S2313-10)
Speed Grades
0 - 4 MHz (AT90S2313-4)
0 - 10 MHz (AT90S2313-10)
Pin Configuration
PDIP/SOIC
8-bit
Microcontroller
with 2K Bytes
of In-System
Programmable
Flash
AT90S2313
Rev. 0839I–AVR–06/02
Page view 0
1 2 3 4 5 6 ... 91 92

Summary of Contents

Page 1 - Pin Configuration

1Features• Utilizes the AVR®RISC Architecture• AVR – High-performance and Low-power RISC Architecture– 118 Powerful Instructions – Most Single Clock C

Page 2

10AT90S23130839I–AVR–06/02Program and DataAddressing ModesThe AT90S2313 AVR RISC microcontroller supports powerful and efficient addressingmodes for a

Page 3

11AT90S23130839I–AVR–06/02Operand address is contained in 6 bits of the instruction word. n is the destination orsource register address.Data Direct F

Page 4

12AT90S23130839I–AVR–06/02Data Indirect with Pre-decrementFigure 15. Data Indirect Addressing with Pre-decrementThe X-, Y-, or Z-register is decrement

Page 5

13AT90S23130839I–AVR–06/02Indirect Program Addressing,IJMP and ICALLFigure 18. Indirect Program Memory AddressingProgram execution continues at addres

Page 6

14AT90S23130839I–AVR–06/02Memory Access andInstruction ExecutionTimingThis section describes the general access timing concepts for instruction execut

Page 7

15AT90S23130839I–AVR–06/02Figure 22. On-chip Data SRAM Access CyclesI/O Memory The I/O space definition of the AT90S2313 is shown in Table 1.System Cl

Page 8

16AT90S23130839I–AVR–06/02Note: 1. Reserved and unused locations are not shown in the table.All AT90S2313 I/O and peripherals are placed in the I/O sp

Page 9

17AT90S23130839I–AVR–06/02• Bit 5 – H: Half-carry FlagThe Half-carry Flag H indicates a Half-carry in some arithmetic operations. See theInstruction S

Page 10 - AT90S2313

18AT90S23130839I–AVR–06/02Reset and InterruptHandlingThe AT90S2313 provides 10 different interrupt sources. These interrupts and the sepa-rate Reset V

Page 11

19AT90S23130839I–AVR–06/02Reset Sources The AT90S2313 has three sources of reset:• Power-on Reset. The MCU is reset when the supply voltage is below t

Page 12

2AT90S23130839I–AVR–06/02Description The AT90S2313 is a low-power CMOS 8-bit microcontroller based on the AVR RISCarchitecture. By executing powerful

Page 13

20AT90S23130839I–AVR–06/02Power-on Reset A Power-on Reset (POR) circuit ensures that the device is reset from Power-on. Asshown in Figure 23, an inter

Page 14

21AT90S23130839I–AVR–06/02External Reset An External Reset is generated by a low level on the RESET pin. Reset pulses longerthan 50 ns will generate a

Page 15

22AT90S23130839I–AVR–06/02interrupt. Some of the Interrupt Flags can also be cleared by writing a logical “1” to theflag bit position(s) to be cleared

Page 16

23AT90S23130839I–AVR–06/02General Interrupt FLAGRegister – GIFR• Bit 7 – INTF1: External Interrupt Flag1When an edge on the INT1 pin triggers an inter

Page 17

24AT90S23130839I–AVR–06/02• Bit 3 – TICIE1: Timer/Counter1 Input Capture Interrupt EnableWhen the TICIE1 bit is set (one) and the I-bit in the Status

Page 18

25AT90S23130839I–AVR–06/02• Bit 2 – Res: Reserved BitThis bit is a reserved bit in the AT90S2313 and always reads as zero.• Bit 1 – TOV0: Timer/Counte

Page 19

26AT90S23130839I–AVR–06/02• Bit 4 – SM: Sleep ModeThis bit selects between the two available sleep modes. When SM is cleared (zero), Idlemode is selec

Page 20

27AT90S23130839I–AVR–06/02Sleep Modes To enter the sleep modes, the SE bit in MCUCR must be set (one) and a SLEEP instruc-tion must be executed. If an

Page 21

28AT90S23130839I–AVR–06/02The four different prescaled selections are: CK/8, CK/64, CK/256, and CK/1024, whereCK is the Oscillator clock. For the two

Page 22

29AT90S23130839I–AVR–06/02Timer/Counter0 ControlRegister – TCCR0• Bits 7..3 – Res: Reserved BitsThese bits are reserved bits in the AT90S2313 and alwa

Page 23

3AT90S23130839I–AVR–06/02selectable power-saving modes. The Idle mode stops the CPU while allowing theSRAM, Timer/Counters, SPI port and interrupt sys

Page 24

30AT90S23130839I–AVR–06/0216-bit Timer/Counter1 Figure 30 shows the block diagram for Timer/Counter1.Figure 30. Timer/Counter1 Block DiagramThe 16-bit

Page 25

31AT90S23130839I–AVR–06/02Timer/Counter1 can also be used as an 8-, 9-, or 10-bit Pulse Width Modulator. In thismode the counter and the OCR1 Register

Page 26

32AT90S23130839I–AVR–06/02• Bits 1, 0 – PWM11, PWM10: Pulse Width Modulator Select BitsThese bits select PWM operation of Timer/Counter1 as specified

Page 27

33AT90S23130839I–AVR–06/02• Bits 2,1,0 – CS12, CS11, CS10: Clock Select1, Bits 2, 1 and 0The Clock Select1 bits 2, 1, and 0 define the prescaling sour

Page 28

34AT90S23130839I–AVR–06/02The Timer/Counter1 is realized as an up or up/down (in PWM mode) counter with readand write access. If Timer/Counter1 is wri

Page 29

35AT90S23130839I–AVR–06/02The TEMP Register is also used when accessing TCNT1 and OCR1A. If the main pro-gram and interrupt routines perform access to

Page 30

36AT90S23130839I–AVR–06/02During the time between the write and the latch operations, a read from OCR1A willread the contents of the temporary locatio

Page 31

37AT90S23130839I–AVR–06/02Watchdog Timer The Watchdog Timer is clocked from a separate On-chip Oscillator that runs at 1 MHz.This is the typical value

Page 32

38AT90S23130839I–AVR–06/021. In the same operation, write a logical “1” to WDTOE and WDE. A logical “1” mustbe written to WDE even though it is set to

Page 33

39AT90S23130839I–AVR–06/02EEPROM Read/WriteAccessThe EEPROM Access Registers are accessible in the I/O space.The write access time is in the range of

Page 34

4AT90S23130839I–AVR–06/02Crystal Oscillator XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier that canbe configured for us

Page 35

40AT90S23130839I–AVR–06/02EEPROM Control Register –EECR• Bit 7..3 – Res: Reserved BitsThese bits are reserved bits in the AT90S2313 and will always re

Page 36

41AT90S23130839I–AVR–06/02Prevent EEPROMCorruptionDuring periods of low VCC, the EEPROM data can be corrupted because the supply volt-age is too low f

Page 37

42AT90S23130839I–AVR–06/02UART The AT90S2313 features a full duplex (separate Receive and Transmit Registers) Uni-versal Asynchronous Receiver and Tra

Page 38

43AT90S23130839I–AVR–06/02tus Register (USR) is set. When this bit is set (one), the UART is ready to receive thenext character. At the same time as t

Page 39

44AT90S23130839I–AVR–06/02found to be logical “1”s, the start bit is rejected as a noise spike and the receiver startslooking for the next 1-to-0 tran

Page 40

45AT90S23130839I–AVR–06/02UART ControlThe UART I/O Data Register –UDRThe UDR Register is actually two physically separate registers sharing the same I

Page 41

46AT90S23130839I–AVR–06/02• Bit 4 – FE: Framing ErrorThis bit is set if a Framing Error condition is detected (i.e., when the stop bit of an incom-ing

Page 42

47AT90S23130839I–AVR–06/02• Bit 1 – RXB8: Receive Data Bit 8When CHR9 is set (one), RXB8 is the ninth data bit of the received character.• Bit 0 – TXB

Page 43

48AT90S23130839I–AVR–06/02UART Baud Rate Register –UBRRThe UBRR Register is an 8-bit read/write register that specifies the UART Baud Rateaccording to

Page 44

49AT90S23130839I–AVR–06/02• Bit 5 – ACO: Analog Comparator OutputACO is directly connected to the comparator output.• Bit 4 – ACI: Analog Comparator I

Page 45

5AT90S23130839I–AVR–06/02ArchitecturalOverviewThe fast-access Register File concept contains 32 x 8-bit general purpose working reg-isters with a sing

Page 46

50AT90S23130839I–AVR–06/02I/O Ports All AVR ports have true Read-Modify-Write functionality when used as general digitalI/O ports. This means that the

Page 47

51AT90S23130839I–AVR–06/02The Port B Input Pins address (PINB) is not a register; this address enables access tothe physical value on each Port B pin.

Page 48

52AT90S23130839I–AVR–06/02Port B Schematics Note that all port pins are synchronized. The synchronization latches are, however, notshown in the figure

Page 49

53AT90S23130839I–AVR–06/02Figure 39. Port B Schematic Diagram (Pin PB3)Figure 40. Port B Schematic Diagram (Pins PB2 and PB4)PB3DDB3MOSPULL-UPRESETRQD

Page 50

54AT90S23130839I–AVR–06/02Figure 41. Port B Schematic Diagram (Pin PB5)Figure 42. Port B Schematic Diagram (Pin PB6)

Page 51

55AT90S23130839I–AVR–06/02Figure 43. Port B Schematic Diagram (Pin PB7)Port D Three I/O memory address locations are allocated for the Port D: one eac

Page 52

56AT90S23130839I–AVR–06/02Port D Data Register – PORTDPort D Data Direction Register– DDRDPort D Input Pins Address –PINDThe Port D Input Pins address

Page 53

57AT90S23130839I–AVR–06/02• INT1 – Port D, Bit 3INT1, External Interrupt Source 1. The PD3 pin can serve as an external interruptsource to the MCU. Se

Page 54

58AT90S23130839I–AVR–06/02Figure 45. Port D Schematic Diagram (Pin PD1)Figure 46. Port D Schematic Diagram (Pins PD2 and PD3)DATA BUSDDQQRESETRESETCCW

Page 55

59AT90S23130839I–AVR–06/02Figure 47. Port D Schematic Diagram (Pins PD4 and PD5)Figure 48. Port D Schematic Diagram (Pin PD6)DATA BUSDDQQRESETRESETCCW

Page 56

6AT90S23130839I–AVR–06/02The I/O memory space contains 64 addresses for CPU peripheral functions such ascontrol registers, Timer/Counters, A/D convert

Page 57

60AT90S23130839I–AVR–06/02Memory ProgrammingProgram and DataMemory Lock BitsThe AT90S2313 MCU provides two Lock bits that can be left unprogrammed (“1

Page 58

61AT90S23130839I–AVR–06/02within the self-timed write instruction in the Serial Programming mode. During program-ming, the supply voltage must be in a

Page 59

62AT90S23130839I–AVR–06/02Enter Programming Mode The following algorithm puts the device in Parallel Programming mode:1. Apply supply voltage accordin

Page 60

63AT90S23130839I–AVR–06/025. Give WR a tWLWH_CEwide negative pulse to execute Chip Erase. See Table 26fortWLWH_CEvalue. Chip Erase does not generate a

Page 61

64AT90S23130839I–AVR–06/02The loaded command and address are retained in the device during programming. Forefficient programming, the following should

Page 62

65AT90S23130839I–AVR–06/02Reading the Flash The algorithm for reading the Flash memory is as follows (refer to “Programming theFlash” for details on c

Page 63

66AT90S23130839I–AVR–06/02Reading the Fuse and LockBitsThe algorithm for reading the Fuse and Lock bits is as follows (refer to “Programmingthe Flash”

Page 64

67AT90S23130839I–AVR–06/02Parallel ProgrammingCharacteristicsFigure 52. Parallel Programming TimingNotes: 1. Use tWLWH_CEforchiperaseandtWLWH_PFBfor p

Page 65

68AT90S23130839I–AVR–06/02Serial Downloading Both the program and data memory arrays can be programmed using the serial SPI buswhile RESETis pulled to

Page 66

69AT90S23130839I–AVR–06/02ing the third byte of the Programming Enable instruction. Whether the echo iscorrect or not, all four bytes of the instructi

Page 67

7AT90S23130839I–AVR–06/02General PurposeRegister FileFigure 6 shows the structure of the 32 general purpose registers in the CPU.Figure 6. AVR CPU Gen

Page 68

70AT90S23130839I–AVR–06/02Data Polling Flash When a byte is being programmed into the Flash, reading the address location beingprogrammed will give th

Page 69

71AT90S23130839I–AVR–06/02Serial ProgrammingCharacteristicsFigure 55. Serial Programming TimingTable 29. Serial Programming Characteristics, TA=-40°Ct

Page 70

72AT90S23130839I–AVR–06/02Electrical CharacteristicsAbsolute Maximum Ratings*Operating Temperature... -55°Cto+125°C*NOT

Page 71

73AT90S23130839I–AVR–06/02Notes: 1. “Max” means the highest value where the pin is guaranteed to be read as low.2. “Min” means the lowest value where

Page 72

74AT90S23130839I–AVR–06/02TypicalCharacteristicsThe following charts show typical behavior. These figures are not tested during manu-facturing. All cu

Page 73

75AT90S23130839I–AVR–06/02Figure 58. Active Supply Current vs. VCCFigure 59. Idle Supply Current vs. Frequency0246810122 2.5 3 3.5 4 4.5 5 5.5 6ACTIVE

Page 74

76AT90S23130839I–AVR–06/02Figure 60. Idle Supply Current vs. VCCFigure 61. Power-down Supply Current vs. VCCIDLE SUPPLY CURRENT vs. VccIcc (mA)Vcc(V)F

Page 75

77AT90S23130839I–AVR–06/02Figure 62. Power-down Supply Current vs. VCCFigure 63. Analog Comparator Current vs. VCC0204060801001201401602 2.5 3 3.5 4 4

Page 76

78AT90S23130839I–AVR–06/02Note: Analog Comparator offset voltage is measured as absolute offset.Figure 64. Analog Comparator Offset Voltage vs. Common

Page 77

79AT90S23130839I–AVR–06/02Figure 66. Analog Comparator Input Leakage CurrentFigure 67. Watchdog Oscillator Frequency vs. VCC6050403020100-100 0.5 1.51

Page 78

8AT90S23130839I–AVR–06/02In the different addressing modes these address registers have functions as fixed dis-placement, automatic increment and decr

Page 79

80AT90S23130839I–AVR–06/02Note: Sink and source capabilities of I/O ports are measured on one pin at a time.Figure 68. Pull-up Resistor Current vs. In

Page 80

81AT90S23130839I–AVR–06/02Figure 70. I/O Pin Sink Current vs. Output VoltageFigure 71. I/O Pin Source Current vs. Output Voltage0102030405060700 0.5 1

Page 81

82AT90S23130839I–AVR–06/02Figure 72. I/O Pin Sink Current vs. Output VoltageFigure 73. I/O Pin Source Current vs. Output Voltage05101520250 0.5 1 1.5

Page 82

83AT90S23130839I–AVR–06/02Figure 74. I/O Pin Input Threshold Voltage vs. VCCFigure 75. I/O Pin Input Hysteresis vs. VCC00.511.522.52.7 4.0 5.0Threshol

Page 83

84AT90S23130839I–AVR–06/02Notes: 1. For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved I/O memory ad

Page 84

85AT90S23130839I–AVR–06/02Instruction Set SummaryMnemonic Operands Description Operation Flags # ClocksARITHMETIC AND LOGIC INSTRUCTIONSADD Rd, Rr Add

Page 85

86AT90S23130839I–AVR–06/02DATA TRANSFER INSTRUCTIONSMOV Rd, Rr Move between Registers Rd ← Rr None 1LDI Rd, K Load Immediate Rd ← K None 1LD Rd, X Loa

Page 86

87AT90S23130839I–AVR–06/02Ordering InformationSpeed (MHz) Power Supply Ordering Code Package Operation Range4 2.7 - 6.0V AT90S2313-4PCAT90S2313-4SC20P

Page 87

88AT90S23130839I–AVR–06/02Packaging Information20P3 2325 Orchard Parkway San Jose, CA 95131TITLEDRAWING NO.RREV. 20P3, 20-lead (0.300"/7.62 m

Page 88 - Packaging Information

89AT90S23130839I–AVR–06/0220S7.60 (0.2992)7.40 (0.2914)0.51(0.020)0.33(0.013)10.65 (0.419)10.00 (0.394)PIN 1 ID1.27 (0.050) BSC13.00 (0.5118)12.60 (0.

Page 89 - REV. A 04/11/2001

9AT90S23130839I–AVR–06/02SRAM Data Memory Figure 8 shows how the AT90S2313 data memory is organized.Figure 8. SRAM OrganizationThe 224 data memory loc

Page 90 - Table of Contents

iAT90S23130839I–AVR–06/02Table of ContentsFeatures... 1P

Page 91 - 0839I–AVR–06/02

iiAT90S23130839I–AVR–06/02Parallel Programming ....... 61Parallel Pr

Page 92 - © Atmel Corporation 2002

Printed on recycled paper.© Atmel Corporation 2002.Atmel Corporation makes no warranty for the use of its products, other than those expressly contain

Comments to this Manuals

No comments