sm502gx00lf00-ac
sm502gx00lf00-ac
SM502
Mobile Multimedia
Companion Chip
Databook
Revision History
2.1 Feb 14, 2012 Updated the description of PLL2 in System Configuration
Updated Table 17-1 and 17-2 in Pin & Packaging Information
Notice
Silicon Motion, Inc. has made best efforts to ensure that the information contained in this document is accurate and
reliable. However, the information is subject to change without notice. No responsibility is assumed by Silicon Motion,
Inc. for the use of this information, nor for infringements of patents or other rights of third parties.
Copyright Notice
Copyright 2012, Silicon Motion, Inc. All rights reserved. No part of this publication may be reproduced, photocopied, or
transmitted in any form, without the prior written consent of Silicon Motion, Inc. Silicon Motion, Inc. reserves the right
to make changes to the product specification without reservation and without notice to our users
ii Version 2.00
Table of Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1
Typical System Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
UMA Architectures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
NAND Tree Scan Testing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Internal Block Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13
Host CPU Memory or PCI Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13
Command Interpreter / Command List Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
Zoom Video Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-18
2D Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-19
Video Display Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-20
LCD Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-22
Analog RGB (Analog LCD or CRT). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27
Internal or System Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27
GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27
Flat Panel Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-30
USB Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-30
DMA Controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-30
Interrupt Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-31
Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-31
Power Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-32
Memory Map and Register Space. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-34
MMIO Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-34
MMIO Addressing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-36
System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Functional Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1
Configuration 1 Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3
Command List Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Interrupt / Debug Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Power Management Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-25
Configuration 2 Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-39
PCI Configuration Space. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1
Drawing Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Functional Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Programmer’s Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1
2D Drawing Engine Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
Color Space Conversion Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20
Display Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Programmer’s Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1
Register Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Panel Graphics Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Video Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-18
Video Alpha Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27
Panel Cursor Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34
Alpha Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37
CRT Graphics Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-42
CRT Cursor Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-50
iii
iv
vi
1 Introduction
Overview
The SM502 is a Mobile Multimedia Companion Chip (MMCC™) device, packaged in a 297-pin BGA and
backward-compatible with the SM501. Designed to complement needs for the embedded industry, it provides
video and 2D capability. To help reduce system costs, it supports a wide variety of I/O, including analog RGB
and digital LCD Panel interfaces, 8-bit parallel interface, USB, UART, IrDA, two Zoom Video interfaces,
AC97 or I2S, SSP, PWM, and I2C. There are additional GPIO bits that can be used to interface to external
devices as well.
The 2D engine includes a front-end color space conversion with 4:1 and 1:8 scaling support. The video engine
supports two different video outputs (Dual Monitor), at 8-bit, 16-bit, or 32-bit per pixel and a 3-color hardware
cursor per video output. The LCD panel video pipe supports a back-end YUV color space conversion with 4:1
and 1:212 scaling. A Zoom Video (ZV) port is also included to interface to external circuitry for MPEG decode
or TV input.
8b
8051 µ-controller
Host CPU Host or PCI
Intel XScale, Digital
MIPS or Hitachi 32b
SH4) LCD Panel
ZV Port
MPEG/TV SM502 Core
Analog
Analog LCD
or CRT
ZV Port
MPEG/TV
AC97 32b
or I²S
UART (2x)
Audio SDRAM
or IrDA (2x),
CODEC 2 to 64 MB
I²C
Introduction 1-1
Memory Type / Interface Host Interface (PCI or memory) Frame Memory Interface
Figure 1-2 shows a possible system configuration with the SM502 connected through a CPU SRAM-like
memory interface.
System Flash
LCD Panel
ZV Port
(digital)
MPEG-2 Decoder I2C Bus
SM502 PWM (3x)
Stereo
Audio
USB Host
(1x)
1-2 Introduction
UMA Architectures
The SM502 supports three different system configurations, two of which are Unified Memory Architecture
(UMA) where the system memory and frame buffer share the memory. Figure 1-3 shows the possible
configurations.
Configuration A is a configuration without UMA and has the highest performance. The System SDRAM
contains the system memory and the local SDRAM contains the frame buffer. The SM502 acts as a slave on the
Host Bus Interface of the CPU. It controls the local SDRAM. The SM502 can also access the system SDRAM
by acquiring the bus and act as a master.
Configuration B is an UMA architecture where the system SDRAM contains both the system memory and the
frame buffer. The SM502 acts as a slave on the Host Bus Interface of the CPU. The CPU can burst to the
system SDRAM as normal, and the SM502 can access the system SDRAM by acquiring the bus and act as a
master. Bandwidth is very limited in this configuration since both the CPU and the SM502 compete for the
same Host Bus Interface.
Configuration C is the preferred UMA architecture where the local SDRAM contains both the system memory
and frame buffer. Since the local SDRAM bus runs at 150 MHz, there is more bandwidth in this configuration
than in configuration B. The SM502 acts as a slave on the Host Bus Interface of the CPU.
A B C
System System
SDRAM SDRAM
Master
Master
Slave
Slave
Slave
Memory Memory
Controller Controller
Local Local
SDRAM SDRAM
Introduction 1-3
General Information
The SM502 NAND Tree scan test circuit is a long chain of 2-input NAND gates. The first pin of the NAND
chain is an input, the last pin of the chain is an output. In order to set up the SM502 for NAND Tree scan
testing, program the Test pin to 0x1. None of the VDD pins and Analog pins RED, GREEN, BLUE, IREF, and
Test pins are included in the scan chain.
Table 1-2 shows the order of the pins in the NAND Tree scan test.
1. GPIO0
2. TESTCLK
3. CLKOFF
4. CD31
5. CD30
6. CD29
7. CD28
8. CD27
9. CD26
10. CD25
11. CD24
12. CD23
13. CD22
14. CD21
15. CD20
16. CD19
17. CD18
18. CD17
19. CD16
20. CA25
1-4 Introduction
21. CA24
22. CA23
23. CA22
24. CA21
25. CA20
26. CA19
27. CA18
28. CA17
29. CA16
30. CA15
31. CA14
32. CA13
33. CA12
34. INTR
35. BS#
36. HRAS#
37. HCAS#
38. HWE#
39. CPURD#
40. HRDY#
41. HCS#
42. MCS#1
43. MCS#0
44. BREQ#
45. ACK#
46. HCLK
47. HCKE
48. BE3
49. BE2
Introduction 1-5
50. BE1
51. BE0
52. RST#
53. CA11
54. CA10
55. CA9
56. CA8
57. CA7
58. CA6
59. CA5
60. CA4
61. CA3
62. CA2
63. CD15
64. CD14
65. CD13
66. CD12
67. CD11
68. CD10
69. CD9
70. CD8
71. CD7
72. CD6
73. CD5
74. CD4
75. CD3
76. CD2
77. CD1
78. CD0
1-6 Introduction
79. MD0
80. MD1
81. MD2
82. MD3
83. MD4
84. MD5
85. MD6
86. MD7
87. MD15
88. MD14
89. MD13
90. MD12
91. MD11
92. MD10
93. MD9
94. MD8
95. DQM0
96. DQM1
97. WE#
98. CAS#
99. RAS#
100. CS#
101. BA0
102. BA1
103. MA0
104. MA1
105. MA2
106. MA3
107. MA4
Introduction 1-7
108. MA5
109. MA6
110. MA7
111. MA8
112. MA9
113. MA10
114. MA11
115. MA12
116. DSF
117. CKE
118. SCK+
119. DQS
120. DQM3
121. DQM2
122. MD24
123. MD25
124. MD26
125. MD27
126. MD28
127. MD29
128. MD30
129. MD31
130. MD23
131. MD22
132. MD21
133. MD20
134. MD19
135. MD18
136. MD17
1-8 Introduction
137. MD16
138. FP2
139. FP3
140. FP4
141. FP5
142. FP6
143. FP7
144. FP10
145. FP11
146. FP12
147. FP13
148. FP14
149. FP15
150. FP18
151. FP19
152. FP20
153. FP21
154. FP22
155. FP23
156. FPEN
157. BIAS
158. VDEN
159. FPCLK
160. FP_VSYNC
161. FP_HSYNC
162. FP_DISP
163. CRT_VSYNC
164. CRT_HSYNC
165. VP_CLK
Introduction 1-9
166. VP_VSYNC
167. VP_HREF
168. GPIO63
169. GPIO62
170. GPIO61
171. GPIO60
172. GPIO59
173. GPIO58
174. GPIO57
175. GPIO56
176. GPIO55
177. GPIO54
178. GPIO53
179. GPIO52
180. GPIO51
181. GPIO50
182. GPIO49
183. GPIO48
184. GPIO47
185. GPIO46
186. GPIO45
187. GPIO44
188. GPIO43
189. GPIO42
190. GPIO41
191. GPIO40
192. GPIO39
193. GPIO38
194. GPIO37
1 - 10 Introduction
195. GPIO36
196. GPIO35
197. GPIO34
198. GPIO33
199. GPIO32
200. GPIO31
201. GPIO30
202. GPIO29
203. GPIO28
204. GPIO27
205. GPIO26
206. GPIO25
207. GPIO24
208. GPIO23
209. GPIO22
210. GPIO21
211. GPIO20
212. GPIO19
213. GPIO18
214. GPIO17
215. GPIO16
216. GPIO15
217. GPIO14
218. GPIO13
219. GPIO12
220. GPIO11
221. GPIO10
222. GPIO9
223. GPIO8
Introduction 1 - 11
224. GPIO7
225. GPIO6
226. GPIO5
227. GPIO4
228. GPIO3
229. GPIO2
1 - 12 Introduction
Command 32-bit
Interpreter
HIF 32-bit
Display
Controller SSP
ZVPort UART/IrDA
2D I2C
Memory
Interface GPIO
Arbiter and
Memory USB Host PWM
Controller
I2S
SDRAM
DMA
SRAM 8051
The SM502 supports two mutually exclusive modes of interfacing with the host CPU. The first option is to
configure the SM502 as a memory-mapped device located off the host system’s CPU to memory interface. In
this case, the SM502 supports a 32-bit interface for commands/status and a 32-bit interface for data transfer.
With a typical Intel XScale processor interface, this allows for a peak bandwidth of 400 MB/s.
For UMA designs, the SM502 supports an 8x32-bit memory cache at the host interface.
Introduction 1 - 13
The second configuration option is to use the SM502 as a PCI device on a PCI bus. In this mode, the SM502
supports PCI-1X and 2X for a maximum bus throughput of 266 MB/s.
The following sections summarize the interface connections between the SM502 and a host CPU or PCI bus.
See the SM502 MMCC Design Guide for more information.
Hitachi SH4
When the SM502 is interfaced to the Hitachi SH4 host bus, it can run in two different host interface modes:
IRL[3:0]# INTR
BREQ# BREQ#
BACK# ACK#
A[25:17] CA[25:17]
A[16:15] CA[16:15]
A[14:2] CA[14:2]
WE[3:0] BE[3:0]
DATA[31:0] CD[31:0]
CS1# or CS4# HCS#
BS# BS#
CPURD#
RDY# HRDY#
RAS# HRAS#
RD#/CAS# HCAS#
CS2# MCS1#
CS3# MCS0#
CKE
MCS0# SDRAM0
MCS1# SDRAM1
MDCLK
MCAS#
MRAS#
MWS#
MD[31:0]
DQM[3:0]
MA[12:0]
BA[1:0]
CKE
1 - 14 Introduction
Design Notes:
1. During the SM502 Bus Master mode, because the SH4 always drives the SDRAM clock, the timing for the
SDRAM signals being driven by the SM502 (CAS#, RAS#, WE#, data, etc.) must reference the memory
MDCLK input and meet the memory specifications.
2. In the SM502 Slave mode, the SH4 CPU drives RD/WR# (WE#) for the SM502 and SDRAM. In Bus
Master mode, the SM502 drives this line.
3. The SH4 supports up to 64 MB with each chip select. Depending on the memory size and configuration,
address [14:12] can be used for the bank address or the memory address. The design shown in Figure 1-5
supports two groups of 64MB memory.
4. The SM502 works as a byte-enable SRAM with the SH4. The SH4 supports byte-enable SRAM only with
CS1 or CS4.
5. The SH4 can be programmed for 4-level or 16-level interrupts. The SM502 interrupt output can be
connected to one of the 4-level interrupt inputs, depending on the system and software designs. To connect
to a 16-level interrupt, an external circuit is required.
6. For a discussion of clock buffering, see the SM502 MMCC Design Guide.
XScale
When the SM502 is interfaced to the XScale host bus, it can run in two different host interface modes:
Introduction 1 - 15
MBREQ#/GPIO14 BREQ#
MBACK#/GPIO13 ACK#
A[25, 9:2] CA[25, 9:2]
A[24:23] CA[24:23]
A[22:10] CA[22:10]
DQM[3:0] BE[3:0]
DATA[31:0] CD[31:0]
One of nCS[5:0] HCS#
nPWE/GPIO49 BS#
nOE CPURD#
RDY/GPIO18 HRDY#
SDCLK1 HCLK
SDCKE1 HCKE
nWE HWS#
nSDRAS HRAS#
nSDCAS HCAS#
MCS1#
nSDCS0 MCS0#
System SDRAM
MCS#
MDCLK
MCAS#
MRAS#
MWS#
MD[31:0]
DQM[3:0]
MA[12:0]
BA[1:0]
CKE
Design Notes:
1. In Bus Master mode, the SM502 drives the clock to SDRAM, and the CPU must 3-state the clock line. In
Slave mode, the CPU drives the clock to both the SM502 and SDRAM.
2. The XScale processor only has one 3-stateable SDRAM CS line. Thus the SM502 can support only one
group of SDRAMs in Bus Master mode.
3. According to the XScale specification, SDRAM must use SDCLK2 or SDCLK1. The variable latency I/O
must use either SDCLK0 (synchronous) or no clock. Because the SM502 has to drive the SDRAM clock
on the same line, SDCLK1 is used.
4. According to the XScale specification, the variable latency I/O device can use one of nCS[5:0] as the chip
select.
5. The XScale processor does have a dedicated interrupt input. Use one of GPIO[8:2] and configure the
selection as an interrupt via software.
1 - 16 Introduction
When the SM502 is interfaced to the NEC VR4122/31 MIPS host bus, it can run in two different host interface
modes:
SDRAS# HRAS#
SDCAS# HCAS#
CS1# MCS1#
CS0# MCS0#
Introduction 1 - 17
PCI Bus
Figure 1-8 shows a typical system-level hookup between the SM502 device and the PCI bus.
C_BE[3:0]# CA[20:17]
INTA# INTR
AD[31:0] CD[31:0]
REQ# BREQ#
GNT# ACK#
FRAME# CA25
IRDY# CA24
TRDY# CA23
STOP# CA22
DEVSEL# CA21
PAR CA16
IDSEL CA15
CLKRUN# CA14
CLK HCLK
RST# RST#
This module is provided as an aid to the graphics controller and is used to move data from system memory to
the graphics engine, executing a “Command List” placed in the shared memory. The Command Interpreter is
capable of making decisions (such as a branch to another part of memory) and wait for events or conditions
inside other modules.
The SM502 includes two Zoom Video (ZV) ports to allow the use of external MPEG decoders for DVD
playback, external TV tuners, and other sources. This interface supports the YUV 4:2:2, YUV 4:2:2 with byte
swap and RGB 5:6:5 data formats. It also supports ITU656-8 bit.
The standard ZV port uses an 8-bit interface at 72MHz. However, if desired, an extra 8 bits in the GPIO
interface may be used to interface to ICs that only support a 16-bit ZV interface or uses the extra 8 bits for the
second ZV port input. The pins used for the ZV interface are designated GPIO pins. See the SM502 MMCC
Design Guide for more information.
Note that the ZV input to video display path is as follows: ZV port Æ capture Æ frame buffer Æ video scalar
Æ display. The capture portion supports a 1:1 or 2:1 reducing. In addition, the video scalar will allow arbitrary
scaling from 1:1 to 4:1 on shrinking and 1:1 to 1:212 on expansion; however, the quality of the expansion will
be degraded beyond 1:8. This will easily allow 4:3 and 16:9 conversion, full screen PAL, and
picture-in-picture.
See Chapter 10 for more information about the ZV Port registers. See the SM502 MMCC Design Guide for
more information about interfacing the SM502 to external sources.
1 - 18 Introduction
2D Engine
The SM502 provides industry-leading 2D acceleration through the combination of an optimized 128-bit 2D
drawing engine and a high bandwidth link to local frame memory. The 2D engine also contains a command
interpreter (an enhanced DMA engine) that can intelligently fetch operands out of the frame buffer at up to
600MB/s. The command interpreter can conditionally branch to another location in memory, wait for status
from another module, etc. as it fetches and interprets commands.
The 2D drawing engine also contains a color space conversion unit. The color space conversion unit allows for
direct translation from many YUV formats into RGB. The 2D drawing engine also contains a bi-linear scalar,
which supports 4:1 shrink and 1:2 16 stretch.
As noted previously, the SM502 supports frame memory in UMA, and local 32-bit modes. With 32 bits of
SDRAM running at 144 MHz, the SM502’s DMA engine has 600MB/s of memory bandwidth to use for
fetching 2D operands and data. (The UMA solution’s performance is dependent on the host system’s topology.)
This high memory bandwidth allows the 2D engine to run at full speed without costly waits or pipeline stalls
from the frame buffer.
1. BitBlt (from system/local memory to system/local memory) with 256 raster operations. Pattern is
selectable between 8x8 monochrome pattern, 8x8 color pattern or another surface located in either system
or local memory.
2. Transparent BitBlt with the same capabilities as the previous command, but only the source or destination
can be transparent (either ColorKey or ChromaKey).
3. Alpha BitBlt with a constant alpha value.
4. Rotation BitBlt for any block size. This feature allows high speeds conversion between landscape and
portrait display without the need for special software drivers. (90° , 180° , 270° .)
5. YUV to 16-bit/32-bit RGB Blt conversion with 1:216 stretch or 4:1 shrink to provide high speeds video in
common format.
6. Auto-wrapping for smooth scrolling support for navigational or other data.
7. Support for tiled memory to optimize performance for 2D operations and rotation.
As noted previously, the 2D Drawing Engine has a 112 MHz clock and a 128-bit wide memory access path.
With 8-bpp colors, the 2D engine can process 2400M pixels/s, and with 16-bpp the 2D engine can process
1200M pixels/s.
See Chapter 4 for more information about the 2D Drawing Engine.
Performance
By using a UMA architecture, the number of operations required by the graphics driver is less because there is
no need to transfer data between host bitmaps and device bitmaps – they are the same in a UMA architecture.
Also, both the Command Interpreter and the Color Space Conversion with Scaling will reduce the CPU
utilization considerably – in the order of a 50% reduction. The reason behind this reduction is that the CPU
does not have to convert the YUV color space into a RGB color space and the CPU does not have to wait until
the drawing engine is finished.
Also, a sophisticated Command Interpreter algorithm can reduce the number of operations by looking into the
command list for instructions still to be scheduled and combine certain instructions into one instruction.
Introduction 1 - 19
As shown in Figure 1-9, the SM502 supports seven layers of display frames (2x hardware cursor, primary
graphics, video, video alpha, alpha, and secondary graphics). (See Chapter 5 for more information about the
Display Controller.)
Hardware Cursor
64x64, 2-bpp color
FIFO merge Panel
Alpha Layer
4 bits ·, 4/12-bpp color, FIFO alpha blend
16-bpp transparent color
To display text or drawings on the analog output (CRT) for multi-monitor function.
• 8-bpp (index into RGB 8:8:8 lookup table).
To alpha-blend and/or color-key an image on top of the Primary Graphics and Video layer outputs.
• 16-bpp (4-bit alpha, 4-bit Red, 4-bit Green, 4-bit Blue) or RGB 5:6:5.
• 16-bit transparency register (with 16-bit RGB 5:6:5 mode); if a color matches the register’s value it is transparent.
1 - 20 Introduction
• 4-bit planar blending register (in 16-bit RGB 5:6:5 mode only) to blend all pixels on the plane (that are
non-transparent) to one planar alpha value.
• 8-bpp (4-bit alpha, 4-bit index color), or 8-bit index (index into RGB 8:8:8 lookup table).
• 16-bpp (4-bit alpha, 4-bit Red, 4-bit Green, 4-bit Blue) or RGB 5:6:5.
• 8-bit transparency register (with 8-bit index), or 16-bit transparency register (with 16-bit RGB 5:6:5 mode); if a color
matches the register’s value it is transparent.
• 4-bit planar blending register (in 16-bit RGB 5:6:5 mode only) to blend all pixels on the plane (that are
non-transparent) to one planar alpha value.
• 8-bit (with 8-bit index), 16-bit (with 16-bit RGB 5:6:5), or 32-bit (with 32-bit RGB 8:8:8) color key register. If the
color value matches the register’s value, the color is transparent and the pixel from the Primary Video layer will be
shown instead.
Terminology
RGB 5:6:5 – 16-bit color mode, where Red has 5 bits, Green has 6 bits, and Blue has 5 bits.
RGB 8:8:8 – 32-bit color mode, where Red has 8 bits, Green has 8 bits, and Blue has 8 bits. The upper 8
bits are unused.
Introduction 1 - 21
Alpha – A means of blending two layers together. The fundamental equation is (α * c) + (1 - α) * (original
pixel), where c is the 4-bit color that points into the 18-bit lookup table. In practical terms, 4-bit alpha
blending means that for two given display layers, one layer is dominant (e.g. video layer) and the other
layer (e.g. video alpha) has 16 levels of transparency from 100% to 0% that may be applied to the colors in
that layer.
LUT – Lookup table; a means to map an 8-bit color index into a 24-bit color space, thus a smaller number
of simultaneous colors (8-bit) but with a wide range of colors (24-bit) to choose from.
Display Resolution
The SM502 supports display resolutions up to 1280 x 1024. 16:9 formats in this range (e.g. 800 x 480,
1024 x 600, and 1280 x 768) are supported. Note that there are trade-offs between the maximum resolution, the
number of active video layers, and the frame memory choice.
Dual Display
The SM502 supports Dual Display, i.e. two different displays of the same or different resolutions.
As shown in Figure 1-9, only the panel pipe supports the video and alpha planes. However, since these planes
fetch data from the frame buffer memory as well, there might not be enough bandwidth to enable the video and
alpha planes in Dual Display mode.
In order to display video on the panel pipe in Dual Display mode and on the CRT pipe in any mode, the 2D
Engine’s Color Space Conversion and Stretching functionality should be used.
LCD Panel
The SM502’s LCD logic block will drive an 18-bit or 24-bit TFT panel directly. Eight-bit and 12-bit CSTN
panels are also supported, and a dithering engine will support them to an effective 18-bit resolution. The
maximum supported panel size is 1280 x 1024. Panel power sequencing is through software control.
Figure 1-10 shows a typical interface between the SM502 and a 24-bit TFT panel. Note the following with
regards to this interface:
1. The timings of VDEN, FPEN, and BIAS are fully controlled by software.
2. The TFT panel does not use Vbias. The BIAS control used here controls the On/Off switch of the
backlights. Program its timing so backlight is on after 12V is applied to the inverter.
3. The SM502 provides three PWM signals that can be used to control brightness.
4. To support a 24-bit TFT panel, use pins GPIO[63:58]. The pins are then limited to use as digital 8-bit TV
data out and 8- or 16-bit video capture.
See the SM502 MMCC Design Guide for information about interfacing to LCD displays.
1 - 22 Introduction
FP7 B7
FP6 B6
FP5 B5
FP4 B4
FP3 B3
FP2 B2
GPIO57 B1
GPIO56 B0
FPCLK FPCLK
FP_HSYNC LP/HSYNC
FP_VSYNC FP/VSYNC
FP_DISP DE
VDEN Power Controller +5V or +3.3V
Backlight On/Off
Brightness CNTL
Introduction 1 - 23
Figure 1-11 shows a typical interface between the SM502 and an 18-bit TFT panel.
FP23 R5
FP22 R4
FP21 R3
FP20 R2
FP19 R1
FP18 R0
FP15 G5
FP14 G4
FP13 G3
FP12 G2
FP11 G1
FP10 G0
FP7 B5
FP6 B4
FP5 B3
FP4 B2
FP3 B1
FP2 B0
FPCLK FPCLK
FP_HSYNC LP/HSYNC
FP_VSYNC FP/VSYNC
FP_DISP DE
VDEN Power Controller +5V or +3.3V
Backlight On/Off
Brightness CNTL
1 - 24 Introduction
Figure 1-12 shows a typical interface between the SM502 and a 24-bit LVDS transmitter.
GPIO60 TXIN0
GPIO61 TXIN1
FP18 TXIN2
FP19 TXIN3
FP20 TXIN4
FP23 TXIN5
FP21 TXIN6
GPIO58 TXIN7
GPIO59 TXIN8
FP10 TXIN9
FP14 TXIN10
FP15 TXIN11
FP11 TXIN12
FP12 TXIN13
FP13 TXIN14
GPIO56 TXIN15
FP6 TXIN16
FP7 TXIN17
GPIO57 TXIN18
FP2 TXIN19
FP3 TXIN20
FP4 TXIN21
FP5 TXIN22
TXIN23
FP_HSYNC TXIN24
FP_VSYNC TXIN25
FP_DISP TXIN26
FP22 TXIN27
FPCLK TXCLK
VDEN PWR_DOWN#
Introduction 1 - 25
Table 1-3 compares the display data between the TFT panel, LVDS, and digital out.
GPIO63 G2 R4
GPIO62 G1 R3
FP23 R7 R5 TXIN5 R0
FP22 R6 R4 TXIN27 G0
FP21 R5 R3 TXIN6 B0
FP20 R4 R2 TXIN4 R1
FP19 R3 R1 TXIN3 R0 B2 G5 G1
FP18 R2 R0 TXIN2 G0 R3 B5 B1
GPIO61 R1 TXIN1 G0 R2
GPIO60 R0 TXIN0 B4 R1
FP15 G7 G5 TXIN11 B0 G3 R6 R2
FP14 G6 G4 TXIN10 R1 B3 G6 G2
FP13 G5 G3 TXIN14 G1 R4 B6 B2
FP12 G4 G2 TXIN13 B1 G4 R7 R3
FP11 G3 G1 TXIN12 R2 B4 G7 G3
FP10 G2 G0 TXIN9 G2 R5 B7 B3
GPIO59 G1 TXIN8 B3 R0
GPIO58 G0 TXIN7 B2 G5
FP7 B7 B5 TXIN17
FP6 B6 B4 TXIN16
FP5 B5 B3 TXIN22
FP4 B4 B2 TXIN21
FP3 B3 B1 TXIN20
FP2 B2 B0 TXIN19
GPIO57 B1 TXIN18 B1 G4
GPIO56 B0 TXIN15 B0 G3
1. For Digital Out, program bit 25 of the Miscellaneous Control Register at offset 0x4 to 0 and bits [31:23] of the GPIO63:32
Control Register at offset 0xC to 0x1FF.
2. For 24-bit TFT, program bit 25 of the Miscellaneous Control Register at offset 0x4 to 1 and bits [29:24] of the GPIO[63:32]
Control Register at offset 0xC to 0x3F.
1 - 26 Introduction
The analog RGB block contains a 24-bit DAC (RGB 8:8:8) to drive an external analog RGB interface. The
200MHz DAC will easily support the maximum resolution of 1280 x 1024. See the SM502 MMCC Design
Guide for information about interfacing the SM502 to analog RGB devices.
The SM502’s advanced 2D and video capabilities, when combined with a large fully-functioned display can
require a high memory bandwidth. However, this higher graphics performance comes at a higher cost. Each
system designer must carefully trade-off considerations of cost, performance, display resolution, number of
display planes, etc. to arrive at the optimal system design for their application. To work well in a broad variety
of applications, the SM502 supports the use of two different memory interfaces.
For lower cost applications willing to accept the trade-offs of lower performance, lower display resolution
and/or fewer display planes, the SM502 supports a Unified Memory Architecture (UMA) model. In the UMA
model, the host processor has no local memory. Therefore all host memory is shared with frame buffer memory
with the commensurate performance impacts. However, for systems willing to accept lower resolution panels,
the UMA design can provide for a very low cost solution.
For higher performance applications, the SM502 supports the use of an external 32-bit frame buffer. When
using a 32-bit frame buffer, the SM502 uses a 2-64 MB system memory interface that will work with SDRAM.
A data bus width of 32-bit provides a memory bandwidth of 600MB/s (SDRAM @ 150MHz). In this case, the
SM502 supports a 32-bit interface to the host processor (either via PCI or the host memory interface).
For designs using frame buffers, the SM502 also allows the use of 16MB to 64MB SDRAM internal to the
SM502 MCB package. This allows minimal footprint impact to the system design as well as minimizing the
layout and electrical constraints associated with using external SDRAM.
See the SM502 MMCC Design Guide for information about interfacing the SM502 to local memory.
GPIO
The SM502 provides 64 bits of GPIO. 57 of these bits are multiplexed and may be used to support special
features or used to support standard GPIO under software control. Bits 48-54 of GPIO can be programmed as
an interrupt input from external devices. Figure 1-13 shows the layout of the GPIO bits.
The 24-bit TFT panel interface, 16-bit ZV port interface and 8-bit Digital CRT interface are multiplexed. Four
configurations can be supported with GPIO[63:56]:
• Configuration 1: 24-bit TFT panel interface and 8-bit ZV port interface
• 18-bit TFT panel interface, 8-bit ZV port interface and 8-bit Digital CRT interface
Introduction 1 - 27
55 ZVCLK CLOCK
8051 µ-Controller
The SM502’s 8051 µ-controller can be programmed to use its 8-bit parallel interface with control signals to
follow any protocol (GPIO bits 0-15). The maximum speed of the 8051 µ-controller is 80 MHz.
ZV Port
Most ZV-compatible ICs support an 8-bit wide ZV port. The SM502 includes this functionality using GPIO
pins 16-23. However, some ICs may only support a 16-bit ZV interface. To support these ICs, GPIO bits 56-63
may be used to add the extra 8 bits to the ZV interface.
Note: The upper 8 bits (bits 56-63) are multiplexed with the Digital CRT and Flat Panel Data [17:16,9:8,1:0].
AC Link / I2S
The SM502 provides an AC Link interface on GPIO bits 24-28. This is a standard 48kHz AC Link interface
that interfaces to an AC97 CODEC.
If a higher quality audio solution is required, the SM502 includes an I2S interface that can be used instead of
the AC97 interface. The GPIO bits are multiplexed with the AC Link interface.
For enhanced audio playback using DMA, the 8051 µ-controller can be used. The audio data is transferred into
the 8051 µ-controller SRAM using the DMA engine, and the 8051 µ-controller will copy the data to the AC
Link interface one per clock.
PWM Interface
Three independent PWM outputs (bits 29-31 of GPIO) are provided for generic use. Each output has its own
control registers to select its frequency independently.
1 - 28 Introduction
SSP Interface
The SM502 provides 2x5 special bits (bits 32-36 and 41-45 of GPIO) to act as an SPI-like interface to support
external ICs such as CAN controllers.
Note: Bits 41-45 (SSP1) are multiplexed with UART1 bits.
UART Interface
Two generic 16750 compatible serial ports (bits 37-45 of GPIO) are provided. Both UARTs include RD, TD,
CTS, and RTS.
Note: Bits 37-45 (UART[0-1]) are multiplexed with the SSP1 and IrDA bits.
IrDA
The IrDA controller (bits 37-45 of GPIO) is standalone and supports data transfer of up to 115kb/s. It adheres
to the SIR protocol.
Note: These bits are multiplexed with UART[0-1] and SSP1.
I2C Interface
The SM502 supports one I2C interface (bits 46-47 of GPIO). The interface is master mode with 7-bit
addressing. Speeds up to 400kb/s (Fast mode) are supported.
The SM502 supports an 8-bit digital RGB output (bits 55-63 of GPIO) to hook up to external TV encoders.
Note: These bits are multiplexed with ZV Port [15:8] and Flat Panel Data [17:16,9:8,1:0].
Strap Pins
GPIO pins 0 through 7 and 12 through 15 control the power-on configuration for the SM502 according to
Table 1-5.
Introduction 1 - 29
The SM502 supports a native 18-bit panel interface, which can be extended to 24-bit by using GPIO bits 55-60.
See the section entitled “Video Layers and Data Processing” on page 20 for a detailed list of how the 24-bit
panel interface is connected.
Note: These bits are multiplexed with Digital TV Encoder and ZV Port [15:0].
USB Controllers
The SM502 supports one USB 1.1 compliant port. It is shared between the host controller and the device
controller (ownership is software programmable).
Host Controller: OHCI compliant USB host controller. This module is sourced from the leading supplier of
USB cores and it is compatible with existing software drivers shipping on all modern Operating Systems. The
controller has its own DMA engine and bus arbitration mechanisms for increased performance and ease of use.
Device Controller: USB device controller supports 3 endpoints. This Generic Device implementation can be
fully configurable through a base driver/application running the host CPU. The main function for the device
controller is connecting to a PC for file transfers/downloads.
DMA Controller
The SM502 supports a 2-channel DMA controller than can move data between 8051 SRAM and either
memory bus or it can move data from one memory bus to another memory bus.
1. Channel 1 is used to transfer data between both memory buses and the 8051 µ-controller data SRAM.
2. Channel 2 is used to transfer data between or within memory buses.
1 - 30 Introduction
Interrupt Controller
The SM502 has only one interrupt to the host bus. This means all internal interrupts are shared without priority.
One interrupt status register specifies which module(s) generated the interrupts and the software drivers are
responsible for clearing the interrupt at the source. The Host Interrupt remains asserted as long as there is any
bit set in the System Interrupt Status register.
For example, if the USB Host generated an interrupt, then the USB Host Interrupt Pending bit is set in the
System Interrupt Status register. If the USB Host Interrupt Mask bit is set in the System Interrupt Mask
register, then the SM502 asserts the Host Interrupt line. The operating system finally redirects the interrupt
routine to the USB Host driver. The USB Host Driver reads the System Interrupt Status register and determines
it has to service the USB Host. It then reads the USB Host Interrupt Status register, performing the requested
tasks, and clears the interrupt in the USB Host register. If there are no more interrupt bits set in the System
Interrupt Status register, the SM502 will deassert the Host Interrupt line.
Clock Control
The SM502 has one oscillator input and two external clock inputs. Figure 1-14 shows the clock tree for the
SM502.
Introduction 1 - 31
PLL
X14 /6 48MHz 00
336MHz
USB Slave Clock
01 USB Clock Select USB
Control 1
11 0x000004[29:28] Slave
GPIO_30 0x000040[12]
10
Host Clock
48MHz / 48MHz USB Host Clock
USB
96MHz Control 1
Host
0x000040[11]
96MHz /2 48MHz Host Clock
DISV2X
0 V2XCLK Frequency Display Clock
V2XCLK Input Select Ox00003C[21]
Divider Control 1 CRT
1 0x00003C[20] Disable(1)
Ox00003C[19:16] 0x000040[2]
Enable(0)
288MHz
0 I2C/
Input clock select I2C Clock Control
Programmable PLL 1 GPIO/
Test Clock 1 0x000074[16] 0x000040[6]
0x000074[7:0] – Multiple M value PWM
0x000074[14:8] – Divide N value
SSP Clock
0x000074[15] – Divide by 2
Control 1 SSP
0x000074[17] – Power On
0x000040[10]
Power Management
Figure 1-15 shows the possible power states the SM502 supports.
During power-on reset, the SM502 comes up in a predefined state with all I/O turned off, and running the
lowest possible clock. The software is responsible for programming the Mode 0 power state to the requested
state after power-on and transition into the Mode 0 power state.
The Mode 0 and Mode 1 power states are the same and fully under software control. Whenever the software
decides that the SM502 must go into a different state, the software programs the non-active power state and
transitions into that state. This way there are an infinite number of power states supported by software and
makes power management very flexible.
The Sleep power state puts the SM502 into a sleep mode. In this mode the SDRAM is put into self-refresh
mode, and the crystal and PLL circuits are turned off. The CLKOFF input pin is asserted by the system
integrator to turn off the host clock inside the SM502 in order to reduce power consumption even further if the
system integrator decides to do so.
1 - 32 Introduction
Power-On Initialization
Mode 0 Pr
State og
ra
m
m
ing
Programming
Sleep
ing
ramm
g
Pro
Mode 1
Note: The System Control registers are clocked in the Host clock domain and even shutting off the crystal and PLL circuits does
not keep the System Control registers and the host bus from functioning. This way the software is always able to wake up
the SM502 from sleep mode. In order to reduce even more power, the CLKOFF input pin should be used for gating the host
clock.
Introduction 1 - 33
On NEC VR4122/31
0MB 0MB
62MB 30MB
MMIO MMIO
64MB 32MB
MMIO Space
The MMIO space contains the SM502 register set and is divided into separate 64kB blocks that hold the
registers for each individual functional block of the SM502. If a functional block requires a data port to fill its
FIFO, a separate 64kB block will be specified for the data port.
Figure 1-17 shows the MMIO space. Note that the addresses are offsets from the MMIO base address. The
MMIO base address is dependent upon which host processor is being used. Refer to Table 1-6 on page 36 for
the different addresses.
1 - 34 Introduction
0x060000
USB Slave
(8-bit)
0x070000
USB Slave Data Port
(32-bit)
0x080000
Display Controller/Video Engine
(8, 16, or 32-bit)
0x090000
ZV Port 0 (8, 16, or 32-bit)
0x098000
ZV Port 1 (8, 16, or 32-bit)
0x0A0000
AC97 / I2S
(8, 16, or 32-bit)
0x0B0000
8051 µ-controller
(8, 16, or 32-bit)
0x0C0000
8051 µ-controller SRAM
(8, 16, or 32-bit)
0x0D0000
DMA
(16 or 32-bit)
0x0E0000
0x100000 0x200000
Introduction 1 - 35
MMIO Addressing
For different bus interfaces, the MMIO address is decoded differently. Table 1-6 lists the different MMIO
addresses for all possible host interfaces. Note that for the NEC MIPS Host Interface, the MMIO address can
be programmed to be moved from 30MB (0x1E00000) to 62MB (0x3E00000) if a newer version of NEC
MIPS supports 64MB I/O spaces instead of 32MB.
1 - 36 Introduction
2 System Configuration
Functional Overview
The SM502 has only one interrupt to the host bus. All internal interrupts are shared without priority.
Register Descriptions
The SM502 System Configuration Registers are located at base address MMIO_base+0x0000000, and contains
28 configuration registers. Every register is 32-bit DWORD aligned with offset addresses from 0x00 to 0x68.
Not all of them are 32 bits wide; but if not specified, it should be reserved, and read as defaults. Most of them
are software programmable, i.e. both write and read, but some of them are set by hardware and should be read
only.
Figure 2-1 shows how this 64kB region in the MMIO space is laid out. It contains the System Configuration
registers that are clocked from the Host Bus domain, so they are always available as long as there is a host
clock, even when all other internal blocks are turned off.
MMIO_base +
MMIO_base + 0x0000000
0x0000000 Configuration 1
0x0000018
System Configuration Command List
0x0000028
0x0100000 Interrupt/Debug
0x0000038
Power Management
0x0000058
Configuration 2
0x000006C
0x0100000
0x2000000
Table 2-1 shows the System Configuration Register offsets and general functions (Base Address: MMIO_base).
Address
Offset from Type Width Reset Value2 Register Name
MMIO_base1
Configuration 1
Command List
Interrupt/Debug
Power Management
Address
Offset from Type Width Reset Value2 Register Name
MMIO_base1
Configuration 2
1. Refer to Table 1-6 on page 1-36 for MMIO_base values depending on the CPU.
2. In the reset values, “X” indicates don’t care.
The Configuration registers control the way the SM502 chips operates. Figure 2-2 shows the layout of the
configuration registers in Configuration Register Space 1.
0x010000
System Control
Miscellaneous Control
GPIO31:0 Control
GPIO63:32 Control
2 - 10 System Configuration
System Configuration 2 - 11
DRAM Control
2 - 12 System Configuration
System Configuration 2 - 13
Arbitration Control
2 - 14 System Configuration
System Configuration 2 - 15
The Command List registers control the Command List Interpreter. Figure 2-3 shows the layout of the registers
that control the Command List Interpreter.
MMIO_base +
0x0000000
Configuration
0x0000018
Command List
0x0000028
Interrupt/Debug
0x0000038
Power Management
0x0000058
Configuration
0x000006C MMIO_base +
0x0000018
Command List Control
0x000001C
Command List Condition
0x0000020
Command List Return
0x0000024
Command List Status
0x0000028
0x0100000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
2M CF 2C DM CS
Reserved
R R R R R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VF VS PS SC SP 2S 2F 2E
Reserved
R R R R R R R R
2 - 16 System Configuration
System Configuration 2 - 17
The Interrupt / Debug registers reflect the status of interrupts, allow for enabling and disabling different
interrupts and control which area of the chip is to be debugged in the Debugging Test Mode. Figure 2-4 lists the
registers available in the Interrupt and Debug register space.
MMIO_base +
0x000000
Configuration
0x000018
Command List
0x000028
Interrupt/Debug
0x000038
Power Management
0x000058
Configuration
0x00006C MMIO_base +
0x000028
Raw Interrupt Status/Clear
0x00002C
Interrupt Status
0x000030
Interrupt Mask
0x000034
Debug Control
0x000038
0x010000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ZV1 UP ZV0 CV US PV CI
Reserved
R/W R/W R/W R/W R/W R/W R/W
2 - 18 System Configuration
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ZV0 UP ZV0 CV US PV CI
Reserved
W W W W W W W
System Configuration 2 - 19
Interrupt Status
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
UP G54 G53 G52 G51 G50 G49 G48 I2C PW DMA PCI I2S
AC US
Res
R R R R R R R R R R R R R R R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
U1 U0 CV MC S1 S0 UH ZV1 2D ZV0 PV CI
Res Res Res
R R R R R R R R R R R R
2 - 20 System Configuration
System Configuration 2 - 21
Interrupt Mask
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
UP G54 G53 G52 G51 G50 G49 G48 I2C PW DMA PCI I2S
AC US
Res
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
U1 U0 CV MC S1 S0 UH ZV1 2D ZV0 PV CI
Res Res Res
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
2 - 22 System Configuration
System Configuration 2 - 23
Debug Control
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Module Partition
Reserved
R/W R/W
2 - 24 System Configuration
The Power Management registers control which areas of the SM502 are running and at which speed.
Figure 2-5 lists the registers available in the Power Management register space.
MMIO_base +
0x000000
Configuration
0x000018 MMIO_base +
Command List 0x000038
0x000028
Current Gate
Interrupt/Debug
0x000038 0x00003C
Power Management Current Clock
0x000058 0x000040
Configuration Power Mode 0 Gate
0x00006C 0x000044
Power Mode 0 Clock
0x000048
Power Mode 1 Gate
0x00004C
Power Mode 1 Clock
0x000050
Sleep Mode Gate
0x000054
Power Mode Control
0x000058
0x010000
Current Gate
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
AC μP P
Res
R R R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O R US UH S U1 U0 G ZV C 2D D M H
Res
R R R R R R R R R R R R R R
System Configuration 2 - 25
2 - 26 System Configuration
Current Clock
System Configuration 2 - 27
Res
AC μP Res
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
US UH S U1 U0 G ZV C 2D D M H
Res Res
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
2 - 28 System Configuration
System Configuration 2 - 29
2 - 30 System Configuration
System Configuration 2 - 31
2 - 32 System Configuration
System Configuration 2 - 33
2 - 34 System Configuration
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
D
Reserved Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R
Res Reserved
R/W
System Configuration 2 - 35
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
S Mode
Reserved
R/W R/W
2 - 36 System Configuration
An external crystal combined with the on-chip oscillator provides the SM502 clock source. The external
crystal frequency should be fixed at 24 MHz ± 5%.
The SM502 contains three clock multiply PLLs:
• PLL0
Input frequency = 24 MHz oscillator
Output frequency = Input frequency x 4 = 96 MHz fixed
• PLL1
Input frequency = Output of PLL0 / 2 = 48 MHz
Output frequency = Input frequency x 6 = 288 MHz fixed
• PLL2
Input frequency = Output of PLL0 / 2 = 48 MHz
Output frequency = Input frequency x 7 = 336 MHz fixed
The Power Mode Control Register at MMIO_base + 0x000054 determines the power mode selection as
follows:
• Bits [1:0] = 00, select Power Mode 0 (power on default)
• Bits [1:0] = 01, select Power Mode 1.
• Bits [1:0] = 10, Sleep Mode. The PLLs and the oscillator are shut down in this mode.
• Bits [1:0] = 11, Reserved.
In Power Mode 0, the Power Mode 0 Clock Register at MMIO_base + 0x000044 controls the clock settings.
The default of the Power Mode 0 Clock Register is 0x2A1A0A09. The Power Mode 0 Gate Register at
MMIO_base + 0x000040 controls clock gating. The default of the Power Mode 0 Gate Register is
0x00021807.
In Power Mode 1, Power Mode 1 Clock Register at MMIO_base + 0x00004C controls the clock settings. The
default of the Power Mode 1 Clock Register is 0x2A1A0A09. The Power Mode 1 Gate Register at
MMIO_base + 0x000048 controls clock gating. The default of the Power Mode 1 Gate Register is
0x00021807.
System Configuration 2 - 37
There are five clock branches that can be programmed through the Power Mode 0 Clock, Power Mode 1 Clock,
and Miscellaneous Timing registers:
Clock Description
P2XCLK 2X clock source for the Panel interface timing. The actual rate at which the pixels are shifted
out is P2XCLK divided by two.
V2XCLK 2X clock source for the CRT interface timing. The actual rate at which the pixels are shifted
out is V2XCLK divided by two.
MCLK Main clock source for all functional blocks, such as the 2D engine, GPIO, Video Engine, DMA
Engine.
SYSCLK1 Clock source for the system memory (CPU memory) controller. This clock also can be
selected as the XScale CPU interface logic clock.
1. The definition of SYSCLK applies to the SM502, Rev AA only. The M1XCLK signal on Rev A and B test
chips is used to drive the system memory controller.
• Bits [20:16]: SYSCLK control if Power Mode 1 is selected. The power-on default for these bits is 0x09.
• Bits [12:8]: SYSCLK control if Power Mode 0 is selected. The power-on default for these bits is 0x09.
The Current Gate (MMIO_base + 0x000038) and Current Clock (MMIO_base + 0x00003C) registers are
read-only registers that reflect the current clock control selection. When Power Mode 0 is selected, the value
read from this register should be the same as the value in the Power Mode 0 Clock register.
Rules to Program the Power Mode Clock Registers for Clock Selection
1. There should be only one clock source changed at a time. To change clock source for P2XCLK, V2XCLK,
MCLK, M1XCLK simultaneously may cause the internal logic normal operation to be disrupted. There
should be a minimum of 16ms wait from change one clock source to another.
2. When adjusting the clock rate, the PLL selection bit should be programmed first before changing the
divider value for each clock source. For example, to change the P2XCLK clock rate:
• bit 29 should be set first
• wait for a minimum of 16ms (about one Vsync time)
• adjust bits [28:24].
The minimum 16 ms wait is necessary for logic to settle down before the clock rate is changed.
3. There should be a minimum 16 ms wait after a clock source is changed before any operation that could
result in a bus transaction.
2 - 38 System Configuration
There are three ways to power down the SM502 chip (sleep mode):
The Configuration registers control the way the SM502 chips operates. Figure 2-2 shows the layout of the
configuration registers in Configuration Register Space 2.
System Configuration 2 - 39
Endian Control
2 - 40 System Configuration
Device Id
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
ClockCount
R
System Configuration 2 - 41
Miscellaneous Timing
2 - 42 System Configuration
System Configuration 2 - 43
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SS S
Reserved
R R
2 - 44 System Configuration
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Non$
Reserved
R/W
System Configuration 2 - 45
2 - 46 System Configuration
Figure 3-1 lists the registers available in the PCI Configuration register space.
0x2C
Subsystem ID and Subsystem Vendor ID
0x30
Expansion ROM Base Address
0x34
Power Down Capability Pointer
0x3C
Interrupt Pin and Interrupt Line
0x40
Power Down Capability Register
0x44
Power Down Capability Data
0x48
This register controls which types of PCI command cycles are supported by the SM502.
Note: Reserved bits are read only.
This register specifies the silicon revision ID and the Class Code that the silicon supports.
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LT
Reserved
R
This register specifies the latency timer that the SM502 supports for burst master mode.
This register specifies the PCI configuration space for address relocation
Note: Reserved bits are read only.
This register specifies the PCI configuration space for address relocation.
Note: Reserved bits are read only.
This register specifies both the Subsystem device ID and the Subsystem Vendor ID.
This register contains the address where PCI power down management registers are located.
This register specifies the PCI interrupt pin and interrupt line.
This register contains the address for PCI power-down management capabilities.
This register contains the address for PCI power-down management Control, Status and Data.
4 Drawing Engine
Functional Overview
The SM502's Drawing Engine is designed to accelerate Microsoft's DirectDraw and Direct3D applications.
The engine contains a 3-operand ALU with 256 raster operations, source and destination FIFOs, as well as a
host data FIFO. The drawing engine pipeline allows single cycle operations and runs at the memory clock
speed.
The Drawing Engine includes several key functions to achieve the high GUI performance. The device supports
color expansion with packed mono font, color pattern fill, host BLT, stretch BLT, short stroke, line draw, and
others. Dedicated pathways are designed to transfer data between the host interface (HIF) bus and the Drawing
Engine, and memory interface (MIF) bus and the Drawing Engine. In addition, the Drawing Engine supports
rotation BIBLT for any block size, and automatic self activate rotation BLIT. This feature allows conversion
between landscape and portrait display without the need for special software drivers.
Programmer’s Model
The Drawing Engine supports various drawing functions, including Bresenham line draw, short stroke line
draw, BITBLT, rectangle fill, HOSTBLT, Rotation Blit, and others. Hardware clipping is supported by 4
registers, DPR2C-DPR32, which define a rectangular clipping area.
The drawing engine supports two types of addressing formats for its source and destination locations. In XY
addressing mode, the location is specified in X-Y coordinates, where the upper left corner of the screen is
defined to be (0,0). In linear addressing mode, the location is specified based on its position in the display
memory sequentially from the first pixel of the visible data. The addressing mode is set by the Addressing field
of the 2D Stretch & Format register. The Command field of the 2D Control register selects other drawing
functions, for example, Bresenham line draw, host write and short stroke.
Register Descriptions
All Drawing Engine control registers can be accessed via memory mapping. Writing to those registers should
only be done by double-word. Byte-write access is not supported. The address is at DP_Base + XXXh, where
DP_Base is at PCI graphics base address + 4MB + 32K. Figure 4-1 shows how this 64kB region in the MMIO
space is laid out. It controls the Drawing Engine registers.
MMIO_base +
MMIO_base +
0x100000
0x000000
2D Drawing Engine
0x100054
0x100000
0x2000000
0x110000
Offset from
Type Width Reset Value Register Name
MMIO_base1
Offset from
Type Width Reset Value Register Name
MMIO_base1
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2D Source
2D Destination
2D Dimension
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
X_VL
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Y_ET
R/W
2D Control
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S P U Q D M X Y St H LP Command
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R R2 Mono RR TM TS T ROP
R/W R/W R/W R/W R/W R/W R/W R/W
15 R ROP Control.
0: ROP3.
1: ROP2.
14 R2 ROP2 Control.
0: ROP2 source is bitmap.
1: ROP2 source is pattern.
13:12 Mono Monochrome Data Pack Control.
00: Not packed.
01: Packed at 8-bit.
10: Packed at 16-bit.
11: Packed at 32-bit.
Bit[2:0]
0 1 2 3 4 5 6 7
0 0 ~(D+S) D*~S ~S ~D*S ~D D^S (~D*S)
Bit 3
1 D*S (~D^S) D D+~S S ~D+S D+S 1
Each raster-operation code represents a Boolean operation in which the values of the pixels in the source, the
selected brush, and the destination are combined. The operands and operands are:
• D = destination bitmap
• P = selected brush (pattern)
• S = source bitmap
• a = bitwise AND
• n = bitwise NOT (inverse)
• o = bitwise OR
• x = bitwise XOR (exclusive OR)
All Boolean operations are presented in reverse Polish notation. For example, the following operation replaces
the pixel values in the destination bitmap with a combination of the pixel values of the source and brush:
PSo = (P+S)
The following operation combines the values of the pixels in the source and brush with the pixel values of the
destination bitmap (there are alternative spellings of the same function, so although a particular spelling may
not be in the list, an equivalent form would be):
DPSoo = (P+S) + D
The SM502 supports all the 256 operations. However, the pattern must be monochrome.
Bits [7:4]
8 9 A B C D E F
Rotate Command
For the Rotate command, the X and Y bits determine the rotation angle. For the Short Stroke command, the D,
M, X, and Y bits determine the direction of the vector.
2D Pitch
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Destination
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Source
Reserved
R/W
4 - 10 Drawing Engine
2D Foreground
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Foreground
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Foreground
R/W
2D Background
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Background
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Background
R/W
In monochrome transparency, the Background must be programmed with the invert of the Foreground pixels in
the 2D Foreground register.
Drawing Engine 4 - 11
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
XY Y X Format Addressing
Res Res Res
R/W R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Height
Res
R/W
4 - 12 Drawing Engine
2D Color Compare
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Color
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Color
R/W
In monochrome transparency, the Color must be programmed with the same value as the Foreground pixels in
the 2D Foreground register.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Mask
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Mask
R/W
Drawing Engine 4 - 13
2D Mask
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Byte
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Bit
R/W
2D Clip TL
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Top
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
E S Left
Reserved
R/W R/W R/W
4 - 14 Drawing Engine
2D Clip BR
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Bottom
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Right
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Pattern
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Pattern
R/W
Drawing Engine 4 - 15
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Pattern
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Pattern
R/W
2D Window Width
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Destination
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Source
Reserved
R/W
4 - 16 Drawing Engine
2D Source Base
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
2D Destination Base
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
Drawing Engine 4 - 17
2D Alpha
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Alpha
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Width
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Height
R/W
4 - 18 Drawing Engine
2D Status
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CSC 2D
Reserved
R/W R/W
Drawing Engine 4 - 19
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
4 - 20 Drawing Engine
CSC Constants
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Y R
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
G B
R/W R/W
CSC Y Source X
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
XI
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XF
Reserved
R/W
Drawing Engine 4 - 21
CSC Y Source Y
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
YI
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
YF
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
4 - 22 Drawing Engine
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Width
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Height
R/W
Drawing Engine 4 - 23
CSC Destination
4 - 24 Drawing Engine
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Width
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Height
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
X
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Y
R/W
Drawing Engine 4 - 25
4 - 26 Drawing Engine
CSC Control
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S FormatS FormatD H V B
Reserved
R/W R/W R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved
YUV422 YUV420I
0 YUYV UVUV
1 UYVY VUVU
Drawing Engine 4 - 27
5 Display Controller
Programmer’s Model
The SM502 integrates a concurrent video processor to control LCD display. Some of the features are:
• Background graphic supports from 4-bit index color, 8-bit index color, 15-bit direct color, and 16-bit direct color.
Background graphic can be programmed to pan to the left/right and to up/down automatically according to number of
VSYNC.
• Support 1 independent video surface using hardware scaling for any size of video windows at any location of the
screen display and using hardware YUV to RGB color space conversion.
• Support 1 Alpha blend surface at any location of the screen display. It can use as hardware cursor or popup icon or
sub picture for the video. Data format is 4-bit alpha and 4-bit color.
• The LCD module manages data flow and generate timing to select LCD display. It provides support for 18-bit and
24-bit TFT and 8-bit and 12-bit DSTN panels up to SXGA.
The Video Processor Control Registers specify the control registers for Video Processor. The Video Processor
Control Registers can only be accessed through memory-mapping.
Register Descriptions
Table 5-1 summarizes the Display Controller registers.
Offset from
Type Width Reset Value2 Register Name
MMIO_base1
Video Control
Offset from
Type Width Reset Value2 Register Name
MMIO_base1
Alpha Control
Offset from
Type Width Reset Value2 Register Name
MMIO_base1
Palette RAM
Offset from
Type Width Reset Value2 Register Name
MMIO_base1
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. In the reset values, “X” indicates don’t care.
Figure 5-1 shows how this 64kB region in the MMIO space is laid out. It controls the backend of the display
controller as shown in Figure 5-2.
0x080000
Panel Graphics Control
0x080040
Video Control
0x080080
MMIO_base +
Video Alpha Control
0x000000 0x0800F0
Panel Cursor Control
0x080100
Alpha Control
0x080200
CRT Graphics Control
0x080230
0x080000
CRT Cursor Control
0x080400
Display Controller Palette RAM
0x090000 0x081000
0x200000 0x090000
Hardware Cursor
64x64, 2-bpp color FIFO
CRT
merge merge / TV
CRT Graphics Layer
8/16/32-bpp color FIFO LUT
Hardware Cursor
64x64, 2-bpp color FIFO merge panel
Alpha Layer
4 bits ·, 4/12-bpp color, FIFO alpha blend
16-bpp transparent color
Figure 5-3 shows the layout of the Panel Graphics Control registers.
0x080000
Panel Display Control
0x080004
Panel Panning Control
0x080008
MMIO_base + Panel Color Key
0x08000C
0x080000
Panel FB Address
Panel Graphics Control 0x080010
0x080040
Panel FB Offset/Window Width
Video Control 0x080014
0x080080
Video Alpha Control Panel FB Width
0x0800F0 0x080018
To understand video windowing, please refer to Figure 5-4. Here a window is created inside a much large
frame buffer. That window is then being displayed on the panel as the Panel Graphics Plane.
Panel Window
Frame Buffer
R
L
T
B
Panel Output
5 - 10 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VPan VWait
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HPan HWait
Reserved
R/W R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Mask
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Value
R/W
Display Controller 5 - 11
Panel FB Address
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
FB Window Width
Reserved 0000
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FB Offset
Reserved 0000
R/W
5 - 12 Display Controller
Panel FB Width
Display Controller 5 - 13
Panel FB Height
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
FB Global Height
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WY
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
T
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
L
Reserved
R/W
5 - 14 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
B
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
HT
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HDE
Reserved
R/W
Display Controller 5 - 15
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
HSW
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HS
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VT
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VDE
Reserved
R/W
5 - 16 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VSH
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VS
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Line
Reserved
R
Display Controller 5 - 17
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
FIFO
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Buf CB DB BS VS HS VI HI Pixel γ E Format
R R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
5 - 18 Display Controller
1. All display devices have an inherent non-linearity so that the intensity of the output is not linearly proportional
to the input signal over the full range of input values. The gamma control helps to correct this nonlinearity.
Display Controller 5 - 19
Video FB 0 Address
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
Video FB Width
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Width
Reserved 0000
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Offset
Reserved 0000
R/W
5 - 20 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
Display Controller 5 - 21
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
T
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
L
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
B
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R
Reserved
R/W
5 - 22 Display Controller
Video Scale
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VS VScale
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HS HScale
Reserved
R/W R/W
1. Set HS = 0.
2. Calculate the scaling factor:
(widthsrc / widthdest) * 212 = (1/3) * 212
3. Set HScale. In this example, HScale = 0101 0101 0101 binary or 555 hex.
1. Set HS = 1.
2. Calculate the scaling factor:
(widthdest / widthsrc) * 212 = ((1/3/)1) * 212 = 1/3 * 212
3. Set HScale. Note that the HScale setting is the same for shrinking by 1/3 as it is for magnifying by a factor
of 3, only the setting of HS differs
Display Controller 5 - 23
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VScale1
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VScale0
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Y R
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
G B
R/W R/W
5 - 24 Display Controller
Video FB 1 Address
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CS
S Ext
Reserved R/W Address
R/W R/W
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
Display Controller 5 - 25
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
5 - 26 Display Controller
Figure 5-6 shows the layout of the Video Alpha Control registers.
0x080080
Video Alpha Display Control
MMIO_base + 0x080084
0x080000 Video Alpha FB Address
Panel Graphics Control 0x080088
0x080040 Video Alpha FB Offset/Window Width
Video Control 0x08008C
0x080080 Video Alpha FB Last Address
Video Alpha Control 0x080090
0x0800F0
Video Alpha Plane TL Location
Panel Cursor Control 0x080094
0x080100
Video Alpha Plane BR Location
Alpha Control 0x080098
0x080200
Video Alpha Scale
CRT Graphics Control 0x08009C
0x080230
Video Alpha Initial Scale
CRT Cursor Control 0x0800A0
0x080400
Video Alpha Chroma Key
Palette RAM
0x0800A4
0x081000
Video Alpha Color Lookup
0x0800C0
0x090000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Sel Alpha FIFO
Reserved Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VS HS VI HI Pixel CK E Format
Reserved
R/W R/W R/W R/W R/W R/W R/W R/W
Display Controller 5 - 27
5 - 28 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Window Width
Reserved 0000
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FB Offset
Reserved 0000
R/W
Display Controller 5 - 29
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
5 - 30 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Top
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Left
Reserved
R/W
Display Controller 5 - 31
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VS VScale
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HS HScale
Reserved
R/W R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VScale
Reserved
R/W
5 - 32 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Mask
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Value
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Lookup1
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Lookup0
R/W
There are 8 Video Alpha Color Lookup registers, each containing two RGB 5:6:5 color lookup values for each
of the 16 4-bit indexed colors.
Display Controller 5 - 33
Figure 5-7 shows the layout of the Panel Cursor Control registers.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
E Ext CS Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
5 - 34 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
T Y
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
L X
Reserved
R/W R/W
Display Controller 5 - 35
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Color2
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Color1
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Color3
R/W
5 - 36 Display Controller
0x080138
0x090000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Sel Alpha FIFO
Reserved Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Pixel CK E Format
Reserved
R/W R/W R/W R/W
Display Controller 5 - 37
Alpha FB Address
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
5 - 38 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Window Width
Reserved 0000
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FB Offset
Reserved 0000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Top
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Left
Reserved
R/W
Display Controller 5 - 39
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Bottom
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Right
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Mask
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Value
R/W
5 - 40 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Lookup1
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Lookup0
R/W
There are 8 Alpha Color Lookup registers, each containing two RGB 5:6:5 color lookup values for each of the
16 4-bit indexed colors.
Display Controller 5 - 41
Figure 5-9 shows the layout of the CRT Graphics Control registers.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
FIFO
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TVP CP VSP HSP VS B Sel TE Pixel γ E Format
R/W R/W R/W R/W R R/W R/W R/W R/W R/W R/W R/W
5 - 42 Display Controller
Display Controller 5 - 43
CRT FB Address
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
5 - 44 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
HT
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HDE
Reserved
R/W
Display Controller 5 - 45
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
HSW
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HS
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
VT
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
VDE
Reserved
R/W
5 - 46 Display Controller
Display Controller 5 - 47
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Line
Reserved
R
5 - 48 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MDET E Data
Reserved
R R/W R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R
Display Controller 5 - 49
Figure 5-10 shows the layout of the CRT Cursor Control registers.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
E Ext CS Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address
0000
R/W
5 - 50 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
T Y
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
L X
Reserved
R/W R/W
Display Controller 5 - 51
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Color2
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Color1
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Color3
R/W
5 - 52 Display Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Red
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Green Blue
R/W R/W
Display Controller 5 - 53
There are 256 Panel Palette RAM registers, each containing a 24-bit RGB 8:8:8 color value.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Red
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Green Blue
R/W R/W
There are 256 Video Palette RAM registers, each containing a 24-bit RGB 8:8:8 color value.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Red
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Green Blue
R/W R/W
5 - 54 Display Controller
There are 256 CRT Palette RAM registers, each containing a 24-bit RGB 8:8:8 color value.
Display Controller 5 - 55
Command OPCODE
63 32
Data
31 28 27 0
Address
The command is a 4-bit field that is split into two regions. When bit 31 (bit 3 of the command) is 0, the
command is to be executed. If bit 31 is 1, the specified command is a flow command and as a result the
Command List FIFO will be flushed.
The Address field is specified in the SM502 Address Space. For internal memory, only bits 0 through 25 are
used to address the 64MB address range. In this case, bits 26 and 27 are “0”. When bit 27 is set to “1”, the
address space does not specify an internal memory address, but rather a memory address that lives on the host
bus. Bits 0 through 26 specify a 128MB address range.
Programming
To execute the Command List, the CPU is first building a valid Command List structure and then programs the
start address of the Command List in the Command List Start Address register. The Command List should be
terminated by the FINISH command.
Flow Commands
Several commands can be used to change the flow of the Command List. There are GOTO and GOSUB
commands, as well as a conditional JUMP command.
All destination addresses can be either relative or absolute. This makes it easy to jump over certain commands
in the Command List or jump to common subroutines stored in main memory.
The conditional JUMP command can be used to test for any of the 32 software-programmable conditional
states. If any of the requested conditional states is set, the jump is taken.
1. Fill the command list buffer after the last FINISH command. The software should always keep track of the
address of the last FINISH command.
2. Terminate the command list with a FINISH and remember the address of this FINISH.
3. Stop the command list by programming “0” in bit 31 of the Command List Address register.
4. Read and remember the current program counter.
5. Replace the previous FINISH command with a NOP command (00000000C0000000).
6. Restart the command list by programming the saved program counter and “1” in bit 31 of the Command
List Address register.
Register Descriptions
Table 6-1 summarizes the Command List registers.
Figure 6-1 defines the register layout for the Command List registers.
‘ti
When the Start bit is programmed to “0”, the command interpreter will stop after the current command has
been executed. This means the Command List Address (program counter) will contain the address of the next
instruction that is going to be executed when the Start bit is programmed to “1” again.
When programming the Start bit to “0” when conditional jumps are being executed, the Command List Address
contains the next logical address of the instruction to fetch, depending if the jump is taken or not.
Note: Note that a read of this register returns the Program Counter from the command list. This value is different than the value
programmed into the Command List Address field. So if you want to restart the command list after a STOP (clearing the S
bit), you need to program the correct Program Counter value into the Command List Address field. This normally is not a
program since you need to do a read/modify/write instruction anyway to clear the S bit.
Commands
Table 6-2 lists the 16 commands recognized by the Command List Interpreter.
Table 6-2: SM502 Commands
Load Memory
Data The data to be loaded in the memory address specified by Memory Address. The data
format is either 32-bit DWords or 16-bit Words.
Memory Address The Memory Address to write data to. Bits [3:0] are hardwired to “0” since all Memory
Addresses should be 128-bit aligned.
W When this bit is programmed to “0”, the 32-bit DWord data (bits [63:32]) is written to the
Memory Address. When this bit is programmed to “1”, the 16-bit Word data (bits
[47:32]) is written to the Memory Address.
B2, B1 Bits [63:62] are the byte-enable signals for the Word data. They are active high.
Load Register
Register Address The register address (in the space 0x00000000 – 0x001FFFFF) to write data to. Bits
[0:1] are hardwired to “0” since all register addresses should be 32-bit aligned.
Memory Address The starting memory address to write data to. Bits [1:0] are hardwired to “0”.
The data that must be loaded into the memory directly follows this command. Make sure the correct number of
DWORDs (DWORD Count) is provided, otherwise unpredicted results will happen. Also, if an odd number of
DWORDs is specified, the last DWORD should be padded with a dummy DWORD to align the next command
to 64-bit again.
Register Address The starting register address (in the space 0x00000000 – 0x001FFFFF) to write data
to. Bits [0:1] are hardwired to “0” since all register addresses should be 32-bit aligned.
The data that must be loaded into the registers directly follows this command. Make sure the correct number of
DWORDs (DWORD Count) is provided, otherwise unpredicted results will happen. Also, if an odd number of
DWORDs is specified, the last DWORD should be padded with a dummy DWORD to align the next command
to 64-bit again.
95 92 91 66 65 64
Source Memory Address 00
63 32
DWORD Count
31 28 27 2 1 0
0100 Memory Address 00
Source Memory Address The starting memory address to read data from. Bits [65:64] are hardwired to “0”.
Memory Address The starting memory address to write data to. Bits [1:0] are hardwired to “0”.
This command copies data from the memory location specified by Source Memory Address into the memory
location specified by Memory Address. The DWORD Count specifies the number of DWORDs to copy. This
command is most useful to copy texture, bitmap, or vertex data to off-screen memory for caching purposes.
95 92 91 66 65 64
Source Memory Address 00
63 32
DWORD Count
31 28 27 2 1 0
0101 Register Address 00
Source Memory Address The starting memory address to read data from. Bits [65:64] are hardwired to “0”.
Register Address The starting register address (in the space 0x00000000 – 0x001FFFFF) to write data
to. Bits [1:0] are hardwired to “0” since all register addresses should be 32-bit aligned.
This command copies data from the memory location specified by Source Memory Address into the register
bank location specified by Register Address. The DWORD Count specifies the number of DWORDs to copy.
This command is most useful to copy texture, bitmap, or vertex data to the engine FIFOs for processing.
Status Test
2D Memory FIFO (2M) 2D and Color Space Conversion memory FIFO (0 = not empty, 1 = empty).
Command FIFO (CF) Command FIFO on HIF bus (0 = not empty, 1 = empty).
Current Field (VF) Current Video Layer field for BOB (0 = odd, 1 = even).
CRT Sync (SC) Vertical Sync for CRT pipe (0 = not active, 1 = active).
Panel Sync (SP) Vertical Sync for Panel pipe (0 = not active, 1 = active).
2D FIFO (2F) 2D and Color Space Conversion command FIFO (0 = not empty, 1 = empty).
The Status Test command will wait until the requested status is met. The value of the Status Test register is
masked with the internal hardware state and compared to the state in the Bit Values. If the result does not equal
the Bit Values, the command list interpreter will wait until the hardware status changes. The pseudo code looks
like this:
WHILE (Hardware State & Mask [20:0] != Bit Values [52:32] & Mask [20:0]) NOP;
Finish
Finish 1000b
63 32
31 28 27 1 0
1000 I
Interrupt (I) If the Interrupt bit is set, the FINISH command will generate an interrupt that can still be
masked by the Command List mask bit in the Interrupt Mask register. When an
interrupt is generated, the Command List bit in Interrupt Status register will be set to
“1”.
The FINISH command stops executing commands in the Command List and clears the Start bit ([31]) of the
Command List Address register.
Goto
Goto 1001b
63 33 32
R
31 28 27 3 2 0
1001 Address 000
Relative (R) If the Relative bit is set, the specified Address is relative to the address of the current
command (signed addition).
Address The address of the new code to execute. Bits [2:0] are hardwired to “0” since all
addresses need to be 64-bit aligned.
The GOTO command will jump to the Command List code located at the specified Address.
Gosub
Gosub 1010b
63 33 32
R
31 28 27 3 2 0
1010 Address 000
Relative (R) If the Relative bit is set, the specified Address is relative to the address of the current
command (signed addition).
Address The address of the new code to execute. Bits [2:0] are hardwired to “0” since all
addresses need to be 64-bit aligned.
The GOSUB command will store the address of the next instruction it would execute in the Command List
Return Address register and starts executing the Command List code located at the specified Address.
Return
Return 1011b
63 32
31 28 27 0
1011
The RETURN command will jump to the address specified in the Command List Return Address register. The
RETURN command should terminate a subroutine that is being called by GOSUB.
Conditional Jump
Condition The Condition field consists of a 32-bit mask that will be applied to the Command List
Condition Register. If the result of this mask is TRUE (any bit set), the condition shall
return TRUE and the jump is taken by adding the signed value of Address to the
address of the next command in the Command List.
The formula of the condition is:
RESULT = Condition • Command List Condition register
Address A signed relative value that will be added to the address of the next command in the
Command List if the result of the condition is TRUE. Bits [2:0] are hardwired to “0”
since all addresses need to be 64-bit aligned.
Register Descriptions
This section describes the registers, their operations, and their options.
The Host Controller (HC) contains a set of on-chip operational registers which are mapped into a noncacheable
portion of the system addressable space. These registers are used by the Host Controller Driver (HCD).
According to the function of these registers, they are divided into four partitions, specifically for Control and
Status, Memory Pointer, Frame Counter and Root Hub. All of the registers should be read and written as
Dwords.
Reserved bits may be allocated in future releases of this specification. To ensure interoperability, the Host
Controller Driver that does not use a reserved field should not assume that the reserved field contains 0.
Furthermore, the Host Controller Driver should always preserve the value(s) of the reserved field. When a R/W
register is modified, the Host Controller Driver should first read the register, modify the bits desired, then write
the register with the reserved bits still containing the read value. Alternatively, the Host Controller Driver can
maintain an in-memory copy of previously written values that can be modified and then written to the Host
Controller register. When a write to set/clear register is written, bits written to reserved fields should be 0.
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. IS denotes an implementation-specific reset value for that field.
Figure 7-1 shows the layout of the control and status partition registers.
0x050000
HcRevision
HcControl
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RWE RWC IR HCFS BLE CLE IE PLE CBSR
Reserved R/W R/W R/W R/W R/W R/W R/W R/W R/W
R R/W R R/W R R R R R
This field may be changed by HC only when in the UsbSuspend state. HC may move
from the UsbSuspend state to the UsbResume state after detecting the resume
signaling from a downstream port.
HcCommandStatus
The SchedulingOverrunCount field indicates the number of frames with which the Host Controller has
detected the scheduling overrun error. This occurs when the Periodic list does not complete before EOF. When
a scheduling overrun error is detected, the Host Controller increments the counter and sets the
SchedulingOverrun field in the HcInterruptStatus register.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
SOC
Reserved R
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OCR BLF CLF HCR
Reserved R/W R/W R/W R/W
R/W R/W R/W R/W
‘ti
When HC begins to process the head of the Bulk list, it checks BF. As long as
BulkListFilled is 0, HC will not start processing the Bulk list. If BulkListFilled is 1,
HC will start processing the Bulk list and will set BF to 0. If HC finds a TD on the list,
then HC will set BulkListFilled to 1 causing the Bulk list processing to continue. If no
TD is found on the Bulk list, and if HCD does not set BulkListFilled, then
BulkListFilled will still be 0 when HC completes processing the Bulk list and Bulk list
processing will stop.
1 BLF ControlListFilled. Used to indicate whether there are any TDs on the Control list. It is
set by HCD whenever it adds a TD to an ED in the Control list.
When HC begins to process the head of the Control list, it checks CLF. As long as
ControlListFilled is 0, HC will not start processing the Control list. If CF is 1, HC will
start processing the Control list and will set ControlListFilled to 0. If HC finds a TD
on the list, then HC will set ControlListFilled to 1 causing the Control list processing
to continue. If no TD is found on the Control list, and if the HCD does not set
ControlListFilled, then ControlListFilled will still be 0 when HC completes
processing the Control list and Control list processing will stop.
0 HCR HostControllerReset. Set by HCD to initiate a software reset of HC. Regardless of the
functional state of HC, it moves to the UsbSuspend state in which most of the
operational registers are reset except those stated otherwise; e.g., the
InterruptRouting field of HcControl, and no Host bus accesses are allowed. This bit is
cleared by HC upon the completion of the reset operation. The reset operation must
be completed within 10 ms. This bit, when set, should not cause a reset to the Root
Hub and no subsequent reset signaling should be asserted to its downstream ports.
HcInterruptStatus
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
0 OC
R/W R/W Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RHSC FNO UE RD SF WDH SO
Reserved R/W R/W R/W R/W R/W R/W R/W
R/W R/W R/W R/W R/W R/W R/W
HcInterruptEnable
Writing a '1' to a bit in this register sets the corresponding bit, whereas writing a '0' to a bit in this register
leaves the corresponding bit unchanged. On read, the current value of this register is returned.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MIE OC
R/W R/W Reserved
R R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RHSC FNO UE RD SF WDH SO
Reserved R/W R/W R/W R/W R/W R/W R/W
R R R R R R R
HcInterruptDisable
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
MIE OC
R/W R/W Reserved
R R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RHSC FNO UE RD SF WDH SO
Reserved R/W R/W R/W R/W R/W R/W R/W
R R R R R R R
Figure 7-2 shows the layout of the memory pointer partition registers.
0x050000
HcHCCA
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
HCCA
R/W
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
HCCA
R/W 0
R
HcPeriodCurrentED
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PCED
R
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PCED
R 0
R/W
HcControlHeadED
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CHED
R/W
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CHED
R/W 0
R
HcControlCurrentED
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CCED
R/W
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CCED
R/W 0
R/W
HcBulkHeadED
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BHED
R/W
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BHED
R/W 0
R
HcBulkCurrentED
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
BCED
R/W
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BCED
R/W 0
R/W
HcDoneHead
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
DH
R/W
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DH
R/W 0
R/W
This is set to zero whenever the HC writes the content of this register to HCCA. It also sets
the WritebackDoneHead of HcInterruptStatus.
3:0 0 These bits are hardwired to zeros.
Figure 7-3 shows the layout of the frame counter partition registers.
0x050000
HcFmInterval
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
FIT FSMPS
R/W R/W
R R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FI
Reserved R/W
R
The HCD should store the current value of this field before resetting HC. By setting
the HostControllerReset field of HcCommandStatus as this will cause the HC to
reset this field to its nominal value. The HCD may choose to restore the stored value
upon the completion of the Reset sequence.
HcFmRemaining
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
FRT
R Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FR
Reserved R
R/W
HcFmNumber
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FN
R
R/W
HcPeriodicStart
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
PS
Reserved R/W
R
HcLSThreshold
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LST
Reserved R/W
R
All registers included in this partition are dedicated to the USB Root Hub which is an integral part of the Host
Controller though still a functionally separate entity. The HCD emulates USBD accesses to the Root Hub via a
register interface. The HCD maintains many USB-defined hub features which are not required to be supported
in hardware. For example, the Hub's Device, Configuration, Interface, and Endpoint Descriptors are
maintained only in the HCD as well as some static fields of the Class Descriptor. The HCD also maintains and
decodes the Root Hub's device address as well as other trivial operations which are better suited to software
than hardware.
The Root Hub register interface is otherwise developed to maintain similarity of bit organization and operation
to typical hubs which are found in the system. Below are four register definitions: HcRhDescriptorA,
HcRhDescriptorB, HcRhStatus, and HcRhPortStatus[1:0]. Each register is read and written as a Dword. These
registers are only written during initialization to correspond with the system implementation. The
HcRhDescriptorA and HcRhDescriptorB registers should be implemented such that they are writable
regardless of the HC USB state. HcRhStatus and HcRhPortStatus must be writable during the UsbOperational
state.
Note: IS denotes an implementation-specific reset value for that field.
Figure 7-4 shows the layout of the root hub partition registers.
0x050000
HcRhDescriptorA
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
POTPGT
IS Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
NOCP OCPM DT NPS PSM NDP
Reserved IS IS 0b IS IS R
R/W R/W R R/W R/W R
HcRhDescriptorB
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PPCM
R/W
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DR
R/W
R
HcRhStatus
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
CRWE OCIC LPSC
W Reserved R/W R/W
R R/W R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DRWE OCI LPS
R/W Reserved R R/W
R R/W R
HcRhPortStatus[1:NDP]
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
PRSC OCIC PSSC PESC CSC
Reserved R/W R/W R/W R/W R/W
R/W R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
LSDA PPS PRS POCI PSS PES CCS
Reserved R/W R/W Reserved R/W R/W R/W R/W R/W
R/W R/W R/W R/W R/W R/W R/W
ClearPortPower (write). The HCD clears the PortPowerStatus bit by writing a ‘1’ to
this bit. Writing a ‘0’ has no effect.
8 PPS PortPowerStatus (read). This bit reflects the port’s power status, regardless of the
type of power switching implemented. This bit is cleared if an overcurrent condition is
detected. HCD sets this bit by writing SetPortPower or SetGlobalPower. HCD
clears this bit by writing ClearPortPower or ClearGlobalPower. Which power control
switches are enabled is determined by PowerSwitchingMode and
PortPortControlMask[NDP]. In global switching mode (PowerSwitchingMode=0),
only Set/ClearGlobalPower controls this bit. In per-port power switching
(PowerSwitchingMode=1), if the PortPowerControlMask[NDP] bit for the port is
set, only Set/ClearPortPower commands are enabled. If the mask is not set, only
Set/ClearGlobalPower commands are enabled. When port power is disabled,
CurrentConnectStatus, PortEnableStatus, PortSuspendStatus, and
PortResetStatus should be reset.
0: Port power is off.
1: Port power is on.
SetPortPower (write). The HCD writes a ‘1’ to set the PortPowerStatus bit. Writing a
‘0’ has no effect.
Note: This bit always reads as ‘1’ if power switching is not supported.
7:5 Reserved Reserved.
4 PRS PortResetStatus (read). Set by a write to SetPortReset, port reset signaling is
asserted. When reset is completed, this bit is cleared when
PortResetStatusChange is set. This bit cannot be set if CurrentConnectStatus is
cleared.
0: Port reset signal is not active.
1: Port reset signal is active.
SetPortReset (write). The HCD sets the port reset signaling by writing a ‘1’ to this bit.
Writing a ‘0’ has no effect. If CurrentConnectStatus is cleared, this write does not
set PortResetStatus, but instead sets ConnectStatusChange. This informs the
driver that it attempted to reset a disconnected port.
3 POCI PortOverCurrentIndicator. Only valid when the Root Hub is configured in such a way
that overcurrent conditions are reported on a per-port basis. If per-port overcurrent
reporting is not supported, this bit is set to 0. If cleared, all power operations are
normal for this port. If set, an overcurrent condition exists on this port. This bit always
reflects the overcurrent input signal.
0: No overcurrent condition.
1: Overcurrent condition detected.
ClearSuspendStatus (write). The HCD writes a ‘1’ to initiate a resume. Writing a ‘0’
has no effect. A resume is initiated only if PortSuspendStatus is set.
SetPortSuspend (write). The HCD sets the PortSuspendStatus bit by writing a ‘1’ to
this bit. Writing a ‘0’ has no effect. If CurrentConnectStatus is cleared, this write
does not set PortSuspendStatus; instead it sets ConnectStatusChange. This
informs the driver that it attempted to suspend a disconnected port.
1 PES PortEnableStatus (read). Indicates whether the port is enabled or disabled. The Root
Hub may clear this bit when an overcurrent condition, disconnect event, switched-off
power, or operational bus error such as babble is detected. This change also causes
PortEnabledStatusChange to be set. HCD sets this bit by writing SetPortEnable
and clears it by writing ClearPortEnable. This bit cannot be set when
CurrentConnectStatus is cleared. This bit is also set, if not already, at the
completion of a port reset when ResetStatusChange is set or port suspend when
SuspendStatusChange is set.
0: Port is disabled.
1: Port is enabled.
SetPortEnable (write). The HCD sets PortEnableStatus by writing a ‘1’. Writing a ‘0’
has no effect. If CurrentConnectStatus is cleared, this write does not set
PortEnableStatus, but instead sets ConnectStatusChange. This informs the driver
that it attempted to enable a disconnected port.
0 CCS CurrentConnectStatus (read). Reflects the current state of the downstream port.
0: No device is connected.
1: Device is connected.
ClearPortEnable (write). The HCD writes a ‘1’ to this bit to clear the
PortEnableStatus bit. Writing a ‘0’ has no effect. The CurrentConnectStatus is not
affected by any write.
Note: This bit always reads as ‘1’ when the attached device is nonremovable
(DeviceRemoveable[NDP]).
8 USB Slave
Register Descriptions
This section defines the different registers and their functionality.
• USB Interrupts
The IN MAXP, IN INTERRUPT, and IN INTERRUPT ENABLE registers are used regardless of the direction
of the endpoint. The associated CSR registers correspond to the direction of endpoint1.
Below is the address map for the registers within the core, along with the abbreviations used in the code.
Detailed descriptions of the registers are given in the following sections, along with details of Reset values.
Note: The given Reset values are selected both in response to a Power ON reset and to Reset Signaling on the USB, except where
stated otherwise.
If the core does contain any OUT endpoints, the OUT CSR, OUT MAXP, OUT INTERRUPT and OUT
INTERRUPT ENABLE registers do not exist. However, an OUT WRITE COUNT register exists to read the
Write Count for Endpoint 0.
Address Map
1. EPO is considered as an IN_OR_OUT endpoint and thus its MAXP is mapped to the IN_MAXP register.
for Endpoint 1, 1 must first be written to the Index register and then the control and status registers appear in
the memory map. Table 8-1 provides a description of each register.
16 0x060058 R/W 6 0b00000000 OUT Write Count1 Maintains bits 7:0 of the
write count
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. In the reset values, “X” indicates don’t care.
8051/USB
Register Name Byte Access Offset Dword Access Offset
Space
Figure 8-1 lists the registers available in the USB Slave register space.
0x070000
USB Interrupt IN CSR2
0x06001C 0x06004C
Interrupt Enable (R7) OUT MAXP
0x060020 0x060050
OUT CSR1
0x060024 0x060054
Interrupt Enable (R9) OUT CSR2
0x060028 0x060058
Out Write Count 1
0x06002C 0x06005C
The MCU writes to this register the value received through a SET_ADDRESS device request. This address
will then be used for the next token following the successful completion of the SET_ADDRESS transfer.
7 6 5 4 3 2 1 0
ADDR FUNCTION
Set RW
R R
Power Management
7 6 5 4 3 2 1 0
ISO Reserved RESET UC SUSPEND ENABLE
RW RW R RW R RW
R R RW R RW R
Note: The MCU should use the USB Interrupt Register to poll for suspend and reset conditions.
Interrupt Registers
These registers act as status registers for the MCU when it is interrupted. The bits in these registers are cleared
by the MCU by writing a 1 to each bit that was set.
IN Interrupt Register
All interrupts corresponding to endpoints whose direction is programmable (TYPE = IN_OR_OUT) are
mapped to this register. The corresponding bits in the OUT INTERRUPT register will be reserved.
Note: Left unchanged by Reset Signaling.
7 6 5 4 3 2 1 0
EP1 - EP7 IN or IN_OR_OUT INTERRUPTS1 EP0
R R
Set Set
1. If an endpoint is OUT only (not IN, IN_OR_OUT, or IN_AND_OUT type), the corresponding bits are
reserved.
All interrupts corresponding to endpoints whose direction is programmable (TYPE = IN_OR_OUT) are not
mapped to this register. These bits will be RESERVED.
Note: Left unchanged by Reset Signaling.
7 6 5 4 3 2 1 0
EP1 - EP7 OUT INTERRUPTS1
R Reserved
Set
1. If an endpoint is direction IN or programmable (TYPE=IN or TYPE=IN_OR_OUT), the corresponding bits
are reserved.
USB Interrupt
7 6 5 4 3 2 1 0
USB RESET RESUME SUSPEND
Reserved R R R
Set Set Set
For each interrupt register, there is a corresponding Interrupt Enable register. Register R7 masks the interrupts
in the IN Interrupt Register R2; register R9 masks the interrupts in the OUT Interrupt Register R4; and register
R11 masks the interrupts in the USB Interrupt Register R6 (except that the Resume Interrupt cannot be
masked, i.e. USB Interrupt Enable Register D1 is ignored).
In each of these registers, if bit = 0, the interrupt is disabled. If bit = 1, the interrupt is enabled.
Please note that in each case it is the connection between the interrupt bit becoming set and MC_INTR going
low that is enabled or disabled: the interrupt registers themselves record when each interrupt is set even when
the interrupt is disabled.
After reset, the IN and OUT Interrupt Enable Registers (registers R7 and R9) are set to enable the interrupts
corresponding to the configured range of Endpoints, while the USB Interrupt Enable Register (R11) is set to
just enable USB Reset Interrupts.
8 - 10 USB Slave
7 6 5 4 3 2 1 0
USB INTERRUPT ENABLE
Reserved R/W
R
USB Slave 8 - 11
There are two Frame Number registers, R12 and R13. These two registers record the frame number received
through the SOF taken. This information can be read by the MCU when it detects a SOF_PULSE from the
core.
If the SOF token received is corrupted, a synthetic SOF_PULSE is generated (pulse width = one 12MHz clock)
but the Frame number register remains unchanged.
Firmware can use these registers to determine the start and end points of an Isochronous transfer.
8 - 12 USB Slave
Index Register
Index (R14)
7 6 5 4 3 2 1 0
INDEX REGISTER
R/W
R
USB Slave 8 - 13
IN MAXP Register
IN MAXP
The packet size may be set in multiples of 8 bytes up to 1023 bytes. If the MCU writes a value greater than the
FIFO size, the value recorded will be automatically changed to select the FIFO size.
7 6 5 4 3 2 1 0
MAXP
R/W
R
1. For IN_OR_OUT type endpoints, MAXP is mapped to this register irrespective of the direction of the end-
point. EP0 is considered to be IN_OR_OUT type, so its MAXP is mapped to IN MAXP register
8 - 14 USB Slave
IN CSR Registers
These registers maintain the control and status bits for IN endpoints. They are split into IN CSR1 and IN
CSR2. IN CSR1 maintains the status bits, while IN CSR2 maintains the configuration bits.
IN CSR1
7 6 5 4 3 2 1 0
Reserved CLR SENT SEND FIFO UNDER FIFO_NOT IN
R W R R/W RW R R R
R R Set R Clear Set Set Clear
An interrupt is generated when the USB clears this bit to prompt the MCU to load the
next packet. While this bit is set, the MCU will not be able to write to the FIFO.
This bit cannot be set if the SEND_STALL bit (D5) has been set by the MCU.
USB Slave 8 - 15
Note: D0 and D1 together can be used to indicate the FIFO state—in particular, whether it is Write Ready or Write Busy—as
follows:
IN CSR2
7 6 5 4 3 2 1 0
AUTO_SET ISO MODE_IN RATE
R/W R/W R/W R/W Reserved
R R R R
8 - 16 USB Slave
OUT MAXP
The packet size may be set in multiples of 8 bytes up to 1023 bytes. If the MCU writes a value greater than the
FIFO size, the value recorded will be automatically changed to select the FIFO size.
The packet size may be set in multiples of 8 bytes up to 1023 bytes. If the MCU writes a value greater than the
FIFO size, the value recorded will be automatically changed to select the FIFO size.
7 6 5 4 3 2 1 0
MAXP
R/W
R
USB Slave 8 - 17
There are two CSR registers, OUT CSR1 and OUT CSR2, which are used to control OUT endpoints by the
MCU. OUT CSR1 maintains status information, while OUT CSR2 is used to configure the endpoint.
OUT CSR1
7 6 5 4 3 2 1 0
CLR SENT SEND FIFO DATA OVER FIFO_FULL OUT
W R R/W W R R R R
R Set R Clear R/W Set Set Set
0 OUT OUT_PKT_RDY. The USB sets this bit once it has loaded a packet of data into the
FIFO. Once the MCU reads the FIFO for the entire packet, this bit should be cleared
by the MCU1.
1. See AUTO_CLR.
8 - 18 USB Slave
OUT CSR2
7 6 5 4 3 2 1 0
AUTO_CLR ISO
R/W R/W Reserved
R R
USB Slave 8 - 19
EP0 CSR
7 6 5 4 3 2 1 0
SERV_SET SERV_OUT SEND SETUP_END DATA_END SENT IN OUT
W W R/W R R R R R
Clear Clear Clear Set Clear Set Clear Set
1. The OUT_PKT_RDY bit may be set at the same time that the SETUP_END bit is set. This happens when the
current transfer has ended, and a new control transfer is received before the MCU can service the interrupt. In
such a case, the MCU should first clear the SETUP_END bit, and then start servicing the new control transfer.
2. In the case of a control transfer with no data phase, then after unloading the setup token the MCU sets
IN_PKT_RDY and DATA_END at the same time that it clears OUT_PKT_RDY for the Setup token.
8 - 20 USB Slave
The OUT Write Count registers are used to record the write count (that is, the number of bytes in the packet
that is due to be unloaded by the MCU).
7 6 5 4 3 2 1 0
OUT_WRT_CNT1
R
W
7 6 5 4 3 2 1 0
OUT_WRT_CNT2
R
W
USB Slave 8 - 21
9 GPIO/I2C
Functional Overview
GPIO Interface
I2C Interface
The SM502 supports one I2C interface (GPIO bits 46:47). The interface is in Master mode with 7-bit
addressing. It supports speeds up to 400 kb/s (Fast mode).
Figure 9-1 shows a simplified block diagram of the I2C interface.
I2C Top
Data
GPIO
CPU
SDA
SCL
I2C Core
Interface
Control
GPIO/I2C 9-1
Programmer’s Model
The base address of the GPIO is not fixed, and can be different for any particular system implementation.
However, the offset of any particular register from the base address is fixed.
The following locations are reserved and must not be used during normal operation:
• Locations at offsets 0x424 to 0xFCC are reserved for possible future extensions and test purposes
Figure 9-2 shows how this 64kB region in the MMIO space is laid out. It controls the GPIO registers and the
I2C Master registers.
MMIO_base +
0x000000
0x010000
MMIO_base +
GPIO / I2C Master
0x010000
0x020000 GPIO Register Space
0x010020
PWM Register Space
0x010040
I2C Master Register Space
0x010060
0x200000
0x200000
9-2 GPIO/I2C
Register Descriptions
The GPIO and I2C registers are shown in Table 9-1.
Offset from
Type Width Reset Value Register Name
MMIO_base1
I2C Master
0x010044 -
R/W 8 0x00 I2C Data
0x010053
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
GPIO/I2C 9-3
The GPIO registers control the GPIO pins. There are seven GPIO registers, two of which share the same
address for interrupt status/reset. Figure 9-3 defines the register layout for the GPIO registers.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data31:16
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data15:0
R/W
This register reflects the value on a GPIO pin. If it is programmed as an input, the value of the GPIO pin is
transferred to the corresponding bit in this register. If it is programmed as an output, the value of the bit is
transferred to the corresponding GPIO pin.
9-4 GPIO/I2C
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data63:48
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data47:32
R/W
This register reflects the value on a GPIO pin. If it is programmed as an input, the value of the GPIO pin is
transferred to the corresponding bit in this register. If it is programmed as an output, the value of the bit is
transferred to the corresponding GPIO pin.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Direction31:16
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Direction15:0
R/W
GPIO/I2C 9-5
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Direction63:48
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Direction47:32
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Trigger54:48
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Active54:48 Enable54:48
Res Res
R/W R/W
9-6 GPIO/I2C
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Status54:48
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reset54:48
Reserved
W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved
GPIO/I2C 9-7
The I2C Master registers control the I2C GPIO pins. Figure 9-4 defines the register layout for the I2C Master
registers.
9-8 GPIO/I2C
I2C Control
GPIO/I2C 9-9
I2C Status
I2C Reset
9 - 10 GPIO/I2C
I2C Data
GPIO/I2C 9 - 11
10 ZV Port
Functional Overview
This section covers the ZV Port and the Video Capture Unit.
ZV Port Overview
The SM502 Zoom Video Port (ZV Port) can interface with video decoders, such as NTSC/PAL decoders,
MPEG-2 decoders, and JPEG codecs. The ZV Port also can interface directly to an NTSC/PAL decoder, such
as the Philips SA7111 or BT819. Figure 10-1 illustrates an example of the interface between the Philips
SA7118 TV decoder and the ZV Port.
SM502 SAA7118E
GPIO55 DQ
GPIO56 HPD0
GPIO57 HPD1
GPIO58 HPD2 ZV Port 1
GPIO59 HPD3
GPIO60 HPD4
GPIO61 HPD5
GPIO62 HPD6
GPIO63 HPD7
GPIO16 IPD0
GPIO17 IPD1
GPIO18 IPD2
GPIO19 IPD3
GPIO20 IPD4
GPIO21 IPD5
GPIO22 IPD6 ZV Port 0
GPIO23 IPD7
VP_CLK IDQ
VP_HREF IGPH
VP_VSYNC IGPV
GPIO46/I2CCK SCL
GPIO47/I2CDA SDA
Incoming video data from the ZV Port can be interlaced or non-interlaced and YUV or RGB format. By
disabling the video capture function, the ZV Port can be configured in output mode. In output mode, the ZV
Port can send video data and 18-bit graphics in RGB format.
The Video Capture Unit captures incoming video data from the ZV Port and then stores the data into the frame
buffer. The Video Capture Unit maintains display quality and balances the capture rate. Its key features are:
ZV Port 10 - 1
10 - 2 ZV Port
Programmer’s Model
Figure 10-2 shows how this 64kB region in the MMIO space is laid out. It controls the ZV Port capture
registers.
0x0A0000
Capture Buffer 1 Address
0x090014
Capture Buffer Offset
0x090018
Capture FIFO Control
0x09001C
YRGB Constant
0x200000 0x090020
Line Compare
0x090024
MMIO_base + ZV Port 1
0x098000
Capture Control
0x098004
Capture Clipping
0x098008
Capture Size
0x09800C
Capture Buffer 0 Address
0x098010
Capture Buffer 1 Address
0x098014
Capture Buffer Offset
0x098018
Capture FIFO Control
0x09801C
YRGB Constant
0x098020
ZV Port 10 - 3
Register Descriptions
ZV Port 0 Registers
Offset from
MMIO_base1 Type Width Reset Value2 Register Name
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. In the reset values, “X” indicates don’t care.
10 - 4 ZV Port
Capture Control
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
F I CB VSS ADJ HA VS HS
Reserved Reserved
R R R R R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FD VP HP CP UVS BS CS CF FS W B DB CC RGB 656 E
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
ZV Port 10 - 5
10 - 6 ZV Port
Capture Clipping
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
YClip
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XClip
Reserved
R/W
Capture Size
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Height
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Width
Reserved
R/W
ZV Port 10 - 7
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Memory Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
0000
R/W
10 - 8 ZV Port
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Memory Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
0000
R/W
ZV Port 10 - 9
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Offset
0000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FIFO
Reserved
R/W
10 - 10 ZV Port
YRGB Constant
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Y R
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
G B
R/W R/W
Line Compare
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
L-COMP
Reserved
R/W
ZV Port 10 - 11
ZV Port 1 Registers
Offset from
Type Width Reset Value2 Register Name
MMIO_base1
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. In the reset values, “X” indicates don’t care.
Capture Control
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
F I CB VSS Panel ADJ HA VS HS
Reserved Reserved
R R R R R/W R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FD VP HP CP UVS BS CS CF FS W B DB CC RGB 656 E
R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W
10 - 12 ZV Port
ZV Port 10 - 13
Capture Clipping
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
YClip
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
XClip
Reserved
R/W
10 - 14 ZV Port
Capture Size
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Height
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Width
Reserved
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Memory Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
0000
R/W
ZV Port 10 - 15
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
S Ext CS Memory Address
Reserved
R/W R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
0000
R/W
10 - 16 ZV Port
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Offset
0000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
FIFO
Reserved
R/W
ZV Port 10 - 17
YRGB Constant
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Y R
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
G B
R/W R/W
10 - 18 ZV Port
SM502
AC97/I2S
GPIO [28:24]
I2S
8051 Control
The SM502 provides a raw audio data transmission interface that can be configured as either an I2S or an
AC97-link interface.
The AC97-link and I2S functional blocks share the same set of external pins, so only one can be active at a
time. Both AC97-link and I2S can be programmed by the on-chip 8051 or an external CPU. The on-chip 8051
uses byte accesses.
For I2S, the SM502 can be programmed to be either master or slave. For AC97-link, the SM502 acts as a
controller.
For the AC97-link interface, only slot 0 to slot 4 transmissions are supported.
Programmer’s Model
Figure 11-2 shows how this 64kB region in the MMIO space is laid out. It contains the registers to control the
AC97-link and I2S interfaces.
0x0A0100 0x9100
0x0A0000 0x09100 AC97
0x0A0200 0x9200
AC97 / I2S I2S
0x0A00 0x0A0300 0x9300
0x0B0000
0x0C0000
0x200000
Register Descriptions
The AC97-link and I2S registers are shown in Table 11-1.
AC97-Link
I2S
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. The 8051 uses byte accesses.
Figure 11-3 shows how the 256-byte region in the MMIO space is laid out. It contains the registers to control
the AC97-Link Controller.
AC97 TX Slots
0x0A0140 0x9140
0x0A0200
0x0C0000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
V S1 S2 S3 S4
00000000000
R/W R/W R/W R/W R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
R Index
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Index
000000000000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
0000
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data
Reserved
R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R S1 S2 S3 S4
Reserved
R R R R R
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Index
Reserved 0
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Index R3 R4
Reserved
R R R
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data
Reserved
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
Reserved
R
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data
Reserved
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Data
Reserved
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Drop S B W Status WI WR CR E
Res
R R/W R R R R/W R/W R/W R/W
Figure 11-4 shows how the 256-byte region in the MMIO space is laid out. It contains the registers to control
the I2S Controller.
0x0A0200 0x9200
MMIO_base + 8051
I2S TX Data Left
0x0A0000 0x0A0204 0x9204
I2S TX Data Right
0x0A0208 0x9208
I2S RX Data Left
0x0A020C 0x920C
I2S RX Data Right
0x0A0210 0x9210
0x0A0100 0x9100
I2S Control & Status
AC97 0x0A0214 0x9214
0x0A0200 0x9200
I2S Clock Control
I2S 0x0A0218 0x9218
0A0300
0x0A0300 0x9300
0x0A0300
0x0C0000
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
R T E
Reserved Reserved Reserved
R R R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
M W C
Reserved
R/W R/W R/W
12 8051 µ-Controller
Functional Overview
The 8051 µ-controller is an industrial-standard microcontroller. It is embedded in the SM502 to offload the
host CPU from some I/O controlling tasks, such as I2S, AC97-link, and USB slave control. The 8051 also can
be used to control a 16-bit external bus for interfacing with external devices.
8051 µ-Controller 12 - 1
Programmer’s Model
Figure 12-1 shows how this 64kB region in the MMIO space is laid out. It contains the registers that control the
8051 µ-controller.
MMIO_base + 8051
0x000000
MMIO_base + 8051
0x0B0000 0x9000
Reset
0x0B0004 0x9004
Mode Select
0x0B0008 0x9008
0x0B0000 0x9000
8051 Protocol Interrupt
0x0B000C 0x900C
8051 µ-controller CPU Protocol Interrupt
0x0C0000 0xA000 0x0B0010 0x9010
0x200000 0x0C0000
12 - 2 8051 µ-Controller
Register Descriptions
The 8051 µ-controller registers are shown in Table 12-1.
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. Not accessible.
Reset
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
E
Reserved
R/W
Make sure E is 0 when downloading code into the 12kB Program/Data SRAM.
8051 µ-Controller 12 - 3
Mode Select
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
USB M I T C S
Reserved R/W R/W R/W R/W R/W R/W
R R R R R R
12 - 4 8051 µ-Controller
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Token
R
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Token
R
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Token
W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Token
W
8051 µ-Controller 12 - 5
MMIO_base + 8051
0x000000
MMIO_base + 8051
0x0C0000 0x0000
8051 Program/
Data SRAM
0x0C0000 0x00000
0x0C3000 0x3000
8051 µ-controller SRAM Dual Port 8051 SRAM
0x0D0000 0x10000 0x0C4000 0x4000
0x200000 0x0D0000
The first 12kB of SRAM contain the program code and data for the 8051 µ-controller. The host CPU can
initialize this memory with the program and data code and can let the 8051 µ-controller execute the code by
waking up the 8051 from Reset mode.
The host CPU can access the first 12kB of SRAM only when the 8051 is in Reset mode.
The 4kB of Dual Port 8051 SRAM acts as a data buffer for communication between the 8051 µ-controller and
the host CPU. Care should be taken to never let the CPU and 8051 µ-controller access the same memory
location at the same time. This can be done by using software protocols and interrupt handshaking:
1. The CPU writes some data into any address inside the 4kB region.
2. The CPU generates an interrupt to the 8051 and sends address and size as a token to the 8051.
3. The 8051 starts working on the data and generates an interrupt back to the CPU when it is finished.
4. In the meantime, the CPU can start filling another chunk of data inside the 4kB region and can send the
8051 that address and size when the 8051 interrupts the CPU from step 3.
12 - 6 8051 µ-Controller
In 12-bit address mode, the address lines can either be send directly out from the 8051 µ-controller, or they can
be latched by the ALE# signal. This way the 8051 µ-controller can be very flexible in protocol programming.
For example, it could be a very simple protocol or a more complicated MOST protocol.
In 8-bit address mode, the GPIO[15:12] pins are connected to the 8051 µ-controller P2[3:0] outputs.
Table 12-2 shows the pin assignment for both 8-bit and 12-bit address mode interfaces.
8-bit Address Mode P2[3:0] output Ext_wait ALE WRn RDn AD[7:0]
Bit 4 in the Mode Select register (0x0B0004) selects between 8-bit and 12-bit address modes.
GPIO bits 48:53 are tied to the 8051 µ-controller port P1 input bits 0:5, and can be used as either standard
GPIO inputs (the 8051 µ-controller ignores them), interrupts for external devices, or 8051 µ-controller input
pins. Bit 54 of GPIO is tied to the 8051 µ-controller INT0# line.
8051 µ-Controller 12 - 7
The example shown in Figure 12-3 uses the Oasis MOST controller.
The 8051 µ-controller parallel interface is programmed in 12-bit address mode, with latching turned on. The
WR# and RD# signals are directly connected to the MOST controller. The latched address bits A9:8 are
connected to the MOST controller 2-bit address bus. The data bits AD7:0 are connected to the MOST
controller 8-bit data bus. The MOST controller control and interrupt lines are connected to the SM502’s GPIO
pins.
OS8104
SM502
8051
GPIO[7:0]
AD0 D0
.. ..
AD7 D7
A8 A8 GPIO12
.. .. LA0 PAD[0]
GPIO13
A11 A11 LA1 PAD[1]
GPIO14
LA2
GPIO15
LA3
GPIO10
ALE >
GPIO10 ALE
RD# GPIO8
RD#
WR# GPIO9
WR#
INT0# GPIO54 AINT#
P1[0] GPIO48 FRAME_SYNC
GPIO49
P1[1] SRC_FLOW
12 - 8 8051 µ-Controller
Display
System Controller
Memory
Command
System Interpreter Local
Memory Memory Local
Controller Controller
Draw Memory
Engine
CPU
DM A
Two DMA channels, DMA0 and DMA1, within the SM502 handle memory data transfers, thus offloading the
CPU. One DMA channel moves data between external/internal SDRAM and the 8051’s SRAM; the other
DMA channel moves data between internal and system memory.
• DMA0—Moves data between local or system memory and the internal 8051’s SRAM (see Figure 13-2)
There are four ways to move data in DMA0:
8051
SRAM
System
Memory
System Local Local
Memory DMA Memory
Controller Controller Memory
CPU
• DMA1—Moves data between system memory and local memory (see Figure 13-3)
There are four ways to transfer data in DMA1:
SM502
8051
SRAM
System Local
System Memory DMA Memory Local
Memory Controller Controller Memory
Register Descriptions
Figure 13-4 shows how this 64kB region in the MMIO space is laid out. It controls the DMA registers.
0x0D0000 0x0D0010
DMA 1 Source Address
DMA 0x0D0014
0x0D0020
DMA Abort & Interrupt
0x0D0024
0x200000
Offset from
Type Width Reset Value Register Name
MMIO_base1
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Memory Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
00
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
00
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Act Dir
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Size
00
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Memory Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
00
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Ext CS Memory Address
Reserved
R/W R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Memory Address
00
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Act Size
Reserved
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Size
00
R/W
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Abort1:0 Int1:0
Reserved Reserved
R/W R/W
14 UART
Functional Overview
UART0 and UART 1 perform these functions:
• Serial-to-parallel conversion on data received from a peripheral device
The CPU reads and writes data and control/status information through the CPU interface. The transmit and
receive paths are buffered with internal FIFO memories enabling up to 64 bytes to be stored independently in
both transmit and receive modes.
The UARTs:
• Include a programmable baud rate generator that generates a common transmit and receive internal clock from the
UART internal reference clock input, UARTCLK
The UART operation and baud rate values are controlled by the Line Control register and the Baud Rate
Divisor registers.
• A single combined interrupt so that the output is asserted if any of the individual interrupts are asserted and unmasked
If a framing, parity, or break error occurs during reception, the appropriate error bit is set, and is stored in the
FIFO. If an overrun condition occurs, the overrun register bit is set immediately and FIFO data is prevented
from being overwritten.
The input modem status signal, Clear To Send (nCTS), and output modem control line, Request To Send
(nRTS), are supported.
There is a programmable hardware flow control feature that uses the nCTS input and the nRTS output to
automatically control the serial data flow.
Modem Signals
The Request To Send (nRTS) output is controlled through the Modem Control register. Read the Modem Status
register to get the status of the Clear To Send (nCTS) input. The UART can be programmed to generate an
interrupt any time nCTS is asserted. The nDSR, nRI, and nDCD modem signals are tied to a logic 1.
Data Reception
Data is clocked into the RX Shift register according to the divided-by-16 Receive clock. The Baud Rate
Generator creates this clock. When 32 bits have been clocked into the Receiver, they are sent to either the RX
Buffer register or the RX FIFO (if enabled) for reading by the CPU. Bit 0 of this register contains the first bit of
UART 14 - 1
data to be received. The Receiver also checks for the stop and parity bits within this data, as specified by the
Line Control register.
Each UART can be programmed to generate several receive interrupts, such as:
• an RX Data Received interrupt when the data is transferred to the RX Buffer register or when the RX
Trigger Level is reached (if FIFOs are enabled)
• incorrect parity
• RX FIFO character timeout
• missing stop bits (frame errors)
• line status errors
When the RX FIFO is enabled through the FIFO Control register, the RX FIFO can receive up to 64 bytes of
data. IRQ is asserted when the RX FIFO contains one byte of data, is a quarter full, is half full, or has only two
bytes empty.
Data Transmission
Data transmission begins when the transmit data is written to the TX Holding register or the TX FIFO (if
enabled). The transmit data is subsequently sent to the TX Shift register with the addition of any applicable
start, stop, or parity bits as determined by the Line Control register. The transmit bits are then shifted out of the
TX Shift register in the following order:
1. Start bit
2. Data bits (least-significant bit first)
3. Parity bit
4. Stop bit
These bits are clocked according to the Baud Rate Generator clock, which is divided by 16.
Each UART can be programmed to generate a TX Holding Register Empty interrupt when the TX Holding
register or the TX FIFO (if enabled) becomes empty.
When the TX FIFO is enabled through the FIFO Control register, the TX FIFO can store up to 64 bytes of data.
Transmission proceeds until the TX FIFO is empty. The IRQ signal determines whether or not the FIFO can
accept more data.
Each UART supports separate hardware transmission and reception flow control. The Enhanced Feature
register handles the enabling of both functions. When hardware flow control is enabled, the nCTS and nRTS
signals control the transmission and reception of data, respectively.
When hardware transmission flow control is enabled, the UART disables transmission of characters when the
nCTS signal is sampled when it is inactive (logic 1). All character transmissions that are currently in progress
will complete. Further data transmission will resume when nCTS is sampled active (logic 0).
When hardware reception flow control is enabled, the UART drives nRTS to its inactive state (logic 1) when
the RX FIFO exceeds its trigger level. nRTS is driven active when the RX FIFO falls below its trigger level.
Note: Hardware reception flow control is enabled only when the RTS bit in the Modem Control register is set. The RTS bit can be
used independent of this feature for flow control.
14 - 2 UART
When software flow control is enabled, it controls data transmission and reception by the transfer of defined
XON and XOFF characters. Each XON/XOFF character can be associated with up to two bytes; these can be
chosen to represent either a single or a double character. The UART contains four XON/XOFF registers:
XON 1, XON 2, XOFF 1, and XOFF 2. The Enhanced Features register determines which XON/XOFF
registers are to be used. On reset, the characters in the XON/XOFF registers are defined by configuration
constants. The default is all zeros for compatibility with existing driver software.
In software flow control, received data characters are compared with the XOFF character. Upon a match, the
transmission channel is disabled when the current character finishes transmission. If the XOFF interrupt is
enabled through the Interrupt Enable register, an interrupt is generated at this point. The transmission channel
is re-enabled when an XON character is received.
Note: If a single character XON/OFF is selected, then received XON/XOFF characters are not placed in the RX FIFO. When a
parity or framing error occurs during reception of an XON/XOFF character, the received character is treated as normal
data, not as an XON/XOFF character.
When the XOFF character is received, the XOFF status bit in the Modem Control register is set (if software
flow control is enabled). This read-only bit subsequently is cleared when an XON character is received. The
XOFF status bit also is cleared upon a reset. Writing to this bit has no effect.
In software flow control, the XOFF character is sent when the RX FIFO exceeds its threshold level. When the
RX FIFO falls below its threshold level, the XON character is sent, thus re-enabling transmission from the
other end of the link.
Four bits in the Enhanced Features register determine the operation for software flow control as indicated in
Table 14-1.
Enhanced Features
Bits [3:0] Software Flow Control Option
UART 14 - 3
UART Timings
Transmit Engine
The Transmit Engine begins operation two to three baud clocks from the time that the TX Holding register or
the TX FIFO is written. The SOUT signal is driven low seven to eight baud clocks later.
When bits 3:0 of the FIFO Control register are being used to clear the FIFOs, note the following with regards
to some of these bits:
• Bit 0, FIFOE, enables/disables the FIFOs. When there is a master reset, both FIFOs are reset and remain in
the reset state unless FIFOE is set to 1.
• Bit 1, CLRR, clears the RX FIFO. When this bit is set, the RX FIFO is cleared after at least one clock, as is
this self-clearing bit.
• Bit 2, CLRT, clears the TX FIFO. When this bit is set, the TX FIFO is cleared after at least one clock, as is
this self-clearing bit.
A TX Holding Register Empty interrupt is generated 17 to 18 clocks after data is written to the TX Holding
Register, assuming that the Transmit Engine was idle when the data was written. If the TX Holding register is
empty and the TX Holding Register Empty interrupt is enabled, an interrupt is generated immediately.
The output of the Baud Rate Generator differs from the 16550 operation as follows. A division by 1 produces a
logic 1 signal.
IrDA Modulation/Demodulation
Each SM502 UART provides basic IrDA 1.0 SIR modulation and demodulation. The UARTs use the x16
transmit and receive clocks to generate 3/16 width pulses.
14 - 4 UART
Register Descriptions
Table 14-2 shows the UART0/IrDA0 registers. Table 14-3 shows the UART1/IrDA1 registers.
1. Refer to Table 1-6 on page 1-36 for MMIO_base values depending on the CPU.
UART 14 - 5
1. Refer to Table 1-6 on page 1-36 for MMIO_base values depending on the CPU.
Figure 14-1 shows how the 64kB region in the MMIO space is laid out. It controls the UART0/1 and IrDA0/1
registers.
14 - 6 UART
MMIO_base +
0x030000
UART0 / IrDA0
0x030000 0x030020
UART1 / IrDA1
0x030040
UART / IrDA
0x040000
0x200000 0x040000
UART 14 - 7
The UART / IrDA is working in “normal mode” when DLAB (bit [7] of the Line Control register) is “0”. The
UART / IrDA address space supports eight registers as defined in Figure 14-2.
0x030020
RX Buffer/TX Holding
0x040000 0x030024
Interrupt Enable
0x030028
Interrupt Identification/
FIFO Control
0x03002C
Line Control
0x030030
Modem Control
0x030034
Line Status
0x030038
Modem Status
0x03003C
Scratch
0x030040
14 - 8 UART
RX Buffer
7 6 5 4 3 2 1 0
Data
R
TX Holding
UART 14 - 9
Interrupt Enable
14 - 10 UART
Interrupt Identification
The following table gives the interrupt ID codes associated with the possible interrupts:
UART 14 - 11
FIFO Control
14 - 12 UART
Line Control
UART 14 - 13
Modem Control
14 - 14 UART
Line Status
UART 14 - 15
Modem Status
Scratch
Scratch
14 - 16 UART
The UART / IrDA is working in “configuration mode” when DLAB (bit [7] of the Line Control register) is “1”.
The Divisor Latch registers are available as defined in Figure 14-3.
0x030000
MMIO_base +
0x030000 Divisor Latch (DLL)
Configuration Mode 0 (DLAB = 1) 0x030004
0x030008 Divisor Latch (DLM)
0x030008
0x030020
Configuration Mode 1 (DLAB = 1)
MMIO_base +
0x030028
0x030020
Divisor Latch (DLL)
0x030024
Divisor Latch (DLM)
0x030028
0x040000
The incoming clock is divided by the value in the Divisor Latch registers (1 – 65535) to generate the Baud Rate
Generator output signal (BAUD). These registers are accessible only when the DLAB bit in the Line Control
register is set.
Note: Division by 1 generates a constant-high BAUD signal.
Table 14-4 shows the required divisor to generate a given baud rate with an 8 MHz input clock. The generated
clock enable is 16x the required baud rate. Use the following equation to calculate clock frequencies (fclock) not
listed here:
UART 14 - 17
14 - 18 UART
The Enhanced Features, XONn, and XOFFn registers are only available when the value of the Line Control
register is 0xBF.
0x030008
Enhanced Features
0x03000C
Line Control
0x030010
MMIO_base +
XON1
0x030008 0x030014
Enhanced Register Set 0 XON2
0x030020 0x030018
0x030028
Enhanced Register Set 1 XOFF1
0x030040 0x03001C
XOFF2
0x030020
MMIO_base +
0x030028
0x040000
Enhanced Features
0x03002C
Line Control
0x030030
XON1
0x030034
XON2
0x030038
XOFF1
0x03003C
XOFF2
0x030040
Enhanced Features
UART 14 - 19
XON1
XON1[7:0]
XON2
XON2[7:0]
14 -20 UART
XOFF1
XOFF1[7:0]
XOFF2
XOFF2[7:0]
UART 14 - 21
15 PWM Specification
Functional Overview
The Pulse Width Modulation (PWM) module is a simple counter that can pulse with programmable pulse
widths. The pulse optionally can be tied to the PWM interrupt signal to generate a periodic interrupt for timing
or watchdog support. The input clock is the peripheral clock at 96 MHz. The output pulse starts high.
Any of the three available PWM circuits can be programmed to perform a single shot delay. Once the delay is
finished, an interrupt is triggered. The required delay is assumed to be 20 ms.
The values for the PWM n register are calculated as follows:
• Delay * clock = 20 ms * 96 MHz = 1,920,000
• A 50% duty cycle means 960,000 clocks are LOW and 960,000 clocks are HIGH
• The shift to a 12-bit value is done by dividing by 28: (3,750 – 1) clocks LOW and (3,750 – 1) clocks HIGH
Any of the three available PWM circuits can be programmed to act as a periodic timer to support a clock. The
periodic timer generates an interrupt after each cycle. The required periodic interval is assumed to be 1 s. For
this example, there is a 30/70% duty cycle.
The values for the PWM n register are calculated as follows:
• Delay * clock = 1 s * 96 MHz = 96,000,000
• A 30% duty cycle means 28,800,000 clocks are LOW and 67,200,000 clocks are HIGH
• The shift to a 12-bit value is done by dividing by 215: (879 – 1) clocks LOW and (2,051 – 1) clocks HIGH
External Pulse
In this example, the PWM is programmed for an external pulse with a frequency of 44.1 kHz and a duty cycle
of 15%.
• A 15% duty cycle means (327 – 1) clocks are LOW and (1,850 – 1) clocks are HIGH
PWM Specification 15 - 1
Register Descriptions
The PWM registers are shown in Table 15-1.
Offset from
Type Width Reset Value Register Name
MMIO_base1
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
The PWM registers control the three PWM pins. It contains three registers, one for each PWM pin. Figure 15-1
defines the register layout for the PWM registers.
15 - 2 PWM Specification
PWM 0
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
High Counter Low Counter
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Low Counter Clock Divide IP I E
Res
R/W R/W R/W R/W R/W
3 IP PWM Interrupt Pending. In order to clear a pending interrupt, write a “1” in the IP bit.
0: No interrupt pending.
1: Interrupt pending.
2 I Enable or Disable PWM Interrupt.
0: Disable PWM interrupt.
1: Enable PWM interrupt whenever a single cycle is completed.
1 Res This bit is reserved.
0 E Enable or Disable the PWM.
0: Disabled.
1: Enabled.
PWM Specification 15 - 3
PWM 1
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
High Counter Low Counter
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Low Counter Clock Divide
IP I Res E
R/W R/W
3 IP PWM Interrupt Pending. In order to clear a pending interrupt, write a “1” in the IP bit.
0: No interrupt pending.
1: Interrupt pending.
2 I Enable or Disable PWM Interrupt.
0: Disable PWM interrupt.
1: Enable PWM interrupt whenever a single cycle is completed.
1 Res This bit is reserved.
0 E Enable or Disable the PWM.
0: Disabled.
1: Enabled.
15 - 4 PWM Specification
PWM 2
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
High Counter Low Counter
R/W R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Low Counter Clock Divide IP I E
Res
R/W R/W R/W R/W R/W
3 IP PWM Interrupt Pending. In order to clear a pending interrupt, write a “1” in the IP bit.
0: No interrupt pending.
1: Interrupt pending.
2 I Enable or Disable PWM Interrupt.
0: Disable PWM interrupt.
1: Enable PWM interrupt whenever a single cycle is completed.
1 Res This bit is reserved.
0 E Enable or Disable the PWM.
0: Disabled.
1: Enabled.
PWM Specification 15 - 5
Register Block
The register block stores data written or to be read across the SM502 interface.
Clock Prescaler
When configured as a master, an internal prescaler, comprising two free-running reloadable serially linked
counters, is used to provide the serial output clock SCLKOUT.
You can program the clock prescaler, through the Clock Prescale register, to divide SSPCLK by a factor of 2 to
254 in steps of two. By not using the least significant bit of the Clock Prescale register, division by an odd
number is not possible, thus ensuring generation of a symmetrical (equal mark space ratio) clock.
The output of the prescaler is further divided by a factor of 1 to 256, through the programming of the SSP
Control 0 register, to give the final master output clock SCLKOUT.
Transmit FIFO
The common transmit FIFO is a 16-bit wide, eight lines deep, first-in, first-out memory buffer. CPU data
written across the SM502 interface are stored in the buffer until read out by the transmit logic.
When configured as a master or a slave parallel data is written into the transmit FIFO prior to serial conversion
and transmission to the attached slave or master respectively, through the SSPTXD pin.
Receive FIFO
The common receive FIFO is a 16-bit wide, 8-locations deep, first-in, first-out memory buffer. Received data
from the serial interface are stored in the buffer until read out by the CPU.
When configured as a master or slave, serial data received through the SSPRXD pin is registered prior to
parallel loading into the attached slave or master receive FIFO, respectively.
Transmit/Receive Logic
When configured as a master, the clock to the attached slaves is derived from a divided down version of
SSPCLK through the prescaler operations described previously. The master transmit logic successively reads a
value from its transmit FIFO and performs parallel to serial conversion on it. Then the serial data stream and
frame control signal, synchronized to SCLKOUT, are output through the SSPTXD pin to the attached slaves.
The master receive logic performs serial to parallel conversion on the incoming synchronous SSPRXD data
stream, extracting and storing values into its receive FIFO, for subsequent reading through the SM502
interface.
When configured as a slave, the SSPCLKIN clock is provided by an attached master and used to time its
transmission and reception sequences. The slave transmit logic, under control of the master clock, successively
reads a value from its transmit FIFO, performs parallel to serial conversion, then output the serial data stream
and frame control signal through the slave SSPTXD pin. The slave receive logic performs serial to parallel
conversion on the incoming SSPRXD data stream, extracting and storing values into its receive FIFO, for
subsequent reading through the SM502 interface.
The SSP generates three individual maskable, active HIGH interrupts. It also generates a combined interrupt
output that is the OR function of the three individual interrupt requests.
The single combined interrupt can be used with a system interrupt controller that provides another level of
masking on a per-peripheral basis. This option allows use of modular device drivers that always know where to
find the interrupt source control register bits.
The individual interrupt requests also can be used with a system interrupt controller that provides masking for
the outputs of each peripheral. In this way, a global interrupt controller service routine would be able to read
the entire set of sources from one wide register in the system interrupt controller. This is useful when the time
to read from the peripheral registers is significant compared to the CPU clock speed in a real-time system.
The SSP supports both the above methods because the overhead is small.
The transmit and receive dynamic data-flow interrupts, SSPTXINTR and SSPRXINTR, are separated from the
status interrupts so that data can be read or written in response to the FIFO trigger levels.
The SSP supports both asynchronous and synchronous operation of the clocks, PCLK and SSPCLK. The SSP
implements synchronization registers and handshaking logic, which are active at all times. This
implementation has a minimal impact on performance and area. The SSP synchronizes control signals in both
directions of data flow—from the PCLK to the SSPCLK domain and from the SSPCLK to the PCLK domain.
Operation
The operation of the SSP is described in the following subsections.
Following reset, the SSP logic is disabled and should be configured when in this state.
The SSP Control 0 and Control 1 registers configure the peripheral as a master or slave operating under one of
the following protocols:
• Motorola SPI
• National Semiconductor
The bit rate, derived from the external SSPCLK, requires the programming of the Clock Prescale register.
You can either prime the transmit FIFO, by writing up to eight 16-bit values when the SSP is disabled, or allow
the transmit FIFO service request to interrupt the CPU. Once enabled, transmission or reception of data begins
on the transmit (SSPTXD) and receive (SSPRXD) pins.
Clock Signals
The frequency selected for SSPCLK must accommodate the desired range of bit clock rates.
For example, for a range of bit clocks from 7.2 kHz to 1.8432 MHz, the SSPCLK frequency must be within the
range 3.6864 MHz to 468 MHz.
The frequency of SSPCLK must be within the required error limits for all baud rates to be used.
There is also a constraint on the ratio of clock frequencies for PCLK to SSPCLK. The frequency of SSPCLK
must be less than or equal to the frequency of PCLK.
See “Register Descriptions” on page 14 for more details on the bit assignment of this register.
The Serial Clock Rate value, in conjunction with the clock prescale divisor value in the Clock Prescale register,
is used to derive the SSP transmit and receive bit rate from the external SSPCLK.
The frame format is programmed through the Format bits and the data word size through the DataSize bits.
Bit phase and polarity, applicable to Motorola SPI format only, are programmed through the Ph and Pol bits.
See “Register Descriptions” on page 14, for more details on the bit assignment of this register.
To configure the SSP as a master, clear the SSP Control 1 register master or slave selection bit (M) to 0, which
is the default value on reset.
Setting the SSP Control 1 register M bit to 1 configures the SSP as a slave. When configured as a slave,
enabling or disabling of the SSP SSPTXD signal is provided through the slave mode output select bit (O). This
can be used in some multi-slave environments where masters might parallel broadcast.
Transmit and receive FIFO level interrupts can be enabled by setting the respective Transmit Interrupt Enable
(TI), Receive Interrupt Enable (RI), and Overflow Interrupt Enable (OI) bits within the SSP Control 1 register.
To enable the operation of the SSP, set the Synchronous Serial Port Enable (E) bit to 1.
The serial bit rate is derived by dividing down the input clock SSPCLK. The clock is first divided by an even
prescale value CPSDVSR from 2 to 254, which is programmed in the Clock Prescale register. The clock is
further divided by a value from 1 to 256, which is 1 + SCR, where SCR is the serial clock rate value
programmed in the SSP Control 0 register.
The frequency of the output signal bit clock SCLKOUT is defined below:
F SSPCLK
F SCLKOUT = --------------------------------------------------------
-
CPSDVR × ( 1 + SCR )
For example, if SSPCLK is 3.6864 MHz, and CPSDVSR = 2, then SCLKOUT has a frequency range from
7.2 kHz to 1.8432 MHz.
Frame Formats
Each data frame is between 4 and 16 bits long depending on the size of data programmed, and is transmitted
starting with the MSB. There are three basic frame types that can be selected:
• Texas Instruments synchronous serial
• Motorola SPI
For all three formats, the serial clock (SCLKOUT) is held inactive while the SSP is idle, and transitions at the
programmed frequency only during active transmission or reception of data. The idle state of SCLKOUT is
utilized to provide a receive timeout indication that occurs when the receive FIFO still contains data after a
timeout period.
For Motorola SPI and National Semiconductor Microwire frame formats, the serial frame (SFRMOUT) pin is
active LOW, and is asserted (pulled down) during the entire transmission of the frame.
For the Texas Instruments synchronous serial frame format, the SFRMOUT pin is pulsed for one serial clock
period starting at its rising edge, prior to the transmission of each frame. For this frame format, both the SSP
and the off-chip slave device drive their output data on the rising edge of SCLKOUT, and latch data from the
other device on the falling edge.
Unlike the full-duplex transmission of the other two frame formats, the National Semiconductor Microwire
format uses a special master-slave messaging technique, which operates at half-duplex. In this mode, when a
frame begins, an 8-bit control message is transmitted to the off-chip slave. During this transmit, no incoming
data is received by the SSP. After the message has been sent, the off-chip slave decodes it and, after waiting one
serial clock after the last bit of the 8-bit control message has been sent, responds with the requested data. The
returned data can be 4 to 16 bits in length, making the total frame length anywhere from 13 to 25 bits.
Figure 16-1 shows the Texas Instruments synchronous serial frame format for a single transmitted frame.
Figure 16-1: Texas Instruments Synchronous Serial Frame Format (Single Transfer)
SCLKOUT/
SCLKIN
SFRMOUT/
SFRMIN
4 to 16 bits
SSPOE
In this mode, SCLKOUT and SFRMOUT are forced LOW, and the transmit data line SSPTXD is 3-stated
whenever the SSP is idle. Once the bottom entry of the transmit FIFO contains data, SFRMOUT is pulsed
HIGH for one SCLKOUT period. The value to be transmitted is also transferred from the transmit FIFO to the
serial shift register of the transmit logic. On the next rising edge of SCLKOUT, the MSB of the 4-bit to 16-bit
data frame is shifted out on the SSPTXD pin. Likewise, the MSB of the received data is shifted onto the
SSPRXD pin by the off-chip serial slave device.
Both the SSP and the off-chip serial slave device then clock each data bit into their serial shifter on the falling
edge of each SCLKOUT. The received data is transferred from the serial shifter to the receive FIFO on the first
rising edge of SCLKOUT after the LSB has been latched.
Figure 16-2 shows the Texas Instruments synchronous serial frame format when back-to-back frames are
transmitted.
SCLKOUT/
SCLKIN
SFRMOUT/
SFRMIN
SSPTXD/
MSB LSB
SSPRXD
4 to 16 bits
SSPOE (=1)
Figure 16-3 shows the Motorola SPI frame format for a single frame. Figure 16-4 shows the same format when
back to back frames are transmitted.
In this mode, SCLKOUT is forced LOW, SFRMOUT is forced HIGH, and the transmit data line SSPTXD is
3-stated whenever the SSP is idle. Once the bottom entry of the transmit FIFO contains data, SFRMOUT is
pulsed LOW and remains LOW for the duration of the frame transmission. The falling edge of SFRMOUT
causes the value for transmission to be transferred from the bottom transmit FIFO entry to the serial shift
register of the transmit logic. The MSB of the 4-bit to 16-bit data frame is then shifted out on the SSPTXD pin
half an SCLKOUT period later. The SCLKOUT pin does not transition at this point.
The MSB of the received data is shifted onto the SSPRXD pin by the off-chip slave device as soon as the serial
framing signal goes LOW. Both the SSP and the off-chip serial slave device then latch each data bit into their
serial shifter on the rising edge of each SCLKOUT. At the end of the frame, the SFRMOUT pin is pulled HIGH
one SCLKOUT period after the last bit has been latched in the receive serial shifter. This causes the data to be
transferred to the receive FIFO.
Note: The off-chip slave device can 3-state the receive line either on the falling edge of SCLKOUT after the receive shifter has
latched the LSB, or when the SFRMOUT pin goes HIGH.
SCLKOUT/
SCLKIN
SFRMOUT/
SFRMIN
SSPTXD
MSB LSB
4 to 16 Bits
SSPOE
Figure 16-4 shows the Motorola SPI frame format when back to back frames are transmitted.
Figure 16-4: Motorola SPI Frame Format (Continuous Transfer) SPO = 0, SPH = 0
Continuous Transfer
SPH = 0, SPO = 0
SCLKOUT/
SCLKIN
SFRMOUT(=0)/
SFRMIN(=0)
SSPTXD/
SSPRXD MSB LSB
4 to 16 Bits
SSPOE (=1)
It is possible to change the Motorola clock phase and polarity by selecting the appropriate value of the Pol and
Ph bits in the SSP Control 0 register.
Figure 16-5 and Figure 16-6 show the operation of Pol and Ph.
SCLKOUT/
SCLKIN (Pol = 0)
SCLKOUT/
SCLKIN (Pol = 1)
SSPTXD
from Master MSB LSB
SFRMOUT/
SFRMIN
SCLKOUT/
SCLKIN (Pol = 0)
SCLKOUT/
SCLKIN (Pol = 1)
SSPTXD
from Master MSB LSB
SFRMOUT/
SFRMIN
For continuous transfers, data transmission begins and ends in the same manner as a single transfer. However,
the SFRMOUT line is continuously asserted (held LOW). The transmission of data also occurs back to back
(the MSB of the next frame follows directly after the LSB of the current frame.) Each of the received data
values is transferred from the receive shifter to the receive FIFO on the falling edge of SCLKOUT, after the
LSB of the frame has been latched into the SSP.
Figure 16-7 shows the National Semiconductor Microwire frame format, again for a single frame. Figure 16-8
shows the same format when back to back frames are transmitted.
SCLKOUT/
SCLKIN
SFRMOUT/
SFRMIN
SSPTXD
MSB 8-bit control LSB
SSPRXD 0
MSB 4 to 16 bits LSB
output data
SSPOE
Microwire format is very similar to SPI format, except that transmission is half-duplex instead of full-duplex,
using a master-slave message passing technique. Each serial transmission begins with an 8-bit control word
that is transmitted from the SSP to the off-chip slave device. During this transmission, no incoming data is
received by the SSP. After the message has been sent, the off-chip slave decodes it and, after waiting one serial
clock after the last bit of the 8-bit control message has been sent, responds with the required data. The returned
data is 4 to 16 bits in length, making the total frame length anywhere from 13 to 25 bits.
Like SPI mode, SCLKOUT is forced LOW, SFRMOUT is forced HIGH, and the transmit data line SSPTXD is
3-stated whenever the SPMSS is idle. A transmission is triggered by writing a control byte to the transmit
FIFO. The falling edge of SFRMOUT causes the value contained in the bottom entry of the transmit FIFO to
be transferred to the serial shift register of the transmit logic, and the MSB of the 8-bit control frame to be
shifted out onto the SSPTXD pin. SFRMOUT remains LOW for the duration of the frame transmission. The
SSPRXD pin remains 3-stated during this transmission.
The off-chip serial slave device latches each control bit into its serial shifter on the rising edge of each
SCLKOUT. After the last bit is latched by the slave device, the control byte is decoded during a one clock wait
state, and the slave responds by transmitting data back to the SSP. Each bit is driven onto SSPRXD on the
falling edge of SCLKOUT. The SSP in turn latches each bit on the rising edge of SCLKOUT. At the end of the
frame, for single transfers, SFRMOUT is driven HIGH one clock period after the last bit has been latched in
the receive serial shifter, causing the data to be transferred to the receive FIFO.
Note: The off-chip slave device can 3-state the receive line either on the falling edge of SCLKOUT after the LSB has been
latched by the receive shifter, or when SFRMOUT goes HIGH.
For continuous transfers, data transmission begins and ends in the same manner as a single transfer. However,
the SFRMOUT line is continuously asserted (held LOW) and transmission of data occurs back to back. The
control byte of the next frame follows directly after the LSB of the received data from the current frame. Each
of the received values is transferred from the receive shifter on the falling edge SCLKOUT, after the LSB of the
frame has been latched into the SSP.
SCLKOUT/
SCLKIN
SFRMOUT
SFRMIN
SSPTXD
LSB MS LS
8-bit control
SSPRXD 0
MSB 4 to 16 bits LSB MSB
output data
SSPOE
Setup and Hold Time Requirements—SFRMIN with Respect to SSPCLKIN, Microwire Mode
In Microwire mode, the SSP slave samples the first bit of receive data on the rising edge of SCLKIN after
SFRMIN has gone LOW. Masters that drive a free-running SCKLIN must ensure that the SFRMIN signal has
sufficient setup and hold margins with respect to the rising edge of SCLKIN.
Figure 16-9 illustrates these setup and hold time requirements. With respect to the SCLKIN rising edge on
which the first bit of receive data is to be sampled by the SSP slave, SFRMIN must have a setup of at least two
times the period of SSPCLK on which the SSP operates. With respect to the SCLKIN rising edge previous to
this edge, SFRMIN must have a hold of at least one SSPCLK period.
Figure 16-9: Microwire Frame Format, SFRMIN Input Setup and Hold Requirements
tHold = tSSPCLK tSetup = (2*tSSPCLK)
SCLKIN
SFRMIN
SSPRXD
Figure 16-10 shows the SSP instanced three times, as a single master and two slaves. The master can broadcast
to the two slaves through the master SSPTXD line. In response, only one slave drives its nSSPOE signal HIGH,
thereby enabling its SSPTXD data onto the SSPRXD line of the master.
SSPTXD SSPRXD
SSPOE SSPOE
SSPRXD SSPTXD
SSPMS Configured
as Slave
SSPMS Configured SFRMOUT SFRMIN
as Master
SFRMIN SFRMOUT
SCLKOUT SCLKIN
SSPCTLOE SSPCTLOE
SCLKIN SCLKOUT
SSPRXD
SSPOE
SSPTXD
SSPMS Configured
as Slave
SFRMIN
SFRMOUT
SCLKIN
SSPCTLOE
SCLKOUT
Figure 16-11 shows how an SSP, configured as master, interfaces to two Motorola SPI slaves. Each SPI Slave
Select (SS) signal is permanently tied LOW and configures them as slaves. Similar to the above operation, the
master can broadcast to the two slaves through the master SSP SSPTXD line. In response, only one slave drives
its SPI MISO port onto the master’s SSPRXD line.
SSPTXD MOSI
SSPOE
SSPRXD MISO
SFRMOUT
SSPMS Configured
as Master SPI Slave
SFRMIN
SCLKOUT SCK
SSPCTLOE
SS
SCLKIN
0V
MOSI
MISO
SPI Slave
SCK
SS
0V
Figure 16-12 shows a Motorola SPI configured as a master and interfaced to two instances of SSP configured
as slaves. In this case, the slave Select Signal (SS) signal is permanently tied HIGH and configures it as a
master. It is possible for the master to broadcast to the two slaves through the master SPI MOSI line and in
response, only one slave will drive its SSPOE signal HIGH, thereby enabling in SSPTXD data onto the
master’s MISO line.
MOSI SSPRXD
SSPOE
MISO SSPTXD
SFRMIN
SSPMS Configured
0V
SPI Master as Slave
SFRMOUT
SCK SCLKIN
Vdd
SSPCTLOE
SS
SCLKOUT
SSPRXD
SSPOE
SSPTXD
SFRMIN
SSPMS Configured
0V
as Slave
SFRMOUT
SCLKIN
SSPCTLOE
SCLKOUT
Register Descriptions
The base address of the SSP is not fixed, and might be different for any particular system implementation. The
offset of any particular register from the base address, however, is fixed.
Offset from
Type Width Reset Value2 Register Name
MMIO_base1
1. Refer to Table 1-6 on page 36 for MMIO_base values depending on the CPU.
2. In the reset values, “X” indicates don’t care.
Figure 16-13 shows how this 64kB region in the MMIO space is laid out. It controls the SSP registers.
MMIO_base +
0x020000
0x020000 SSP 0
0x020100
SSP SSP 1
0x020200
0x030000
0x030000
0x200000
Figure 16-14 shows how each SSP memory region is laid out.
0x020n00
MMIO_base + Control 0
0x020000 0x020n04
SSP 0 Control 1
0x020100 0x020n08
SSP 1 Data
0x020200 0x020n0C
Status
0x020n10
Clock Prescale
0x020n14
Interrupt Status
0x020n18
0x030000
Control 0
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Clock Ph Pol Format DataSize
R/W R/W R/W R/W R/W
Control 1
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O M E L OI TI RI
Reserved
R/W R/W R/W R/W R/W R/W R/W
Data
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Data
R/W
When the SSP is programmed for National Microwire frame format, the default transmit data size is eight bits
(the most significant byte is ignored).
Status
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
B R T
Reserved
R R R
Clock Prescale
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Prescale
Reserved 0
R/W
Interrupt Status
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
O T R
Reserved
R/W R R
Interrupts
The SSP can generate four interrupts. The following three of these interrupts are individual, maskable, active
HIGH interrupts:
• SSPRXINTR - SSP receives FIFO service interrupt request
This receive interrupt is asserted when there are four or more valid entries in the receive FIFO.
• SSPTXINTR - SSP transmits FIFO service interrupt request
This transmit interrupt is asserted when there are four or less valid entries in the transmit FIFO. This
interrupt is not qualified with the SSP enable signal, which allows operation in one of two ways. Data can
be written to the transmit FIFO prior to enabling the SSP and the interrupts. Alternatively, the SSP and
interrupts can be enabled so that data can be written to the transmit FIFO by an interrupt service routine.
• SSPRORINTR - SSP receives overrun interrupt request
This receive overrun interrupt is asserted when the FIFO is already full and an additional data frame is
received, causing an overrun of the FIFO. Data is overwritten in the receive shift register but not in the
FIFO.
The fourth interrupt, SSPINTR, is a combined single interrupt. The three interrupts also are combined into the
single output SSPINTR, which is an OR function of the individual masked sources. This output can be
connected to the system interrupt controller to provide another level of masking on an individual per-peripheral
basis. The combined SSP interrupt is asserted if any of the three individual interrupts are asserted and enabled.
Each of the three individual maskable interrupts can be enabled or disabled by changing the mask bits in the
SSP Control 1 register. Setting the appropriate mask bit HIGH enables the interrupt.
Provision of the individual outputs as well as a combined interrupt output allows use of either a global interrupt
service routine, or modular device drivers to handle interrupts.
The transmit and receive dynamic dataflow interrupts SSPTXINTR and SSPRXINTR have been separated
from the status interrupts, so that data can be read or written in response to just the FIFO trigger levels.
The status of the individual interrupt sources can be read from the SSP Interrupt Status register.
SSP0 5 SSP0
PWM 3 PWM[0:2]
Digital CRT / Zoom Video / FP 9 Digital CRT[7:0], CLK / ZV[15:8] / FP[17:16, 9:8, 1:0]
Panel
Address 4 CA[25:2]
Data 32 D[31:0]
System Memory
Data 32 MD[31:0]
Addr 13 MA[12:0]
Control 15 RAS#, CAS#, WE#, CKE, SCK+, SCK-, DSF, DQS, DQM[3:0],
BA[1:0], CS#
Others
Test 2 TEST[1:0]
Miscellaneous
No Connection 1 MVREF
Pinout
Figure 17-1 shows the pinout for the SM502 chip.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
CPURD HCAS
A CA5 CA10 CD4 CD1 CD5 CD8 CD12 CA18 CA24 CA19 CD17 CD21 CD23 CD25 CD31 HCLK BE3 HCKE BS#
# #
FP_ CRT_ CRT_ TEST GPIO GPIO GPIO GPIO GPIO GPIO
W MD26 MD27 MD28 MD29 FP2 FP6 FP11 FP15 FP20 FP23 VDEN
VSYNC HSYNC VSYNC 1 49 50 51 52 53 54
FP_ FP_ USB USB GPIO GPIO GPIO GPIO GPIO GPIO
Y MD30 MD31 MD23 MD22 MD21 FP5 FP10 FP14 FP19 FP22 R
HSYNC DISP GND PWR 55 56 57 58 59 60
Pin Descriptions
Each BGA ball of the MMCC is one of the following types:
• I: Input signal
• O: Output signal
• I/O: Input or Output signal
All outputs and I/O signals are 3-stated. Internal pull-ups for I/O pads are all 100KΩ resistors. Internal
pull-downs for I/O pads are all 100KΩ resistors.
Table 17-2: Pin Descriptions
Host/PCI Interface
ACK# C15 I CMOS 3.3V CPU Bus Acknowledge / PCI Bus Grant.
BE[3:0] A17, B17, C17, I/O CMOS 3.3V CPU Byte Enable / SDRAM Data Mask.
D17
BREQ# B16 O CMOS 3.3V CPU Bus Request / PCI Bus Request.
BS# A20 I CMOS 3.3V SH4 Cycle Start / XScale or NEC CPU Write Enable.
CA[11:2] E3, A2, B2, C2, I/O CMOS 3.3V CPU Address [11:2] / SDRAM MA.
D2, E2, A1, B1,
C1, D1
CA[13:12] C3, D3 I/O CMOS 3.3V CPU Address [13:12] / SDRAM BA / SDRAM MA.
CA[20:17] B13, A10, A8, D5 I/O CMOS 3.3V CPU Address [20:17] / PCI C/BE#[3:0] / SDRAM MA.
CA21 B9 I/O CMOS 3.3V CPU Address 21 / PCI DEVSEL# / SDRAM MA.
CA22 C8 I/O CMOS 3.3V CPU Address 22 / PCI STOP# / SDRAM BA / SDRAM
MA.
CA23 D9 I/O CMOS 3.3V CPU Address 23 / PCI TRDY# / SDRAM BA / SDRAM
MA.
CA24 A9 I/O CMOS 3.3V CPU Address 24 / PCI IRDY# / SDRAM BA.
HCS# C19 I CMOS 3.3V SM502 chip select. This signal has a weak internal
pull-up.
HRAS# B20 O CMOS 3.3V SDRAM Row Address select.
HRDY# B19 O CMOS 3.3V CPU Ready. This signal must be externally pulled-up for
SH4. For all other CPUs, this signal must be pulled-up.
HWE# B21 I/O CMOS 3.3V SH4 Write Enable / SDRAM Write Enable.
CLKOFF C20 I CMOS 3.3V Used to shut off host interface clock. This signal has a
weak internal pull-down.
Clock Interface
Test Interface
TEST[1:0] W15, V15 I CMOS 3.3V Test mode selection. Both signals have a weak internal
pull-down.
Internal Memory Interface
MA[12:0] R2, R4, T2, T3, O CMOS 3.3V SDRAM Address bus.
U1, P3, P2, P1,
N4, N3, N2, N1,
M3
MD[31:0] Y2, Y1, W4, W3, I/O CMOS 3.3V SDRAM Data bus. These signals have weak, internal
W2, W1, V3, V2, pull-down resistors.
Y3, Y4, Y5, AA1,
AA2, AA3, AA4,
AA5, H1, H2, H3,
J1, J2, J3, J4, K3,
G4, G3, G2, G1,
F3, F2, F1, E1,
FP[23:18], W10, Y10, V9, O CMOS 3.3V Flat panel data bus {23:18, 15:10, 7:2}.
FP[15:10], W9, Y9, AA9,
FP[7:2] W8, Y8, AA8, V7,
W7, Y7, AA7,
W6, Y6, AA6, V5,
W5
FP_DISP Y12 O CMOS 3.3V Flat panel display enable.
FP_HSYNC Y11 O CMOS 3.3V Flat panel TFT horizontal sync / STN line pulse.
FP_VSYNC W11 O CMOS 3.3V Flat panel TFT vertical sync / STN frame pulse.
CRT Interface
USB Interface
GPIO Interface — All 64 GPIO pins have weak, internal pull-down resistors
GPIO[7:0] G19, G18, F21, I/O CMOS 3.3V GPIO[7:0] / 8051 AD[7:0]. Note that these signals also
F20, F19, E20, function as strap pins. Refer to Table 1-5 on page 1-29
E19, E18 for more information.
GPIO8 G20 I/O CMOS 3.3V GPIO8 / 8051 RD#. This signal must be externally
pulled-up when used as 8051RD#.
GPIO9 G21 I/O CMOS 3.3V GPIO9 / 8051 WR#. This signal must be externally
pulled-up when used as 8051WR#.
GPIO10 H19 /O CMOS 3.3V GPIO10 / 8051 ALE#. This signal must be externally
pulled-up when used as 8051 ALE#.
GPIO11 H20 I/O CMOS 3.3V GPIO11 / 8051 WAIT#. This signal must be externally
pulled-up when used as 8051 WAIT#.
GPIO[15:12] J20, J19, J18, I/O CMOS 3.3V GPIO[15:12] / 8051 A[11:8]. Note that these signals
H21 also function as strap pins. Refer to Table 1-5 on page
1-29 for more information.
GPIO[23:16] L21, L20, L19, I/O CMOS 3.3V GPIO[23:16] / Video Port D[7:0] / Test
L18, K21, K20, Bus [7:0].
K19, J21
GPIO24 M19 I/O CMOS 3.3V GPIO24 / AC97 RST#. Use external pull-up when using
AC97 RST# function.
GPIO25 M20 I/O CMOS 3.3V GPIO25 / AC97 SYNC / I2S WS. Use external pull-down
when using AC97 SYNC or I2S WS function.
GPIO26 M21 I/O CMOS 3.3V GPIO26 / AC97/ I2S BITCLK. Use external pull-up when
using AC97/ I2S BITCLK function.
GPIO27 N18 I/O CMOS 3.3V Can be used for GPIO / AC97 / I2S. When configured
for AC97 interface, GPIO27 connects to SDOUT pin of
AC97 codec.
2
When configured for I S interface, GPIO27 connects to
DATAIN pin of I2S codec.
GPIO28 N19 I/O CMOS 3.3V Can be used for GPIO / AC97 / I2S. When configured
for AC97 interface, GPIO28 connects to SDIN pin of
AC97 codec.
2
When configured for I S interface, GPIO28 connects to
DATAOUT pin of I2S codec.
GPIO29 N20 I/O CMOS 3.3V GPIO29 / PWM 0 output / Test Bus [8]. This signal also
functions as a strap pin
(refer to Table 1-5 on page 1-29).
GPIO30 N21 I/O CMOS 3.3V Output: GPIO30 / PWM 1 output / Test
Bus [9].
Input: GPIO30 / XScale input clock.
GPIO31 P19 I/O CMOS 3.3V GPIO31 / PWM 2 output / Test Bus [10].
This signal also functions as a strap pin
(refer to Table 1-5 on page 1-29).
GPIO32 P20 I/O CMOS 3.3V GPIO32 / SSP 0 TXD.
GPIO41 U18 I/O CMOS 3.3V GPIO41 / SSP 1 TXD / UART/IrDA 1 TXD.
GPIO42 U19 I/O CMOS 3.3V GPIO42 / SSP 1 RXD / UART/IrDA 1 RXD.
GPIO43 U20 I/O CMOS 3.3V GPIO43 / SSP 1 FRMIN / UART 1 CTS.
GPIO44 U21 I/O CMOS 3.3V GPIO44 / SSP 1 FRMOUT / UART 1 RTS.
GPIO46 V19 I/O CMOS 3.3V GPIO46 / I2C Clock. Use external pull-up when using
2
I C Clock function.
GPIO47 V20 I/O CMOS 3.3V GPIO47 / I2C Data. Use external pull-up when using I2C
Data function.
GPIO[53:48] W20, W19, W18, I/O CMOS 3.3V GPIO[53:48] / 8051 P1[5:0].
W17, W16, V21
GPIO54 W21 I/O CMOS 3.3V GPIO54 / 8051 INTR#.
GPIO55 Y16 I/O CMOS 3.3V GPIO55 / Digital CRT Clock / Test Bus [11].
GPIO[63:56] AA21, AA20, I/O CMOS 3.3V GPIO[63:56] / Digital CRT Data [7:0] / Test Bus [19:12]
AA19, Y21, / Video Port Data [15:8] / FPDATA [17:16, 9:8, 1:0] in
Y20, Y19, Y18, lower 6 bits / Embedded Memory Test [7:0].
Y17
Packaging
The SM502's initial package is a 297-pin BGA using 0.8mm ball spacing (see Figure 17-2). The total package
size is 19x19mm, which allows the I/O and system memory interfaces to be present. The SM502 is available in
configurations with internal memory included in the package as well as without memory. Please refer to
Figure 17-1 for package pinout details.
18 Specifications
Soldering Profile
Figure 18-1 shows the soldering profile for the SM502 device. This profile is designed for use with Sn63 or
Sn62 (tin measurements in the PCB) and can serve as a general guideline in establishing a reflow profile.
Slope: 1.5~2oC/sec.
(217oC to peak)
peak: 250+0/-5oC
Preheat: 150~200oC
20~40 sec.
Time (seconds)
Specifications 18 - 1
DC Characteristics
1
VDD I/O refers to AVDD, GVDD, HVDD, MVDD, MVDD2, PVDD, USBPWR and XTALPWR.
VDD Core VDD Core Supply Voltage 1.8V 1.71 1.8 1.89 V
VDD IO VDD I/O Supply Voltage 3.3V 3.14 3.3 3.47 V
18 - 2 Specifications
Host/PC Interface
ACK# I -- -- --
BE[3:0] I/O 8/8 8/8 8/8
BREQ# O 24/24 24/24 24/24
BS# I -- -- --
CA[14:2] I/O 8/8 8/8 8/8
CA[25:15] I/O 24/24 24/24 24/24
CD[31:0] I/O 24/24 24/24 24/24
CPURD# I/O 8/8 8/8 8/8
HCAS# O 8/8 8/8 8/8
HCKE I/O 8/8 8/8 8/8
HCLK I/O 24/24 24/24 24/24
HCS# I -- -- --
HRAS# O 8/8 8/8 8/8
HRDY# O 8/8 8/8 8/8
HWE# I/O 8/8 8/8 8/8
INTR O 24/24 24/24 24/24
MCS#[1:0] O 8/8 8/8 8/8
RST# I -- -- --
Memory Interface
BA[1:0] O 4/4 4/4 8/8
CAS# O 4/4 4/4 8/8
CKE O 4/4 4/4 8/8
CS# O 4/4 4/4 8/8
DQM[3:0] O 4/4 4/4 8/8
DQS I/O 4/4 8/8 16/16
DSF O 4/4 4/4 8/8
MA[12:0] O 4/4 4/4 8/8
MD[31:0] I/O 4/4 4/4 8/8
RAS# O 4/4 4/4 8/8
SCK+ O 8/8 8/8 16/16
WE# O 4/4 4/4 8/8
Specifications 18 - 3
Panel Interface
BIAS O 4/4 4/4 8/8
FP[23:18, 15:10, 7:2] O 4/4 4/4 8/8
FP_DISP O 4/4 4/4 8/8
FP_HSYNC O 4/4 4/4 8/8
FP_VSYNC O 4/4 4/4 8/8
FPCLK O 4/4 4/4 8/8
FPEN O 4/4 4/4 8/8
VDEN O 4/4 4/4 8/8
CRT Interface
CRT_HSYNC O 4/4 4/4 8/8
CRT_VSYNC O 4/4 4/4 8/8
USB Interface
USB+ I/O 10/10 10/10 10/10
USB- I/O 10/10 10/10 10/10
GPIO Interface
GPIO[63:0] I/O 4/4 4/4 4/4
18 - 4 Specifications
AC Timing
This section provides the AC timing waveforms and parameters:
Figure 18-2 shows the PCI clock and its timing parameters. Table 18-4 provides the values for the PCI clock
timing parameters shown in Figure 18-2.
t1
t2 t3
0.6 Vcc
0.5 Vcc
0.4 Vcc 0.4 Vcc min.
0.3 Vcc
0.2 Vcc
Specifications 18 - 5
Figure 18-3 and Figure 18-4 show the PCI outputs and inputs, respectively, and their relationship to the PCI
clock. Table 18-5 provides the values for the timing parameters shown in the two figures.
t1
OUTPUT
0.285 Vcc
0.615 Vcc
OUTPUT
3-STATE
OUTPUT
t2
t3
t4 t5
18 - 6 Specifications
Figure 18-5 shows the remaining timing PCI bus waveforms. Table 18-6 provides the values for the timing
parameters shown in Figure 18-5.
CLK
t1
FRAME#
t2 t3 t4 t5
t2 t3 t6 t7
AD[31:0]
Address Write Data
(Write)
t8 t9 t10
t12 t14
t11
t13
TRDY#
t15 t16
IRDY#
t17 t18 t19
DEVSEL#
Specifications 18 - 7
18 - 8 Specifications
HCKE
t4
HCKE
t5
t7
t6
HCS#
t7
t6
HRAS#
HCAS#
t7
t6
t6 t7
BE[3:0]
t8 t8
t9 t9
HWE#
t7
t6 t11 t13
Specifications 18 - 9
HCLK
nCS tCEH
tAS
CA[25:2]
(DQM[3:0])
BE[3:0] 0000
(nPWE)
nBS
(RDnWR)
nWE
tCES RDF+1+WAIT RRR*2+1
(nOE)
nCPURD tASW0
t3
HRDY
t1 t4
CD[31:0]
t2 t5
18 - 10 Specifications
HCLK
nCS tCEH
tAS
CA[25:2]
(DQM[3:0])
BE[3:0] 0000
(nOE)
nCPURD
WAIT
(RDnWR)
nWE
tCES RDF+1+WAIT RRR*2+1
(nPWE)
nBS tASW0
t3
HRDY
t1 t4
CD[31:0]
tDSWH tDHW
Specifications 18 - 11
1. Programmable value in DRAM Control register, bit 27 (see “DRAM Control” on page 2-12).
Table 18-8: XScale Read Timing Specification (Bus Slave)
Parameter Timing Descriptions Control Side Specified1
tAS Address Setup to nCS CPU 1 MCLK
tCES nCS Setup to nOE or nPWE asserted (Low) CPU 2 MCLKs
tASRW0 Address Setup to nOE or nPWE asserted (Low) CPU 3 MCLKs
tCEH nCS Held Asserted After nOE or nPWE Deasserted CPU 1 MCLK
tAH Address Hold After nOE or nPWE Deasserted CPU RDF+2 MCLKs min.
t1 From nCS Asserted to HRDY Driven SM502 4 ns max.
t2 Data Setup to HRDY Rise SM502 1 ns min.
t3 HRDY Deasserted Delay SM502 4 ns max.
t4 HRDY Driven Low After nCS Deasserted SM502 1 HCLK
t5 Data Hold After HRDY Deasserted SM502 1 ns min.
1. HCLK is the bus clock input used by the SM502, and MCLK is the system clock run on the XScale CPU side.
When using the first clock option, MCLK and HCLK have the same frequency.
18 - 12 Specifications
1. HCLK is the bus clock input used by the SM502, and MCLK is the system clock run on the XScale CPU side.
When using the first clock option, MCLK and HCLK have the same frequency.
Specifications 18 - 1 3
Figure 18-9 shows the timing waveforms for SH4 System DRAM operations. Figure 18-10 shows the timing
waveforms for SH4 read and write operations. Table 18-10 and Table 18-11 lists the AC timing values for the
parameters shown in the three SH4 figures.
HCLK
t4
HCKE
t5
t7
t6
MCS0#
t7
t6
HRAS
HCAS
t7
t6
t6 t7
BE
t8 t8
t9 t9
HWE#
t7
t6 t11 t13
18 - 14 Specifications
HCLK
t4 t5
CA[25:2]
t6 Read Cycle t7
HWE# Write Cycle
t8 t9
BE
t10 t11
BS#
t12 t13
CS#
t15 t16
t14 t21 t21
HRDY#
t17 t18
CD[31:0]
t19 t20
CD[31:0]
1. Programmable value in DRAM Control register, bit 27 (see “DRAM Control” on page 2-12).
Specifications 18 - 15
18 - 16 Specifications
HCLK
t4
HCKE
t5
t7
t6
MCS0#
t7
t6
HRAS#
HCAS#
t7
t6
t6 t7
BE[3:0]
t8 t8
t9 t9
HWE#
t7
t6 t11 t13
Specifications 18 - 17
HCLK
CA[24:2]
BE[3:0]
HCS#
t17
HRDY#
t18
CPURD#
CD[31:0]
(write)
CD[31:0]
(read)
t19
18 - 18 Specifications
1. Programmable value in DRAM Control register, bit 27 (see “DRAM Control” on page 2-12).
FPCLK
t2 t3
FP
t4 t5
FP_DISP
Specifications 18 - 1 9
FP_HSYNC
t7
FP_VSYNC
# of pixels
FP_DISP
Note: Number of pixels is programmed in the Panel Horizontal Total register, bits [11:0]
(see “Panel Horizontal Total” on page 5-15).
18 - 20 Specifications
The timing for the USB interface is compliant with the USB 1.1 Specification. Figure 18-15 shows the USB
timing waveforms. Table 18-14 lists the AC timing values for the parameters shown in the USB figure.
90%
INPUT 50%
10%
t1 t1
90%
OUTPUT 50%
10%
t2 t2
Specifications 18 - 2 1
ZV Port Timing
Figure 18-16 depicts the relationship amongst the ZV Port signals. Table 18-15 shows the AC parameters
associated with the ZV Port signals when the ZV Port custom interface is in use at 50 MHz.
VSYNC
t8 t8
t5
t6
t1 t3
t2
PCLK
t4
t7
t6
Y[7:0]/UV[7:0] 0 1 2 3 END
18 - 22 Specifications
UART Timing
Figure 18-17 shows the timing waveforms for UART transmit operations. Figure 18-18 shows the timing
waveforms for UART receive operations. Figure 18-19 shows the timing waveforms for UART modem
operations. Table 18-16 lists the AC timing values for the parameters shown in the three UART figures.
IRQ
(THRE)
t1 t3 t3
t4
No more
First Byte Next Byte
data to send
Sample
Clock
9 clocks
16 clocks t5
IRQ
(RDR)
t6
IRQ
(LS)
t6
Specifications 18 - 23
NRTS
t7 t7
NCTS
t8 t8
IRQ
t9 t9
Interrupt set by
signal change Interrupt set by
signal change Clear by read from
Clear by read from Modem Status Register
Modem Status Register
t5 Delay time, stop to receiver error interrupt or read RBR (RX 2 RCLK clocks
Buffer Register) to LS (Line Status) interrupt
t6 Delay time, read RBR/LSR low to reset interrupt low CL = 75 pF 120 ns
UART Modem Timing
t7 Delay time, WR MCR (Modem Control Register) to output 60 ns
t8 Delay time, modem interrupt to set interrupt 35 ns
18 - 24 Specifications
AC97-Link Timing
Figure 18-20 shows the input and output timing waveforms for the AC-Link interface with respect to
BIT_CLK. Figure 18-21 shows the cycle timing waveforms for BIT_CLK and SYNC. Table 18-17 lists the AC
timing values for the parameters shown in the two figures.
BIT_CLK
t1
SDATA_OUT
t2 t3
SDATA_IN
Specifications 18 - 25
18 - 26
Tag Phase Data Phase
BIT_CLK
t5
Codec
Time slot “valid” bits Slot 1 Slot 2 Slot 3 Slot 12
end of previous ID
audio frame (“1” = slot contains valid PCM data)
Specifications
SM502 MMCC™ Databook
Silicon Motion®, Inc. SM502 MMCC™ Databook
Company Confidential
Specifications 18 - 2 7
I2S Timing
Figure 18-22 shows the timing waveforms for I2S transmit operations. Figure 18-23 shows the timing
waveforms for I2S receive operations. Table 18-18 lists the AC timing values for the parameters shown in the
two figures.
t2
SCK
t4
SD
t5
WS
t2
SCK
SD
t6 t7
WS
18 - 28 Specifications
This section shows the 8051 waveforms in 12-bit address mode with and without latching of the upper four
address bits (AD[11:8]). The 12-bit address mode is enabled by bit 4 of the Mode Select register (see
page 12-4). Whether or not latching occurs is determined by bit 26 of the Miscellaneous Control register (see
page 2-6). Figure 18-24 and Figure 18-25 show the timing waveforms for 8051 read and write operations with
latching, respectively. Figure 18-26 and Figure 18-27 show the timing waveforms for 8051 read and write
operations without latching, respectively. Table 18-19 provides the AC timing values for the measurements
shown in the figures.
ALE
t1
t2 t3
RD
t4
AD[11:8] Address_High
ALE
t5
t6 t7
WR
t8
AD[11:8] Address_High
Specifications 18 - 2 9
ALE
t1
t2 t3
RD
t4
t9
AD[11:8] Address_High
ALE
t5
t6 t7
WR
t8
AD[11:8] Address_High
18 - 30 Specifications
1. CCLK is the 8051 clock controlled by bits [1:0] of the Mode Select register
(see page 12-4).
Specifications 18 - 31
Figure 18-28 shows the timing waveforms for the Local SDRAM. Table 18-20 lists the AC timing values for
the parameters shown in Figure 18-28.
SCK+
t4
CKE
t5
t7
t6
CS#
t7
t6
RAS#
CAS#
t7
t6
t6 t7
DQM[3:0]
t8 t8
t9 t9
WE#
t7
t6 t11 t13
18-32 Specifications
Specifications 18 - 33
Part Number
Top Marking
SM502GX00LF00-AC:
G LFBGA Package
SM502GF AC F Pb-Free
AC IC Version
Pin 1 Indicator
SM502GX08LF01-AC:
G LFBGA Package
F Pb-Free
SM502GF8 AC 8 8MB Internal Memory
AC IC Version
Pin 1 Indicator
SM502GE08LF01-AC:
G LFBGA Package
F Pb-Free
SM502GF8 AC 8 8MB Internal Memory
AC IC Version
Pin 1 Indicator
Extension Temperature