Rainbow-electronics AT89C5122 Manual do Utilizador

Consulte online ou descarregue Manual do Utilizador para Software Rainbow-electronics AT89C5122. Rainbow Electronics AT89C5122 User Manual Manual do Utilizador

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 213
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 0
Rev. 4202E–SCR–06/06
1
Features
Clock Controller
80C51 core with 6 clocks per instruction
8 MHz On-Chip Oscillator
PLL for generating clock to supply CPU core, USB and Smart Card Interfaces
Programmable CPU clock from 500 KHz / X1 to 48 MHz / X1
Reset Controller
Power On Reset (POR) feature avoiding an external reset capacitor
Power Fail Detector (PFD)
Watch-Dog Timer
Power Management
Two power saving modes : Idle and Power Down
Four Power Down Wake-up Sources : Smart Card Detection, Keyboard Interrupt, USB
Resume, External Interrupt
Input Voltage Range : 3.0V - 5.5V
Core’s Power Consumption (Without Smart Card and USB) :
•30 mA Maximum Operating Current @ 48 MHz / X1
•200 μA Maximum Power-down Current @ 5.5V
Interrupt Controller
up to 9 interrupt sources
up to 4 Level Priority
Memory Controller
Internal Program memory :
•up to 32KB of Flash or CRAM or ROM for AT8xC5122
•up to 30KB of ROM for AT83C5123
Internal Data Memory : 768 bytes including 256 bytes of data and 512 bytes of XRAM
Optional : internal data E2PROM 512 bytes
Two 16-bit Timer/Counters
USB 2.0 Full Speed Interface
–48 MHz DPLL
On-Chip 3.3V USB voltage regulator and transceivers
Software detach feature
7 endpoints programmable with In or out directions and ISO, Bulk or Interrupt Transfers :
•Endpoint 0: 32 Bytes Bidirectionnal FIFO for Control transfers
•Endpoints 1,2,3: 8 bytes FIFO
•Endpoints 4,5: 64 Bytes FIFO
•Endpoint 6: 2*64 bytes FIFO with Pin-Pong feature
ISO 7816 UART Interface Fully Compliant with EMV, GIE-CB and WHQL Standards
Programmable ISO clock from 1 MHz to 4.8 MHz
Card insertion/removal detection with automatic deactivation sequence
Programmable Baud Rate Generator from 372 to 11.625 clock pulses
Synchronous/Asynchronous Protocols T=0 and T=1 with Direct or Inverse Convention
Automatic character repetition on parity errors
32 Bit Waiting Time Counter
16 Bit Guard Time Counter
Internal Step Up/Down Converter with Programmable Voltage Output:
•VCC = 4.0V to 5.5V, 1.8V-30 mA, 3V-60 mA and 5V-60 mA
•VCC = 3.0V, 1.8V-30 mA, 3V-30 mA and 5V-30 mA
Current overload protection
6 kV ESD (MIL/STD 833 Class 3) protection on whole Smart Card Interface
Alternate Smart Card Interface with CLK, IO and RST
UART Interface with Integrated Baud Rate Generator (BRG)
Keyboard interface with up to 20x8 matrix management capability
Master/Slave SPI Interface
Four 8 bit Ports, one 6 bit port, one 3-bit port
Up to Seven LED outputs with 3 level programmable current source : 2, 4 and 10 mA
Two General Purpose I/O programmable as external interrupts
Up to 8 input lines programmable as interrupts
Up to 30 output lines
C51
Microcontroller
with USB and
Smart Card
Reader
Interfaces
AT83C5122
AT83EC5122
AT85C5122
AT89C5122
AT89C5122DS
AT83C5123
AT83EC5123
Vista de página 0
1 2 3 4 5 6 ... 212 213

Resumo do Conteúdo

Página 1 - Features

Rev. 4202E–SCR–06/061 Features• Clock Controller– 80C51 core with 6 clocks per instruction– 8 MHz On-Chip Oscillator– PLL for generating clock to

Página 2

10 AT8xC5122/234202E–SCR–06/06Figure 5. QFN64 Package Pinout 62 61 60 59 58 63 5756 55 54 53P0.1/AD1P0.3/AD3P0.5/AD5P0.7/AD7D+P4.1/MOSIP4.0/

Página 3

100 AT8xC5122/234202E–SCR–06/06• Endpoint enableBefore using an endpoint, this one should be enabled by setting the EPEN bit in theUEPCONX registe

Página 4

101 AT8xC5122/234202E–SCR–06/06• Endpoint FIFO resetBefore using an endpoint, its FIFO should be reset. This action resets the FIFO pointerto its

Página 5

102 AT8xC5122/234202E–SCR–06/06Read/Write Data FIFORead Data FIFO The read access for each OUT endpoint is performed using the UEPDATX register.Af

Página 6

103 AT8xC5122/234202E–SCR–06/06Bulk / Interrupt TransactionsBulk and Interrupt transactions are managed in the same way.Bulk/Interrupt OUT Transac

Página 7

104 AT8xC5122/234202E–SCR–06/06Bulk/Interrupt OUT Transactions in Ping-Pong Mode (Endpoints 6)Figure 56. Bulk / Interrupt OUT Transactions in Pin

Página 8

105 AT8xC5122/234202E–SCR–06/06If the Host sends more bytes than supported by the endpoint FIFO, the overflow datawon’t be stored, but the USB con

Página 9

106 AT8xC5122/234202E–SCR–06/06Bulk/Interrupt IN Transactions in Ping-Pong ModeFigure 58. Bulk / Interrupt IN transactions in Ping-Pong modeAn en

Página 10 - AT8xC5122/23

107 AT8xC5122/234202E–SCR–06/06Control TransactionsSetup Stage The DIR bit in the UEPSTAX register should be at 0.Receiving Setup packets is the s

Página 11

108 AT8xC5122/234202E–SCR–06/06Isochronous TransactionsIsochronous OUT Transactions in Standard ModeAn endpoint should be first enabled and config

Página 12

109 AT8xC5122/234202E–SCR–06/06If the Host sends more bytes than supported by the endpoint FIFO, the overflow datawon’t be stored, but the USB con

Página 13

11 AT8xC5122/234202E–SCR–06/06Low Pin Count Package DescriptionAT8xC5122 and AT83C5123 versionsFigure 6. PLCC28 Package PinoutAT83C5123 version F

Página 14

110 AT8xC5122/234202E–SCR–06/06MiscellaneousUSB Reset The EORINT bit in the USBINT register is set by hardware when a End of Reset hasbeen detecte

Página 15

111 AT8xC5122/234202E–SCR–06/06Suspend/Resume ManagementSuspend The Suspend state can be detected by the USB controller if all the clocks are enab

Página 16

112 AT8xC5122/234202E–SCR–06/06Figure 59. Example of a Suspend/Resume ManagementUpstream Resume A USB device can be allowed by the Host to send a

Página 17

113 AT8xC5122/234202E–SCR–06/06Figure 60. Example of REMOTE WAKEUP ManagementUSB Controller InitDetection of a SUSPEND stateSPINTSet RMWUPE Suspe

Página 18

114 AT8xC5122/234202E–SCR–06/06Detach Simulation In order to be re-enumerated by the Host, the AT8xC5122/23 has the possibility to sim-ulate a DET

Página 19

115 AT8xC5122/234202E–SCR–06/06USB Interrupt SystemInterrupt System PrioritiesFigure 63. USB Interrupt Control SystemInterrupt Control System As

Página 20

116 AT8xC5122/234202E–SCR–06/06Figure 64. USB Interrupt Control Block DiagramTXCMPUEPSTAX.0RXOUTB0UEPSTAX.1RXSETUPUEPSTAX.2STLCRCUEPSTAX.3EPXIEUE

Página 21

117 AT8xC5122/234202E–SCR–06/06RegistersReset Value = 0000 0000bTable 64. USB Global Control Register - USBCON (S:BCh)76 5 43210USBE SUSPCLK SDRM

Página 22

118 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 65. USB Global Interrupt Register - USBINT (S:BDh)76543210- - WUPCPU EORINT SOFINT -

Página 23

119 AT8xC5122/234202E–SCR–06/06Reset Value = 0001 0000bReset Value = 1000 0000bTable 66. USB Global Interrupt Enable Register - USBIEN (S:BEh)- -

Página 24

12 AT8xC5122/234202E–SCR–06/06Figure 8. QFN32 Package Pinout CIOQFN32P3.1/TxDCCLKP5.0CC4DVCCCC8XTAL1LIVCCP3.7/LED3CVCCCVSSP3.6/LED2CRSTP1.2/CPRES

Página 25

120 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bReset Value = 1000 0000b when UEPNUM = 0Reset Value = 0000 0000b otherwiseTable 68. USB En

Página 26

121 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 70. USB Endpoint Status and Control Register X - UEPSTAX (S:CEh) X=EPNUM set in UEPN

Página 27

122 AT8xC5122/234202E–SCR–06/06Reset Value = XXXX XXXXbReset Value = 0000 0000bTable 71. USB FIFO Data Endpoint X (X=EPNUM set in UEPNUM Register

Página 28

123 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 73. USB Endpoint FIFO Reset Register - UEPRST (S:D5h)76543210- EP6RST EP5RST EP4RST

Página 29

124 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 74. USB Endpoint Interrupt Register - UEPINT (S:F8h read-only)76543210- EP6INT EP5IN

Página 30

125 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 75. USB Endpoint Interrupt Enable Register - UEPIEN (S:C2h)76543210- EP6INTE EP5INTE

Página 31

126 AT8xC5122/234202E–SCR–06/06Serial I/O Port The serial I/O port in the AT8xC5122/23 is compatible with the serial I/O port in the80C52.The I/O

Página 32

127 AT8xC5122/234202E–SCR–06/06Figure 67. UART Timings in Modes 2 and 3Automatic Address RecognitionThe automatic address recognition feature is

Página 33

128 AT8xC5122/234202E–SCR–06/06The SADEN byte is selected so that each slave may be addressed separately.For slave A, bit 0 (the LSB) is a don’t c

Página 34

129 AT8xC5122/234202E–SCR–06/06Figure 68. Timer 1 Baud Rate Generator Block DiagramInternal Baud Rate Generator When using the Internal Baud Rate

Página 35

13 AT8xC5122/234202E–SCR–06/06Pin DescriptionTable 2. Pin Description PortVQFP64VQFP32PLCC68PLCC28QFN64QFN32InternalPowerSupply ESD I/OReset Leve

Página 36

130 AT8xC5122/234202E–SCR–06/06Figure 70. Serial I/O Port Block Diagram (Mode 0)Transmission (Mode 0) To start a transmission mode 0, write to SC

Página 37

131 AT8xC5122/234202E–SCR–06/06Baud Rate Selection (Mode 0) In mode 0, baud rate can be either fixed or variable.As shown in Figure 73, the select

Página 38

132 AT8xC5122/234202E–SCR–06/06Figure 76. Data Frame Format (Mode 1)Modes 2 and 3 Modes 2 and 3 are full-duplex, asynchronous modes. The data fra

Página 39

133 AT8xC5122/234202E–SCR–06/06Baud Rate Selection (Modes 1 and 3)In modes 1 and 3, the Baud Rate is derived either from the Timer 1 or the Intern

Página 40

134 AT8xC5122/234202E–SCR–06/06Baud Rate Selection (Mode 2) In mode 2, the baud rate can only be programmed to two fixed values: 1/16 or 1/32 ofth

Página 41

135 AT8xC5122/234202E–SCR–06/06RegistersReset Value = 0000 0000b (Bit addressable)Table 77. Serial Control Register - SCON (98h)76543210FE/SM0 SM

Página 42

136 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bReset Value = 0000 0000bReset Value = XXXX XXXXbReset Value = 0000 0000bTable 82. Baud Rat

Página 43

137 AT8xC5122/234202E–SCR–06/06Serial Port Interface (SPI)Only for AT8xC5122.The Serial Peripheral Interface module (SPI) which allows full-duplex

Página 44

138 AT8xC5122/234202E–SCR–06/06Slave Select (SS) Each Slave peripheral is selected by one Slave Select pin (SS). This signal must staylow for any

Página 45

139 AT8xC5122/234202E–SCR–06/06Functional Description Figure 84 shows a detailed structure of the SPI module.Figure 84. SPI Module Block DiagramO

Página 46

14 AT8xC5122/234202E–SCR–06/06P2.6 49 - 62 - 49 - VCC 2KV I/O 1 A14 Port51 Push-pull KB_OUTInput WPUP2.7 46 - 57 - 46 - VCC 2KV I/O 1 A15 Port51 P

Página 47

140 AT8xC5122/234202E–SCR–06/06Figure 85. Full-duplex Master-Slave InterconnectionMaster Mode The SPI operates in Master mode when the Master bit

Página 48

141 AT8xC5122/234202E–SCR–06/06Figure 86. Data Transmission Format (CPHA = 0)Figure 87. Data Transmission Format (CPHA = 1)As shown in Figure 86

Página 49

142 AT8xC5122/234202E–SCR–06/06sions (Figure 88). This format may be preferable in systems having only one Master andonly one Slave driving the MI

Página 50

143 AT8xC5122/234202E–SCR–06/06Mode Fault flag, MODF: This bit becomes set to indicate that the level on the SS isinconsistent with the mode of th

Página 51

144 AT8xC5122/234202E–SCR–06/06Reset Value = 00010100bTable 85. Serial Peripheral Control Register - SPCON (C3h)76543210SPR2 SPEN SSDIS MSTR CPOL

Página 52

145 AT8xC5122/234202E–SCR–06/06Serial Peripheral Status Register (SPSTA)The Serial Peripheral Status Register contains flags to signal the followi

Página 53

146 AT8xC5122/234202E–SCR–06/06Serial Peripheral DATa Register (SPDAT)The Serial Peripheral Data Register (Table 87) is a read/write buffer for th

Página 54

147 AT8xC5122/234202E–SCR–06/06Timers/Counters The AT8xC5122D implements two general-purpose, 16-bit Timers/Counters. Althoughthey are identified

Página 55

148 AT8xC5122/234202E–SCR–06/06For normal Timer operation (GATE0= 0), setting TR0 allows TL0 to be incremented bythe selected input. Setting GATE0

Página 56

149 AT8xC5122/234202E–SCR–06/06Figure 92. Timer/Counter x (x = 0 or 1) in Mode 1Figure 93. Mode 1 Overflow Period FormulaMode 2 (8-bit Timer wit

Página 57

15 AT8xC5122/234202E–SCR–06/06P5.5 7 - 16 - 7 - VCC 2KV I/O 1 KB5 Port51 Push-pullInput WPDInput WPUP5.6 5 - 14 - 5 - VCC 2KV I/O 1 KB6 Port51 Pus

Página 58

150 AT8xC5122/234202E–SCR–06/06Mode 3 (Two 8-bit Timers) Mode 3 configures Timer 0 so that registers TL0 and TH0 operate as 8-bit Timers (seeFigur

Página 59

151 AT8xC5122/234202E–SCR–06/06• When Timer 0 is in mode 3, it uses Timer 1’s overflow flag (TF1) and run control bit (TR1). For this situation, u

Página 60

152 AT8xC5122/234202E–SCR–06/06Registers Timer/Counter Control RegisterReset Value = 0000 0000bTable 88. TCON (S:88h)76543210TF1 TR1 TF0 TR0 IE1

Página 61

153 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 89. Timer/Counter Mode Control Register - TMOD (S:89h)76543210GATE1 C/T1# M11 M01 GA

Página 62

154 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bReset Value = 0000 0000bReset Value = 0000 0000bReset Value = 0000 0000bTable 90. Timer 0

Página 63

155 AT8xC5122/234202E–SCR–06/06Keyboard Interface Only for AT8xC5122.Introduction The AT8xC5122/23 implements a keyboard interface allowing the co

Página 64

156 AT8xC5122/234202E–SCR–06/06Power Reduction Mode P5 inputs allow exit from idle and power-down modes as detailed in Section "Power-Down Mo

Página 65

157 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 95. Keyboard Input Enable Register - KBE (9Dh)76543210KBE7 KBE6 KBE5 KBE4 KBE3 KBE2

Página 66

158 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 96. Keyboard Level Selector Register - KBLS (9Ch)76543210KBLS7 KBLS6 KBLS5 KBLS4 KBL

Página 67

159 AT8xC5122/234202E–SCR–06/06Interrupt SystemIntroduction The AT8xC5122/23 implements an interrupt controller with 15 inputs but only 9 are used

Página 68

16 AT8xC5122/234202E–SCR–06/06PSEN 15 - 24 - 15 - VCC OProgram Strobe Enable: The read strobe to external program memory. When executing code from

Página 69

160 AT8xC5122/234202E–SCR–06/06Figure 100. Interrupt Control SystemIE0SPI SMART CARDINT1CPRESRXDRXEN01IE11001PRESITISEL.0ISEL.4RXITOEENISEL.2OELE

Página 70

161 AT8xC5122/234202E–SCR–06/06INT1 Interrupt Vector The INT1 interrupt is multiplexed with the following three inputs: • INT1 : Standard 8051 int

Página 71

162 AT8xC5122/234202E–SCR–06/06RegistersReset Value = 0000 0000b (Bit addressable)Table 98. Interrupt Enable Register 0 - IEN0 (A8h)76543210EA -

Página 72

163 AT8xC5122/234202E–SCR–06/06Reset Value = X0XX 00X0b (Bit addressable)Table 99. Interrupt Enable Register 1 - IEN1 (B1h) for AT8xC512276543210

Página 73

164 AT8xC5122/234202E–SCR–06/06Reset Value = X0XX 0XXXb (Bit addressable)Reset Value = X000 0000b (Bit addressable)Table 100. Interrupt Enable Re

Página 74

165 AT8xC5122/234202E–SCR–06/06Reset Value = X000 0000b (Not bit addressable)Table 102. Interrupt Priority High Register 0 - IPH0 (B7h)76543210-

Página 75

166 AT8xC5122/234202E–SCR–06/06Reset Value = X00X 00X0b (Bit addressable)Table 103. Interrupt Priority Low Register 1 - IPL1 (B2h) for AT8xC51227

Página 76

167 AT8xC5122/234202E–SCR–06/06Reset Value = X0XX 0XXXb (Bit addressable)Table 104. Interrupt Priority Low Register 1 - IPL1 (B2h) for AT83C51237

Página 77

168 AT8xC5122/234202E–SCR–06/06Reset Value = XXXX X000b (Not bit addressable)Table 105. Interrupt Priority High Register 1 - IPH1 (B3h) for AT8xC

Página 78

169 AT8xC5122/234202E–SCR–06/06Reset Value = X0XX 0XXXb (Not bit addressable)Table 106. Interrupt Priority High Register 1 - IPH1 (B3h) for AT83C

Página 79

17 AT8xC5122/234202E–SCR–06/06Typical ApplicationsRecommended External componentsAll the external components described in the figure and table bel

Página 80

170 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 107. Interrupt Enable Register - ISEL (S:A1h)76543210CPLEV - PRESIT RXIT OELEV OEEN

Página 81

171 AT8xC5122/234202E–SCR–06/06Interrupt Sources and VectorsNote: 1. Only fot AT8xC5122Table 108. Interrupt VectorsInterrupt SourcePolling Priori

Página 82

172 AT8xC5122/234202E–SCR–06/06Microcontroller ResetIntroduction The internal reset is used to start up (cold reset) or to re-start (warm reset) t

Página 83

173 AT8xC5122/234202E–SCR–06/06Power On Reset (POR) The role of the POR is to monitor the power supply rise of the microcontroller core andrelease

Página 84

174 AT8xC5122/234202E–SCR–06/06Figure 102. Static behaviour of POR and PFDFigure 103. Dynamic behaviour of POR and PFDVCoretInternalVPFDPVPFDM10

Página 85

175 AT8xC5122/234202E–SCR–06/06Reset pin As explained in the POR section there is no need to use the reset pin as the internalreset function at po

Página 86

176 AT8xC5122/234202E–SCR–06/06Reset Controlled by an External Superviser DeviceAs the reset pin can be forced in output by the Watch-Dog timer (W

Página 87

177 AT8xC5122/234202E–SCR–06/06Watchdog Timer The AT8xC5122/23 microcontrollers contain a powerfull programmable hardwareWatchdog Timer (WDT) that

Página 88

178 AT8xC5122/234202E–SCR–06/06Reset Value = XXXX X000bThe three lower bits (S0, S1, S2) located into WDTPRG register enables to program theWDT du

Página 89

179 AT8xC5122/234202E–SCR–06/06Table 111. Timeout value for FCK_WD = 24 MHz / X2Reset Value = XXXX XXXXbThe WDTRST register is used to reset / en

Página 90

18 AT8xC5122/234202E–SCR–06/06USB Keyboard with Smart Card Reader Using the AT8xC5122 and AT89C5122DS VersionsLEDxVCCKB1KB2KB3KB4KB5KB6KB7R19R18R1

Página 91

180 AT8xC5122/234202E–SCR–06/06Power ManagementBefore activating the Idle Mode or Power Down Mode, the CPU clock must be switchedto on-chip oscill

Página 92

181 AT8xC5122/234202E–SCR–06/06Figure 109. Power-down Exit WaveformExit from power-down by reset redefines all the SFRs, exit from power-down by

Página 93

182 AT8xC5122/234202E–SCR–06/06USB InterfaceSuspend The Suspend state can be detected by the USB controller if all the clocks are enabledand if th

Página 94

183 AT8xC5122/234202E–SCR–06/06Figure 110. Example of a Suspend/Resume ManagementSmart Card InterfaceEntering in Power-down Mode In order to redu

Página 95

184 AT8xC5122/234202E–SCR–06/06Keyboard Interface The keyboard interface applies only to AT8xC5122 version.Entering in Power-down Mode In order to

Página 96

185 AT8xC5122/234202E–SCR–06/06RegistersReset Value = 00X1 0000bPower-off flag reset value will be 1 only after a power on (cold reset). A warm re

Página 97

186 AT8xC5122/234202E–SCR–06/06Electrical Characteristics Absolute Maximum RatingsDC ParametersTA = -40 to +85°C; VSS = 0 V, FCK_CPU= 0 to 24 MHz

Página 98

187 AT8xC5122/234202E–SCR–06/06RRSTInternal reset pull-up resistor 5 10 30 kΩIPDPower down consumption60µA40µA200µA200µAVcc = 5.5VVcc = 3.6VICCIDL

Página 99

188 AT8xC5122/234202E–SCR–06/06ICC Current Test Conditions Figure 111. Power Down ModeFigure 112. Active and Idle ModeLED’sNote: 1. (TA = -20°C

Página 100

189 AT8xC5122/234202E–SCR–06/06Smart Card InterfaceCard VCC 5V (for IEC7816-3 Class A cards)Symbol Parameter Min Typ Max Unit Test ConditionsVcc P

Página 101

19 AT8xC5122/234202E–SCR–06/06USB Smart Card Reader Using the AT83C5123 VersionLEDxVCCGNDRSTOptionalCapacitorGNDGNDC1EAGNDGNDC8C9VCCVCCVCC AVCCXTA

Página 102

190 AT8xC5122/234202E–SCR–06/06Notes: 1. Test conditions, Capacitor 10 µF, Inductance 10 µH.2. Ceramic X7R, SMD type capacitor with minimum ESR or

Página 103

191 AT8xC5122/234202E–SCR–06/06Note: 1. The voltage on RST should remain between -0.3V and VCC+0.3V during dynamic operation. Note: 1. The voltage

Página 104

192 AT8xC5122/234202E–SCR–06/06USB Interface Figure 113. USB InterfaceSymbol Parameter Min Typ(5)Max UnitVREFUSB Reference Voltage 3.0 3.6 VVIHIn

Página 105

193 AT8xC5122/234202E–SCR–06/06AC ParametersExplanation of the AC SymbolsEach timing symbol has 5 characters. The first character is always a “T”

Página 106

194 AT8xC5122/234202E–SCR–06/06External Program Memory Read CycleTable 115. AC Parameters for a Variable ClockSymbol TypeStandard clock X2 Clock

Página 107

195 AT8xC5122/234202E–SCR–06/06External Data Memory CharacteristicsTable 116. Symbol DescriptionSymbol ParameterTRLRHRD Pulse WidthTWLWHWR Pulse

Página 108

196 AT8xC5122/234202E–SCR–06/06Table 117. AC Parameters for a Variable Clock (warning x value differ from AT89C51RD2)External Data Memory Write C

Página 109

197 AT8xC5122/234202E–SCR–06/06External Data Memory Read CycleSerial Port Timing - Shift Register ModeTable 118. Symbol Description (F = 40 MHz)T

Página 110

198 AT8xC5122/234202E–SCR–06/06Shift Register Timing WaveformExternal Clock Drive Characteristics (XTAL1) Table 120. AC ParametersExternal Clock

Página 111

199 AT8xC5122/234202E–SCR–06/06Float WaveformsFor timing purposes as port pin is no longer floating when a 100 mV change from loadvoltage occurs a

Página 112

2 AT8xC5122/234202E–SCR–06/06Reference Documents The user must get the following additionnal documents which are not included but whichcomplete th

Página 113

20 AT8xC5122/234202E–SCR–06/06Memory Organization The AT8xC5122/23 devices have separated address spaces for Program and DataMemory, as shown in F

Página 114

200 AT8xC5122/234202E–SCR–06/06This diagram indicates when signals are clocked internally. The time it takes the signalsto propagate to the pins,

Página 115

201 AT8xC5122/234202E–SCR–06/06Packaging InformationOrdering InformationStandardPart NumberLead free/ RoHSPart NumberMemory Size (bytes)Supply Vol

Página 116

202 AT8xC5122/234202E–SCR–06/06Note: 1. Check avaibility with sales officeAT89C5122DS-RDVIM AT89C5122DS-RDTUM 32K FLASH 3.0 - 5.5 Industrial 48 MH

Página 117

203 AT8xC5122/234202E–SCR–06/06Mechanical DimensionsPLCC28 Package

Página 118

204 AT8xC5122/234202E–SCR–06/06VQFP64 Package

Página 119

205 AT8xC5122/234202E–SCR–06/06PLCC68 Package

Página 120

206 AT8xC5122/234202E–SCR–06/06VQFP32 Package

Página 121

207 AT8xC5122/234202E–SCR–06/06QFN32 Package

Página 122

208 AT8xC5122/234202E–SCR–06/06QFN64 Package

Página 123

209 AT8xC5122/234202E–SCR–06/06Datasheet Revision HistoryChanges from 4202A to 4202B1. Product AT8xEC5122 added.2. Products AT83C5123 and AT83EC51

Página 124

21 AT8xC5122/234202E–SCR–06/06Data Memory ManagamentAll device versions implements :- 256 Bytes of RAM to increase data parameter handling and hig

Página 125

2104202E–SCR–06/06AT8xC5122/23Table of ContentsFeatures ...

Página 126

2114202E–SCR–06/06AT8xC5122/23Definitions... 6

Página 127

2124202E–SCR–06/06AT8xC5122/23Registers... 162

Página 128

Printed on recycled paper.4202E–SCR–06/06© Atmel Corporation 2006. All rights reserved. Atmel®, logo and combinations thereof, are registered tradema

Página 129

22 AT8xC5122/234202E–SCR–06/06An access to external XRAM memory locations higher than the accessible size of thememory (roll-over feature) will be

Página 130

23 AT8xC5122/234202E–SCR–06/06Figure 11. Use of Dual Pointera. Bit 2 stuck at 0; this allows to use INC AUXR1 to toggle DPS without changing GF3.

Página 131

24 AT8xC5122/234202E–SCR–06/06RegistersReset Value = 0XXX X000bTable 5. Auxiliary Register - AUXR (8Eh)76543210DPU - - - XRS0 EXTRAM AOBit Number

Página 132

25 AT8xC5122/234202E–SCR–06/06Table 6. Auxiliary Register 1 AUXR1- (0A2h) for AT8xC5122Reset Value = XX1X XX0X0b (Not bit addressable)Table 7. A

Página 133

26 AT8xC5122/234202E–SCR–06/06Reset Value = XXXX 0XXXbAT8xC5122’s CRAM and E2PROM VersionsThe AT8xC5122’s CRAM and E2PROM versions implements :- 3

Página 134

27 AT8xC5122/234202E–SCR–06/06When pin EA =1 and after the reset, the MCU begins the execution of the embeddedbootloader from location F800h of th

Página 135

28 AT8xC5122/234202E–SCR–06/06Using CRAM Memory The CRAM is a read / write volatile memory that is mapped in the program memoryspace. Then when th

Página 136

29 AT8xC5122/234202E–SCR–06/06Figure 13. AT8xC5122’s CRAM and E2PROM VersionsReset@<0000>EA = 0PROGRAM EXTERNALPROGRAMPSENReset@00007FFF800

Página 137

3 AT8xC5122/234202E–SCR–06/06Product Description AT8xC5122/23 products are high-performance CMOS derivatives of the 80C51 8-bitmicrocontrollers de

Página 138

30 AT8xC5122/234202E–SCR–06/06AT8xC5122’s ROM VersionThe AT8xC5122’s ROM version implements :- 32 K of ROM mapped from 0000h to 7FFFh in which is

Página 139

31 AT8xC5122/234202E–SCR–06/06Figure 14. AT8xC5122’s ROM VersionPROGRAM MEMORY(Read only)00007FFFFFFFEA=1INTERNAL32K ROMEA=0EXTERNALEXTERNALRESET

Página 140

32 AT8xC5122/234202E–SCR–06/06AT83C5123 Version The AT83C5123 device is a low pin count version of the AT8xC5122.The ROM version implements :- 30

Página 141

33 AT8xC5122/234202E–SCR–06/06Special Function Registers (SFR’s)Introduction The Special Function Registers (SFRs) of the AT8xC5122/23 can be rank

Página 142

34 AT8xC5122/234202E–SCR–06/06AT8xC5122 VersionNotes: 1. Mapping is done using SCRS bit in SCSR register. 2. Grey areas : do not write in.Bitaddre

Página 143

35 AT8xC5122/234202E–SCR–06/06AT83C5123 VersionNotes: 1. Mapping is done using SCRS bit in SCSR register. 2. Grey areas : do not write in.Bitaddre

Página 144

36 AT8xC5122/234202E–SCR–06/06SFR’s DescriptionNote: 1. Only for AT8xC5122Note: 1. Only for AT8xC5122Table 10. C51 Core SFRsMnemonicAddName 76543

Página 145

37 AT8xC5122/234202E–SCR–06/06Table 13. Timers SFRsMnemonicAddName 76543210TH0 8Ch Timer/Counter 0 High byte TH0TL0 8Ah Timer/Counter 0 Low byte

Página 146

38 AT8xC5122/234202E–SCR–06/06Note: 1. Only for AT8xC5122IPH0 B7hInterrupt Priority Control High 0PSH PT1HPX1HPT0HPX0HIPL1 B2hInterrupt Priority C

Página 147

39 AT8xC5122/234202E–SCR–06/06Note: 1. Only for AT8xC5122Note: 1. Only for AT8xC5122Notes: 1. Only for AT8xC5122SCICLK C1hSmart Card Frequency Pre

Página 148

4 AT8xC5122/234202E–SCR–06/06Note: The PLCC28 pinout is common to AT8xC5122 and AT83C5123 productsTable 1. Product versionsFeatures AT83C5122 AT8

Página 149

40 AT8xC5122/234202E–SCR–06/06 Note: 1. Only for AT8xC5122UEPIEN C2hUSB Endpoint Interrupt EnableEP6INTE EP5INTE EP4INTE EP3INTE EP2INTE EP1INTE E

Página 150

41 AT8xC5122/234202E–SCR–06/06Clock Controller The clock controller is based on an on-chip oscillator feeding an on-chip Phase LockLoop (PLL). All

Página 151

42 AT8xC5122/234202E–SCR–06/06Phase Lock Loop (PLL)PLL Description The AT8xC5122/23’s PLL is used to generate internal high frequency clock synchr

Página 152

43 AT8xC5122/234202E–SCR–06/06Figure 19. PLL Programming FlowClock Tree Architecture The clock controller outputs several different clocks as sho

Página 153

44 AT8xC5122/234202E–SCR–06/06Figure 20. Clock Tree DiagramCPU and Peripheral Clocks Two clocks sources are available for CPU and peripherals:– o

Página 154

45 AT8xC5122/234202E–SCR–06/06The CPU and peripherals clocks frequencies are defined in the table below.X1 and X2 Modes Use of on-chip oscillatorW

Página 155

46 AT8xC5122/234202E–SCR–06/06Figure 21. X1 modeWhen the X1 mode is selected, the CPU and Peripherals work at 8Mhz / X1Figure 22. X2 modeWhen th

Página 156

47 AT8xC5122/234202E–SCR–06/06Use of PLL Clock When the CPU clock is fed by the PLL, the X2 mode is forbidden. The bit X2 mustalways remain cleare

Página 157

48 AT8xC5122/234202E–SCR–06/06SCIB Clock The Smart Card Interface Block (SCIB) uses two clocks : – The first one, CK_IDLE, is the peripheral clock

Página 158

49 AT8xC5122/234202E–SCR–06/06If the CK_CPU <= 4/3 * CK_ISO, the SCIB doesn’t work.If the CK_CPU >= 6* CK_ISO, the programmer must take care

Página 159

5 AT8xC5122/234202E–SCR–06/06AT8xC5122 Block DiagramAT83C5123 Block DiagramDC/DCConverterLICVCCCVSSUARTInterfaceTxDRxD16-BITTIMERST[0-1]InterruptC

Página 160

50 AT8xC5122/234202E–SCR–06/06USB Interface Clock The USB Interface uses two clocks : – The first one is the CPU clock used for the interface with

Página 161

51 AT8xC5122/234202E–SCR–06/06Reset Value = X0X0 X000bTable 26. Clock Configuration Register 0 - CKCON0 (S:8Fh)76543210-WDX2- SIX2 - T1X2T0X2X2Bi

Página 162

52 AT8xC5122/234202E–SCR–06/06Reset Value = XXXX XXX0bReset Value = 0000 0000bReset Value = 0000 0000bTable 27. Clock Configuration Register 1 -

Página 163

53 AT8xC5122/234202E–SCR–06/06I/O Port DefinitionPorts vs Packages Table 30. I/O Number vs PackagesPort 0 Port 0 has the following functions: – D

Página 164

54 AT8xC5122/234202E–SCR–06/06Port 1 Port 1 has the following functions: – Default function : Only Port 1.2, P1.6 and P1.7 are standard I/O’s; the

Página 165

55 AT8xC5122/234202E–SCR–06/06Port 3 Port 3 has the following functions: – Default function: Port 3 is an 8-bit I/O port. – Alternate functions: s

Página 166

56 AT8xC5122/234202E–SCR–06/06Port 4 Port 4 has the following functions: – Default function: Port 4 is an 6-bit I/O port. – Alternate functions: s

Página 167

57 AT8xC5122/234202E–SCR–06/06Port ConfigurationStandard I/O P0 The P0 port is described in Figure 23.Figure 23. Standard Input/Output PortQuasi

Página 168

58 AT8xC5122/234202E–SCR–06/06The “Port51” is described in Figure 24.Figure 24. Quasi Bi-directional PortPush-pull Output Configuration The push-

Página 169

59 AT8xC5122/234202E–SCR–06/06Figure 26. Input with Pull-upInput with Weak Pull-down ConfigurationThe input with pull-down (input WPD) configurat

Página 170

6 AT8xC5122/234202E–SCR–06/06PinoutHigh Pin Count Package DescriptionAT8xC5122 version Figure 1. VQFP64 Package Pinout 62 61 60 59 58 63 575

Página 171

60 AT8xC5122/234202E–SCR–06/06Figure 29. LED Source CurrentNotes: 1. When switching a low level, LEDCTRL device has a permanent current of about

Página 172

61 AT8xC5122/234202E–SCR–06/06RegistersReset Value = 0000 0x00bReset Value = 00xx 0xxxbTable 36. Port Mode Register 0 - PMOD0 (91h) for AT8xC5122

Página 173

62 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bReset Value = xxxx 00xxbTable 38. Port Mode Register 1 - PMOD1 (84h) for AT8xC512276543210P

Página 174

63 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bReset Value = 0000 0000bTable 40. LED Port Control Register 0 - LEDCON0 (F1h)76543210LED3.1

Página 175

64 AT8xC5122/234202E–SCR–06/06Smart Card Interface Block (SCIB)The SCIB provides all signals to interface directly with a smart card. The complian

Página 176

65 AT8xC5122/234202E–SCR–06/06Block DiagramThe Smart Card Interface Block diagram is shown Figure 30: Figure 30. SCIB Block DiagramDefinitions Th

Página 177

66 AT8xC5122/234202E–SCR–06/06ATR Answer To Reset. Response from the ICC to a Reset initiated by the TerminalF and D F = Clock Rate Conversion Fa

Página 178

67 AT8xC5122/234202E–SCR–06/06IEC7816-3 says this procedure is mandatory in ATR for card supporting T=0 while EMVsays this procedure is mandatory

Página 179

68 AT8xC5122/234202E–SCR–06/06The Guard Time counter is an 9 bit counter It is initialized at 001h at the start of a trans-mission by the Terminal

Página 180

69 AT8xC5122/234202E–SCR–06/06Figure 32. Block Guard Time.Figure 33. Guard Time and Block Guard Time countersTo illustrate the use of Guard Time

Página 181

7 AT8xC5122/234202E–SCR–06/06Figure 2. PLCC68 Package Pinout (for engineering purpose only)18171615141311P0.1/AD1P0.3/AD3P0.5/AD5P0.7/AD7D+P4.1/M

Página 182

70 AT8xC5122/234202E–SCR–06/06When the WT counter times out, an interrupt is generated and the SCIB function islocked: reception and emission are

Página 183

71 AT8xC5122/234202E–SCR–06/06Figure 35. T=0 modeIn T=1 protocol : The maximum interval between the leading edge of the start bit of 2consecutive

Página 184

72 AT8xC5122/234202E–SCR–06/06Power-on and Power-off FSM The Power-on Power-off Finite State Machine (FSM) applies the signals on the smartcard in

Página 185

73 AT8xC5122/234202E–SCR–06/06Removal of the smart card will automatically start the power off sequence as describedin Figure 39.The SCIB deactiva

Página 186

74 AT8xC5122/234202E–SCR–06/06Additional FeaturesClock The CK_ISO input must be in the range 1 - 5 MHz according to ISO 7816.The CK_ISO can be pro

Página 187

75 AT8xC5122/234202E–SCR–06/06Transmit / Receive Buffer The contents of the SCIBUF Transmit / Receive Buffer is transferred or received into /from

Página 188

76 AT8xC5122/234202E–SCR–06/06Figure 43. CharacterTransmission DiagramSCIBUFTransmittedCharacterShift RegisterI/O pinSCTBESCTCSCISR registerSCTBI

Página 189

77 AT8xC5122/234202E–SCR–06/06Figure 44. Character Reception DiagramSCIB Reset The SCICR register contains a reset bit. If set, this bit generate

Página 190

78 AT8xC5122/234202E–SCR–06/06Alternate Card A second card named ‘Alternate Card’ can be controlled.The Clock signal CCLK1 can be adapted to the X

Página 191

79 AT8xC5122/234202E–SCR–06/06Reset Value = 0000 0000bTable 44. Smart Card Interface Control Register - SCICR (S:B6h, SCRS = 1)76543210RESET CARD

Página 192

8 AT8xC5122/234202E–SCR–06/06Figure 3. QFN64 Package Pinout 62 61 60 59 58 63 5756 55 54 53P0.1/AD1P0.3/AD3P0.5/AD5P0.7/AD7D+P4.1/MOSIP4.0/M

Página 193

80 AT8xC5122/234202E–SCR–06/06Reset Value = 0X00 0000bTable 45. Smart Card Contacts Register - SCCON (S:ACh, SCRS=0)76543210CLK - CARDC8 CARDC4 C

Página 194

81 AT8xC5122/234202E–SCR–06/06 Reset Value = 1000 0000bTable 46. Smart Card UART Interface Status Register -SCISR (S:ADh, SCRS=0)76 5 4 3210SCTBE

Página 195

82 AT8xC5122/234202E–SCR–06/06 Reset Value = 0X00 0000bNote: 1) In case of multiple interrupts occuring at the same time (sampled by the same edge

Página 196

83 AT8xC5122/234202E–SCR–06/06Reset Value = 0X00 0000bTable 48. Smart Card UART Interrupt Enabling Register - SCIER (S:AEh, SCRS=1)765 4 3210ESCT

Página 197

84 AT8xC5122/234202E–SCR–06/06Reset Value = X000 1000bReset Value = 0000 0000bTable 49. Smart Card Selection Register - SCSR (S:ABh)76543210- BGT

Página 198

85 AT8xC5122/234202E–SCR–06/06 Reset Value = 0XXX X001b Reset Value = 0111 0100bTable 51. Smart Card ETU Register 1 - SCETU1 (S:ADh, SCRS=1)76543

Página 199

86 AT8xC5122/234202E–SCR–06/06 Reset Value = 0000 1100b Reset Value = XXXX XXX0b Reset Value = 0000 0000bTable 53. Smart Card Transmit Guard Time

Página 200

87 AT8xC5122/234202E–SCR–06/06 Reset Value = 0000 0000b Reset Value = 0010 0101b Reset Value = 1000 0000bTable 56. Smart Card Character/Block Wai

Página 201

88 AT8xC5122/234202E–SCR–06/06Reset Value = 0X10 1111b (default value for a divider by two)DC/DC Converter The Smart Card voltage (CVCC) is suppli

Página 202

89 AT8xC5122/234202E–SCR–06/06mode by 20% by means of bit OVFADJ in DCCKPS register. When the current overflowcontroller is operating, the ICARDOV

Página 203

9 AT8xC5122/234202E–SCR–06/06AT89C5122DS version Figure 4. VQFP64 Package Pinout 62 61 60 59 58 63 5756 55 54 53P0.1/AD1P0.3/AD3P0.5/AD5P0.7

Página 204

90 AT8xC5122/234202E–SCR–06/06Figure 46. Card Vcc = 1.8V Initialization ProcedureMode RegulationDCCKPS[7]=1VCARDOK=1Set Timeout to 3 msTimeoutExp

Página 205

91 AT8xC5122/234202E–SCR–06/06Figure 47. Card Vcc = 3V Initialization ProcedureMode RegulationDCCKPS[7]=1VCARDOK=1Set Timeout to 3 msTimeoutExpir

Página 206

92 AT8xC5122/234202E–SCR–06/06Procedure for CVcc = 5volts The DC/DC pump mode must be selected (MODE = 0 in DCCKPS register). Thedetailed procedur

Página 207

93 AT8xC5122/234202E–SCR–06/06advised to decrement the BOOST[1:0] bits to restore the overflow current to its normalor desired value.Monitoring Pr

Página 208

94 AT8xC5122/234202E–SCR–06/06DC/DC Converter registerReset Value = 0000 0000bTable 61. DC/DC Converter Control Register - DCCKPS (S:BFh)76543210

Página 209

95 AT8xC5122/234202E–SCR–06/06USB Controller The AT8xC5122D implements a USB device controller supporting Full Speed datatransfer. In addition to

Página 210

96 AT8xC5122/234202E–SCR–06/06The only possible value for the wMaxPacketSize in the DFU configuration is 32 bytes,which is the size of the FIFO im

Página 211

97 AT8xC5122/234202E–SCR–06/06Figure 50. SIE Block DiagramFunction Interface Unit (UFI) The Function Interface Unit provides the interface betwee

Página 212

98 AT8xC5122/234202E–SCR–06/06Figure 52. Minimum Intervention from the USB Device FirmwareOUT Transactions:HOSTUFIC51OUT DATA0 (n Bytes)ACKEndpoi

Página 213 - Regional Headquarters

99 AT8xC5122/234202E–SCR–06/06ConfigurationGeneral Configuration • USB controller enableBefore any USB transaction, the 48 MHz required by the USB

Comentários a estes Manuais

Sem comentários