ST uPSD3312D-40T6, uPSD3312DV-40T6, uPSD3333D-40T6, uPSD3333DV-40T6, uPSD3333D-40U6, uPSD3333DV-40U6, uPSD3334D-40U6, uPSD3334DV-40U6, uPSD3354D-40T6, uPSD3354DV-40T6, uPSD3354D-40U6, uPSD3354DV-40U6 User Manual
查询UPSD3312D-40T6T供应商
Fast 8032 MCU with Programmable Logic
FEAT URES SUM MARY
■FAST 8-BIT TURBO 8032 MCU, 40MHz
–Advanced core, 4-clocks per instruction
–10 MIPs peak performance at 40MHz (5V)
–JTAG Debug and In-System
Programming
–Branch Cache & 6 instruction Prefetch
Queue
–Dual XDATA pointers with auto incr & decr
–Compatible with 3rd party 8051 tools
■DUAL FLASH MEMORIES WITH MEMORY
MANAGEMENT
–Place either memory into 8032 program
address space or data address space
–READ-while-WRITE operation for In-
Application Programming and EEPR OM
emulation
–Single voltage program and erase
–100K guarante ed eras e cycle s, 15-year
retention
■CLOCK, RESET, AND SUPPLY
MANAGEMENT
–SRAM is Battery Backup capable
–Flexible 8-level CPU clock divider register
–Normal, Idle, and Power Down Modes
–Power-on and Low Voltage reset
supervisor
–Programmable Watchdog Timer
■PROGRAMMABLE LOGIC, GENERAL
PURPOSE
–16 macrocells
–Create shifters, sta te machines, chip-
selects, glue-logic to keypads, panels,
LCDs, others
■COMMUNICATION INTERFACES
2
C Master/Slave controller, 833KHz
–I
–SPI Master controller, 10MHz
–Two UARTs with independent baud rate
–IrDA protocol support up to 115K baud
–Up to 46 I/O, 5V tolerant on 3.3V
uPSD33xxV
uPSD33xx
Turbo Series
PRELIMINARY DATA
Figure 1. Packages
TQFP52 (T)
52-lead, Thin,
Quad, Flat
TQFP80 (U)
80-lead, Thin,
Quad, Flat
■A/D CONVERTER
–Eight Channels, 10-bit resolution, 6µs
■TIMERS AND INTERRUPTS
–Three 8032 standard 16-bit timers
–Programmable Counter Array (PCA), six
16-bit modules for PWM, CAPCOM, and
timers
–8/10/16-bit PWM operation
–11 Interrupt sources with two external
interrupt pins
■OPERATING VOLTAGE SOURCE (±10%)
–5V devices use both 5.0V and 3.3V
sources
–3.3V devices use only 3.3V source
January 2005
This is preliminary information on a new product now in development or undergoing evaluation. Details are subject to change without notice.
1/231
uPSD33xx
Table 1. Device Summary
1st
Part Number
uPSD3312D-40T664K16K2K37No3.3V5.0VTQFP52 –40°C to 85°C
uPSD3312DV-40T664K16K2K37No3.3V3.3VTQFP52 –40°C to 85°C
uPSD3333D-40T6128K32K8K37No3.3V5.0VTQFP52 –40°C to 85°C
uPSD3333DV-40T6128K32K8K37No3.3V3.3VTQFP52 –40°C to 85°C
uPSD3333D-40U6128K32K8K46Yes3.3V5.0VTQFP80 –40°C to 85°C
uPSD3333DV-40U6128K32K8K46Yes3.3V3.3VTQFP80 –40°C to 85°C
uPSD3334D-40U6256K32K8K46Yes3.3V5.0VTQFP80 –40°C to 85°C
uPSD3334DV-40U6256K32K8K46Yes3.3V3.3VTQFP80 –40°C to 85°C
uPSD3354D-40T6256K32K32K37No3.3V5.0VTQFP52 –40°C to 85°C
uPSD3354DV-40T6256K32K32K37No3.3V3.3VTQFP52 –40°C to 85°C
uPSD3354D-40U6256K32K32K46Yes3.3V5.0VTQFP80 –40°C to 85°C
uPSD3354DV-40U6256K32K32K46Yes3.3V3.3VTQFP80 –40°C to 85°C
The Turbo uPSD33xx Series combines a powerful
8051-based microcontroller with a flexible memory
structure, programmable logic, and a rich peripheral mix to form an ideal embedded controller. At
its core is a fast 4-cycle 8032 MCU with a 6-byte
instruction prefetch queue (PFQ) and a 4-entry fully associative branching cache (BC) to maximize
MCU performance, enabling loops of code in
smaller localities to execute extremely fast.
Code development is easily managed without a
hardware In-Circuit Emulator by using the serial
JTAG debug interface. JTAG i s also used for InSystem Programming (ISP ) in as little as 10 seconds, perfect for manufacturing and lab development. The 8032 core is coupled to Programmable
System Device (PSD) architectu re to optimi ze the
8032 memory structure, offering two independent
Figure 2. Block Diagram
uPSD33xx
(3) 16-bit
Timer/
Counters
(2)
External
Interrupts
P3.0:7
P1.0:7
Optional IrDA
Encoder/Decoder
Turbo
8032
Core
I2C
UART0
(8) GPIO, Port 3
(8) GPIO, Port 1
(8) 10-bit ADC
PFQ
&
BC
SYSTEM BUS
UART1
uPSD33xx
banks of Flash mem ory that can be pl aced at virtually any address within 8032 program or data address space, and easily paged beyond 64K bytes
using on-chip programmable decode logic. Dual
Flash memory banks provide a robus t s olution for
remote product updates in the field through In-Application Programming (IAP). Dual Flash banks
also support EEPROM emulation, eliminating the
need for external EEPROM chips. General purpose programmable logic (PLD) is included to
build an endless variety of glue-logic, saving external logic devices. The PLD is configured using the
software development tool, PSDsoft Express,
available from the web at www.st.com/psm, at no
charge. The uPSD33xx also includes supervisor
functions such as a programmable watchdog timer
and low-voltage reset.
Note: NC = Not Connected
Note: 1. For 5V applications, V
2. These signals can be used on one of two different ports (Port 1 or Port 4) for flexibility. Default is Port1.
must be connected to a 5.0V source. Fo r 3.3V applications, VDD must be connected to a 3.3V source.
DD
40
P3.4/C0
MCU AD3
AI07823
9/231
uPSD33xx
Table 2. Pin D ef in iti ons
Port Pin
MCUAD0AD036N/AI/O
MCUAD1AD137N/AI/O
MCUAD2AD238N/AI/O
MCUAD3AD339N/AI/O
MCUAD4AD441N/AI/O
MCUAD5AD543N/AI/O
MCUAD6AD645N/AI/O
MCUAD7AD747N/AI/O
MCUA8A851N/AO
MCUA9A953N/AO
MCUA10A1055N/AO
MCUA11A1157N/AO
P1.0
P1.1
P1.2
P1.3
P1.4
P1.5
P1.6
P1.7
P3.0RxD07523I/OGeneral I/O port pin
P3.1TXD07724I/OGeneral I/O port pin
P3.2
P3.3INT1226I/OGeneral I/O port pin
P3.4C04027I/OGeneral I/O port pinCounter 0 input (C0)
Signal
Name
T2
ADC0
T2X
ADC1
RxD1
ADC2
TXD1
ADC3
SPICLK
ADC4
SPIRxD
ADC6
SPITXD
ADC6
SPISE
ADC7
EXINT0
TGO
80-Pin
L
52-Pin
No.
No.
5234I/OGeneral I/O port pin
5435I/OGeneral I/O port pin
5636I/OGeneral I/O port pin
5837I/OGeneral I/O port pin
5938I/OGeneral I/O port pin
6039I/OGeneral I/O port pin
6140I/OGeneral I/O port pin
6441I/OGeneral I/O port pin
7925I/OGeneral I/O port pin
(1)
In/Out
BasicAlternate 1Alternate 2
External Bus
Multiplexed Address/
Data bus A0/D0
Multiplexed Address/
Data bus A1/D1
Multiplexed Address/
Data bus A2/D2
Multiplexed Address/
Data bus A3/D3
Multiplexed Address/
Data bus A4/D4
Multiplexed Address/
Data bus A5/D5
Multiplexed Address/
Data bus A6/D6
Multiplexed Address/
Data bus A7/D7
External Bus, Addr
A8
External Bus, Addr
A9
External Bus, Addr
A10
External Bus, Addr
A11
Function
Timer 2 Count input
(T2)
Timer 2 T rigger input
(T2X)
UART1 or IrDA
Receive (RxD1)
UART or IrDA
Transmit (TxD1)
SPI Clock Out
(SPICLK)
SPI Receive
(SPIRxD)
SPI Transmit
(SPITxD)
SPI Slave Select
(SPISEL
UART0 Receive
(RxD0)
UART0 Transmit
(TxD0)
Interrupt 0 input
(EXTINT0)/Timer 0
gate control (TG0)
Interrupt 1 input
(EXTINT1)/Timer 1
gate control (TG1)
)
ADC Channel 0
input (ADC0)
ADC Channel 1
input (ADC1)
ADC Channel 2
input (ADC2)
ADC Channel 3
input (ADC3)
ADC Channel 4
input (ADC4)
ADC Channel 5
input (ADC5)
ADC Channel 6
input (ADC6)
ADC Channel 7
input (ADC7)
10/231
uPSD33xx
Port Pin
Signal
Name
80-Pin
No.
52-Pin
(1)
No.
In/Out
BasicAlternate 1Alternate 2
Function
P3.5C14228I/OGeneral I/O port pinCounter 1 input (C1)
P3.6SDA4429I/OGeneral I/O port pin
P3.7SCL4630I/OGeneral I/O port pin
P4.0
P4.1
P4.2
P4.3
P4.4
P4.5
T2
TCM0
T2X
TCM1
RXD1
TCM2
TXD1
PCACLK0
SPICLK
TCM3
SPIRXD
TCM4
3322I/OGeneral I/O port pin
3121I/OGeneral I/O port pinPCA0-TCM1
3020I/OGeneral I/O port pinPCA0-TCM2
2718I/OGeneral I/O port pinPCACLK0
2517I/OGeneral I/O port pin
2316I/OGeneral I/O port pinPCA1-TCM4
I2C Bus serial data
2
CSDA)
(I
I2C Bus clock
2
CSCL)
(I
Program Counter
Array0 PCA0-TCM0
Program Counter
Array1 PCA1-TCM3
P4.6SPITXD1915I/OGeneral I/O port pinPCA1-TCM5
P4.7
V
REF
SPISEL
PCACLK1
RD
WR
PSEN
ALE4N/AO
RESET_IN
XTAL14831I
XTAL24932O
DEBUG85I/O
1814I/OGeneral I/O port pinPCACLK1
70N/AI
65N/AO
62N/AO
63N/AO
Reference Voltage
input for ADC
READ Signal,
external bus
WRITE Signal,
external bus
PSEN Signal,
external bus
Address Latch
signal, external bus
6844I
Active low reset
input
Oscillator input pin
for system clock
Oscillator output pin
for system clock
I/O to the MCU
Debug Unit
PA035N/AI/OGeneral I/O port pin
PA134N/AI/OGeneral I/O port pin
PA232N/AI/OGeneral I/O port pin
PA328N/AI/OGeneral I/O port pin
PA426N/AI/OGeneral I/O port pin
PA524N/AI/OGeneral I/O port pin
PA622N/AI/OGeneral I/O port pin
PA721N/AI/OGeneral I/O port pin
Timer 2 Count input
(T2)
Timer 2 T rigger input
(T2X)
UART1 or IrDA
Receive (RxD1)
UART1 or IrDA
Transmit (TxD1)
SPI Clock Out
(SPICLK)
SPI Receive
(SPIRxD)
SPI Transmit
(SPITxD)
SPI Slave Select
(SPISEL
)
All Port A pins
support:
1.PLD Macro-cell
outputs, or
2.PLD inputs, or
3.Latched
Address Out
(A0-A7), or
4.Peripheral I/O
Mode
11/231
uPSD33xx
Port Pin
Signal
Name
80-Pin
No.
52-Pin
(1)
No.
In/Out
BasicAlternate 1Alternate 2
PB08052I/OGeneral I/O port pin
PB17851I/OGeneral I/O port pin
PB27650I/OGeneral I/O port pin
PB37449I/OGeneral I/O port pin
PB47348I/OGeneral I/O port pin
PB57146I/OGeneral I/O port pin
PB66743I/OGeneral I/O port pin
PB76642I/OGeneral I/O port pin
JTAGTMSTMS2013IJTAG pin (TMS)
JTAGTCKTCK1612IJTAG pin (TCK)
PC2
V
STBY
1511I/OGeneral I/O port pin
PC3TSTAT1410I/OGeneral I/O port pin
PC4TERR
97I/OGeneral I/O port pin
JTAGTDITDI74IJTAG pin (TDI)
JTAGTDOTDO63OJTAG pin (TDO)
PC752I/OGeneral I/O port pin
PD1CLKIN31I/OGeneral I/O port pin
PD2CSI1N/AI/OGeneral I/O port pin
V
3.3V-V
CC
AV
CC
V
DD
3.3V or 5V
V
DD
3.3V or 5V
106
7247
128
5033
- MCU Module
CC
Analog V
V
DD
V
DD
CC
- PSD Module
- 3.3V for 3V
VDD - 5V for 5V
V
- PSD Module
DD
V
- 3.3V for 3V
DD
VDD - 5V for 5V
GND139
GND2919
GND6945
NC11N/A
NC17N/A
Note: 1. N/A = Signal Not Available on 52-pin package.
Input
Function
SRAM Standby
voltage input
(V
)
STBY
Optional JTAG
Status (TSTAT)
Optional JTAG
Status (TERR
All Port B pins
support:
1.PLD Macro-cell
outputs, or
2.PLD inputs, or
3.Latched
Address Out
(A0-A7)
PLD Macrocell
output, or PLD input
PLD, Macrocell
output, or PLD input
PLD, Macrocell
)
output, or PLD input
PLD, Macrocell
output, or PLD input
1.PLD I/O
2.Clock input to
PLD and APD
1.PLD I/O
2.Chip select ot
PSD Module
12/231
uPSD33xx HARDWARE DESCRIPTION
The uPSD33xx has a modular architecture built
from a stacked die process. There are two die, one
is designated “MCU Module” in this document, and
the other is designated “PSD Module” (see Figure
5., page 14). In all cases, the MCU Module die op-
erates at 3.3V with 5V tolerant I/O. The PSD Module is either a 3.3V die or a 5V die, depending on
the uPSD33xx device as described below.
The MCU Module consists of a fast 8032 core, that
operates with 4 clocks per instruction cycle, and
has many peripheral and system supervisor functions. The PSD Module provides the 8032 with
multiple memories (two Flash and one SRAM) for
program and data, programmable logic for address decoding and for general-purpose logic, and
additional I/O. The MCU Module communicates
with the PSD Module through internal address and
data busses (A8 – A15, AD0 – AD7) and control
signals (RD
There are slightly different I/O characteristics for
each module. I/Os for the MCU module are designated as Ports 1, 3, and 4. I/Os for the PS D M odule are designated as Ports A, B, C, and D.
For all 5V uPSD33xx devices, a 3.3V MCU Module
is stacked with a 5V PSD Module. In this case, a
5V uPSD33xx device must be supplied with
3.3V
CC
PSD Module. Ports 3 and 4 of the MCU Module
are 3.3V ports with tolerance to 5V devices (they
can be directly driven by external 5V devices and
they can directly drive external 5V devices whi le
, WR, PSEN, ALE, RESET).
for the MCU Module and 5.0VDD for th e
uPSD33xx
producing a V
A, B, C, and D of the PSD Module are true 5V
ports.
For all 3.3V uPSD33xxV devices, a 3.3V MCU
Modu l e i s s t ac k ed wi t h a 3. 3 V PS D M o du l e . I n th i s
case, a 3.3V uPSD 33xx device needs t o be supplied with a single 3.3V voltage source at both V
and VDD. I/O pins on Ports 3 and 4 are 5V tolerant
and can be connec ted to external 5V peri pherals
devices if desired. Ports A, B, C, and D of the PSD
Module are 3.3V ports, which are not tolerant to
external 5V devices.
Refer to Table 3 for port type and voltage source
requirements.
80-pin uPSD33xx devices provide access to 8032
address, data, and control signals on external pins
to connect external peripheral and memory devices. 52-pin uPSD33xx devices do not provide access to the 8032 system bus.
All non-volatile memory and configuration portions
of the uPSD33xx device are programmed through
the JTAG interface and no special program ming
voltage is needed. This same JTAG port is also
used for debugging of the 8032 core at runtime
providing breakpoint, single-step, display, and
trace features. A non-volatile securi ty bit may be
programmed to block all access via JTAG interface for security. The security bit is defeated only
by erasing the entire device, leaving the device
blank and ready to use again.
of 2.4V min and VCC max). Po r ts
OH
CC
Table 3. Port Type and Voltage Source Combinations
Device Type
5V:
uPSD33xx
3.3V:
uPSD33xxV
for MCU
V
CC
Module
3.3V5.0V3.3V but 5V tolerant5V
3.3V3.3V3.3V but 5V tolerant3.3V. NOT 5V tolerant
VDD for PSD
Module
Ports 3 and 4 on
MCU Module
Ports A, B, C, and D on
PSD Module
13/231
uPSD33xx
Figure 5. uPSD33xx Functional Modules
XTAL
Clock Unit
8-Bit Die-to-Die Bus
Port 3 - UART0,
Intr, Timers
Turbo 8032 Core
Dual
UARTs
Interrupt
256 Byte SRAM
Dedicated Memory
Interface Prefetch,
Branch Cache
Enhanced MCU Interface
PSD Page Register
Decode PLD
JTAG ISP
Port 1 - Timer, ADC, SPI
Port 1Port 3
3 Timer /
Counters
JTAG
DEBUG
Main Fl ash
10-b it
ADC
8032 Intern al Bus
SPI
Secondary
Flash
PSD Internal Bus
CPLD - 16 MACROCELLS
Port 4 - PCA,
PWM, UART1
PCA
PWM
Counters
Internal
Reset
SRAM
LVD
Reset Logic
Port 3
2
I
C
I2C
Unit
WDT
PSD
Reset
MCU M odule
Reset Input
P SD Module
VCC Pins
3.3V
Ext.
Bus
Reset
Pin
VDD Pins
3.3V or 5V
uPSD33XX
Port C
JTAG and
GPIO
Port A,B,C PLD
I/O and GPIO
Port D
GPIO
AI07842
14/231
MEMOR Y ORGANIZAT ION
The 8032 MCU core views m emory on the MCU
module as “internal” memory and it views memory
on the PSD module as “external” memory, see
Figure 6.
Internal memory on the MCU Modul e consists of
DATA, IDATA, and SFRs. Thes e standard 8032
memories reside in 384 bytes of SRAM located at
a fixed address space starting at address 0x0000.
External memory on the PSD Module consists of
four types: main Flash (64K, 128K, or 256K bytes),
a smaller secondary Flash (16 K, or 32K), SRAM
(2K, 8K, or 32K bytes), and a block of PSD Module
control registers called CSIOP (256 bytes). These
external memories reside at programmable address ranges, specified using the software tool
PSDsoft Express. See the PSD Module section of
this document for more details on these memories.
External memory is accessed by the 8032 in two
separate 64K byte address spaces. One address
space is for program memory and the other ad-
Figure 6. uPSD33xx Memories
uPSD33xx
dress space is for data memory. Program memory
is accessed using the 8032 signal, PSEN
memory is accessed usin g the 8032 signals, RD
and WR. If the 8032 ne eds to access more than
64K bytes of external program or data memory, it
must use paging (or banking) techniques provided
by the Page Register in the PSD Module.
Note: When referencing program a nd da ta memory spaces, it has nothing to do with 8032 internal
SRAM areas of DATA, IDATA, and SFR on the
MCU Module. Program an d data mem ory spaces
only relate to the external memo ries on the PSD
Module.
External memory on the PSD Module can overlap
the internal SRAM memory on the MCU Module in
the same physical address range (starting at
0x0000) without interference because the 8032
core does not assert the RD
or WR signals when
accessing internal SRAM.
. Data
Fixed
Addresses
FF
80
7F
0
Internal SRAM on
MCU Module
384 Bytes SRAM
Indirect
Addressing
IDATA
128 Bytes
128 Bytes
DATA
Direct or Indirect Addressing
SFR
128 Bytes
Direct
Addressing
Main
Flash
64KB,
128KB,
or
256KB
External Memory on
PSD Module
• External memories may be placed at virtually
any address using software tool PSDsoft Express.
• The SRAM and Flash memories may be placed
in 8032 Program Space or Data Space using
PSDsoft Express.
• Any memory in 8032 Data Space is XDATA.
Secondary
Flash
16KB
or
32KB
SRAM
2KB,
8KB,
or
32KB
CSIOP
256 Bytes
AI07843
15/231
uPSD33xx
Internal Memory (MCU Module, Standard 8032
Memory: DATA, IDATA, SFR)
DATA Memory. The first 128 bytes of internal
SRAM ranging from address 0x0000 to 0x007F
are called DATA, which can be accessed using
8032 direct or indirect addressing schemes and
are typically used to store variables and stack.
Four register banks, each with 8 registers (R0 –
R7), occupy addresses 0x0000 to 0x001F. Only
one of these four banks may be enabled at a time.
The next 16 locations at 0x0020 to 0x002F contain
128 directly addressable bit locations that can be
used as software flags. SRAM locations 0x0030
and above may be used for variables and stack.
IDATA Memory. The next 128 bytes of internal
SRAM are named IDATA and range from address
0x0080 to 0x00FF. IDATA can be accessed only
through 8032 indirect addressing and is typically
used to hold the MCU stack as well as data variables. The stack can reside in both DATA and
IDATA memories and rea ch a s ize limited only by
the available space i n the com bined 2 56 bytes of
these two memories (since stack accesses are always done using indirect addres sing, the boundary between DATA and IDATA does not exist with
regard to the stack).
SFR Mem ory. Special Function Registers (Table
5., page 24) occupy a separate physical mem ory,
but they logically overlap the s ame 128 bytes as
IDATA, ranging from a ddress 0x0080 t o 0x00FF.
SFRs are accessed only using direct addressing.
There 86 active registers used for many functions:
changing the operating mode of the 8032 MCU
core, controlling 8 032 pe ripherals, c ontrollin g I/O,
and managing interrupt functions. The remaining
unused SFRs are reserved and s ho uld n ot be accessed.
16 of the SFRs are both byte- and bit-addressable.
Bit-addressable SFRs are those whose address
ends in “0” or “8” hex.
External Memo ry (PS D Module: Program
memory, Data memory)
The PSD Module has f our m emo ries: main Flash,
secondary Flash, SRAM, and CSIOP. See the
PSD MODULE section for more detailed informati on on these memori es.
Memory mapping in the PSD Module is implemented with the Decode PLD (DPLD) and opt ionally the Page Register. The user specifies decode
equations for individual seg ments of each of the
memories using the software tool PSDsoft Express. This is a very easy point-and-click process
allowing total flexibility in mapping memories. Additionally, each of the memories may be pla ced in
various combinations of 8032 program address
space or 8032 data address space by using the
software to o l PSDsoft Ex p r e ss.
Program Memory. External program memory is
addressed by the 8032 using its 16-bit Program
Counter (PC) and is accessed w ith the 8032 signal, PSEN
. Program memory can be present at
any address in program space between 0x0000
and 0xFFFF.
After a power-up or reset, the 8032 begins program execution from location 0x0000 where the
reset vector is stored, causing a jump to an initialization routine in firmware. At address 0x0003, just
following the reset vector are the interrupt serv ice
locations. Each interrupt is assigned a fixed interrupt service location in program memory. An interrupt causes the 8032 to jump to that service
location, where it commences execution of the
service routine. External Interrupt 0 (EXINT 0), for
example, is assigned to service location 0x0003. If
EXINT0 is going to be used, its service routine
must begin at location 0x0003. Interrupt service locations are spaced at 8-byte intervals: 0x0003 for
EXINT0, 0x000B for Timer 0, 0x00 13 f or EXINT1,
and so forth. If an interrupt service routine is short
enough, it can reside entirely within the 8-byte interval. Longer service routines can u se a ju mp instruction to somewhere else in program memory.
Data Memory. External data is referred to as
XDATA and is a ddressed by the 8032 using I ndirect Addressing via its 16-bit Data Pointer Register
(DPTR) and is accessed by the 8032 signals, RD
and WR. XDATA can be present at any address in
data space between 0x0000 and 0xFFFF.
Note: the uPSD33xx has dual data pointers
(source and destination) making XDATA transfers
much more efficient.
Memory Placement. PSD Module architecture
allows the placement of its external memories into
different combinations of program memory and
data memory spaces. This means the main Flash,
the secondary Flash, and the SRAM can be
viewed by the 8032 MCU in various comb inations
of program memory or data memory as defined by
PSDsoft Express.
As an example of this flexibility, for applications
that require a great deal of Flash memory i n data
space (large lookup tables or extended data recording), the larger main Flash memory can be
placed in data space an d the smaller secondary
Flash memory can be placed in program space.
The opposite can be realized for a different application if more Flash memory is nee ded for code
and less Flash memory for data.
16/231
uPSD33xx
By default, the SRAM and CSIOP memories on
the PSD Module must always reside in data memory space and they are treated by the 8032 as
XDATA. However, the SRAM may optionally reside in program space in addition to data space if
it is desired to execute code from SRAM. The main
Flash and secondary Flash memories may reside
in program space, data space, or both.
These memory placement choices specified by
PSDsoft Express are programmed into n on-volatile sections of the uPSD33xx, and are active at
power-up and after reset. It is possible to override
these initial settings during runtime for In-Application Programming (IAP).
Standard 8032 MCU architecture cannot write to
its own program memory space to prev ent accidental corruption of firmware. However, this becomes an obstacle in typical 8032 systems when
a remote update to firmware in Flash memory is
required using IAP. The PSD module provides a
solution for remote updates by allowing 8032 firmware to temporarily “reclassify” Flash memory to
reside in data space during a remote update, then
returning Flash memory back to program space
when finished. See the VM Register (Table
78., page 143) in the PSD Module section of this
document for more details.
8032 MCU CORE PERFORMANCE ENHANCEMENTS
Before describing performance features of the
uPSD33xx, let us first look at standard 8032 architecture. The clock source for the 8032 MCU creates a basic unit of timing called a machine-cycle,
which is a period of 12 clocks for standard 8032
MCUs. The instruction set for traditional 8032
MCUs consists of 1, 2, and 3 byte instructions that
execute in different combinations of 1, 2, or 4 machine-cycles. For example, there are one-byte instructions that execute in one machine-cycle (12
clocks), one-byte instructions that ex ecute in f our
machine-cycles (48 clocks), two-byte, two-cycle
instructions (24 clocks), and so on. In addition,
standard 8032 architecture will fetch two bytes
from program memory on almost every machinecycle, regardless if it needs them o r not (dummy
fetch). This means for one-byte, one-cycle instructions, the second byte is ignored. These one-byte,
one-cycle instructions account for half of the
8032's instructions (126 out of 255 opcodes).
There are inefficiencies due to wasted bus cycles
and idle bus times that can be eliminated.
The uPSD33xx 8032 MCU core offers increased
performance in a number of ways, while keeping
the exact same instruction set as the standard
8032 (all opcodes, the number of bytes per instruction, and the nat ive number a machine-cycle s
per instruction are identical t o the original 8032).
The first way performance is boost ed i s by reducing the mac hin e -cycle period to j u st 4 MCU clocks
as compared to 12 MCU clocks in a standard
8032. This shortened machine-cycle improves the
instruction rate for one-byte, one-cycle instructions by a factor of three (Figure 7., page 18) compared to standard 8051 architectures, and
significantly improves performan ce of m ultipl e-cycle instruction types.
The example in Figure 7 shows a continuous execution stream of one-byte, one-cycle instructions.
The 5V uPSD33xx will yield 10 MIPS peak performance in this case while operating at 40MHz clock
rate. In a typical application however, the effective
performance will be lower since programs do not
use only one-cycle instructions, but special techniques are implemented in the uPSD33xx to keep
the effective MIPS rate as close as possible to the
peak MIPS rate at all times. This is accomplished
with an instruction Pre-Fetch Queue (PFQ) a nd a
Branch Cache (BC) as shown in Figure
8., page 18.
17/231
uPSD33xx
Figure 7. Comparison of uPSD33xx with Standard 8032 Performance
1-byte, 1-Cycle Instructions
Instruction AInstruction BInstruction C
Turbo uPSD33XX
Execute Instruction and
Pre-Fetch Next Instruction
Execute Instruction and
Pre-Fetch Next Instruction
Execute Instruction and
Pre-Fetch Next Instruction
4 clocks (one machine cycle)
one machine cycleone machine cycle
MCU Clock
12 clocks (one machine cycle)
Instruction A
Standard 8032
Fetch Byte for Instruction A
Dummy Byte is Ignored (wasted bus access)
Turbo uPSD33XX executes instructions A, B, and C in the same
amount of time that a standard 8032 executes only instruction A.
Figure 8. Instruction Pre-Fetch Queue and Branch Cache
Branch 4
Code
Branch
Cache
(BC)
Branch 3
Code
Branch 2
Code
Branch 4
Code
Branch 3
Code
Branch 1
Code
Branch 4
Code
Branch 2
Code
Branch 1
Code
Branch 3
Code
Branch 2
Code
Branch 4
Code
Branch 3
Code
Branch 1
Code
Branch 4
Code
Branch 2
Code
Branch 1
Code
Branch 3
Code
Branch 2
Branch 4
Code
Code
Branch 1
Code
Execute Instruction A
and Fetch a Second Dummy Byte
Previous
Branch 4
Branch 3
Code
Branch 2
Code
Branch 1
Code
Previous
Branch 3
Previous
Branch 2
AI08808
Compare
Previous
Branch 1
Address
Program
Memory on
PSD Module
18/231
Instruction
Byte
8
Address
16
Wait
Load on Branch Address Match
6 Bytes of Instruction
Instruction Pre-Fetch Queue (PFQ)
Instruction
Byte
8
Address
16
Stall
Current
Branch
Address
8032
MCU
AI08809
uPSD33xx
Pre-Fetch Queue (PFQ) and Branch Cache
(BC)
The PFQ is always working to minimize the idle
bus time inherent to 8032 MCU architecture, to
eliminate wasted memory fetches, and to maximize memory bandwidth to the MCU. The PFQ
does this by running asynchronously in relation to
the MCU, looking ahead to pre-fetch code from
program memory during any idle bus periods. Only
necessary bytes will be fetched (no dumm y fe tches like standard 8032) . The PFQ w ill queue up t o
six code bytes in advance of execution, which significantly optimizes sequential program performance. However, when program execution
becomes non-sequential (program branch), a typical pre-fetch queue will empty itself and reload
new code, causing the MCU to stall. The Turbo
uPSD33xx diminishes this problem by using a
Branch Cache with the PFQ. The BC is a four-way,
fully associative cache, mea ning tha t when a program branch occurs, it's branch destination address is compared simultaneously with four recent
previous branch destinations stored in the BC.
Each of the four cache entries contain up to six
bytes of code related to a branch. If there is a hit
(a match), then all six code bytes of the matching
program branch are transferred immediate ly and
simultaneously from the BC to the PFQ, and execution on that branch continues with mini mal delay. This greatly reduces the chance that the MCU
will stall from an empty PFQ, and improves performance in embedded contro l systems where it is
quite common to branch and loop in relatively
small code localities.
By default, the PFQ and BC are enabled after
power-up or reset. The 8032 can disable the PFQ
and BC at runtime if desired by writing to a specific
SFR (BUSCON).
The memory in the PSD module operates with
variable wait states depending on the value spec ified in the SFR named BUSCON. For example, a
5V uPSD33xx device operating at a 40MHz crystal
frequency requires four memory wait states (equal
to four MCU clocks). In this example, once the
PFQ has one or more bytes of code, the wait
states become transparent and a full 10 MIPS is
achieved when the program stream consists of sequential one-byte, one machine-cycle instructions
as shown in Figure 7., page 18 (transparent because a machine-cycle is four MCU clocks which
equals the memory pre-fetch wait time that is also
four MCU clocks). But it is als o important to understand PFQ operation on multi -cycle instructions.
PFQ Example, Multi-cycle Instructions
Let us look at a string of two-byte, two-cycle instructions in Figure 9., page 20. There are three
instructions executed sequentially in this example,
instructions A, B, and C. Each of the time divisions
in the figure is one machine-c ycle of four clocks,
and there are six phases to reference in this discussion. Each instruction is pre-fetched into the
PFQ in advance of execution by the MCU. Prior to
Phase 1, the PFQ has pre-fetched the two instruction bytes (A1 and A2) of instruction A. During
Phase one, both byte s are loaded into the MCU
execution unit. Also in Phase 1 , the PFQ is prefetching the first byte (B1) of instruction B from
program memory. In Phase 2, the MCU is processing Instruction A internally while the PF Q is
pre-fetching the second byte (B2) of Instruction B.
In Phase 3, both bytes of instru ction B are loa ded
into the MCU execution uni t and the PFQ b egins
to pre-fetch bytes for the third instruction C. In
Phase 4 Instruction B is processed and the prefetching con ti n u es , eliminating i dle bu s cycles and
feeding a continuous flow of operands and opcodes to t he MCU execution un it.
The uPSD33xx MCU instructions are an exact 1/3
scale of all standard 8032 instructions with regard
to number of cycles per instruction. Figure
10., page 20 shows the e quivalent instruction se-
quence from the example above on a standard
8032 for comparison.
Aggregate Perform ance
The stream of two-byte, two-cycle instructions in
Figure 9., page 20, running on a 40MHz, 5V,
uPSD33xx will yield 5 MIPs. And we saw the
stream of one-byte, one-cycle instructions in Fig-
ure 7., page 18, on the sam e M CU yield 10 MIP s.
Effective performance will depend on a number of
things: the MCU clock frequency; the mixture of instructions types (bytes and cycles) in the application; the amount of time an empty PFQ stalls the
MCU (mix of instruction types and misses on
Branch Cache); and the operating vol tage. A 5V
uPSD33xx device operates with four memory wait
states, but a 3.3V de vice operat es wi th five mem ory wait states yielding 8 MIPS peak com pared t o
10 MIPs peak for 5V device. The same number of
wait states will apply to both program f etches and
to data READ/WRITEs unless otherwise specified
in the SFR named BUSCON.
In general, a 3X aggregate performance increase
is expected over any standard 8032 application
running at the same clock frequency.
19/231
uPSD33xx
Figure 9. PFQ Operation on Multi-cycl e Instruction s
Figure 10. uPSD33xx Multi-cycle Instructions Compared to Standard 8032
Three 2-byte, 2-cycle Instructions, uPSD33XX vs. Standard 8032
24 Clocks Total (4 clocks per cycle)
uPSD33XX
Std 8032
A1
Byte 1
A2
Inst A
Byte 2
B1
1 Cycle
Process Inst A
B2
1 Cycle
Inst B
C1
C2
Inst C
72 Clocks (12 clocks per cycle)
Byte 1
Byte 2
Process Inst B
Byte 1
Byte 2
Process C
Process Inst C
Next Inst
AI08810
AI08811
20/231
MCU MODU LE DISCRIPTION
This section provides a detail description of the
MCU Module system functions and peripherals, including:
■8032 MCU Registers
■Special Function Registers
■8032 Addressing Modes
■uPSD33xx Instruction Set Summary
■Dua l Data Po i nters
■Debug Unit
■Interrupt System
■MCU Clock Generation
■Power Saving Modes
■Oscillator and Ext ernal C om ponents
8032 MCU REGISTERS
The uPSD33xx has the following 8 032 MCU core
registers, also shown in Figure 11.
Figure 11. 8032 MCU Registers
A
B
SP
PCH
DPTR(DPH)
AI06636
PCL
PSW
R0-R7
DPTR(DPL)
Stack Pointer (SP)
The SP is an 8-bit register which holds the current
location of the top of th e stack. It is incremented
before a value is pushed ont o t he st ack , and dec remented after a value is popped off the stack. The
SP is initialized to 07h after reset. This causes the
stack to begin at locat ion 08h (top o f stack). To
avoid overlapping conflicts, the user must initialize
the top of the stack to 20h if all four banks of registers R0 - R7 are used, and the user must initialize
the top of stack to 30h if all of the 8032 bit memory
locations are used.
Data Pointer (DPTR)
DPTR is a 16-bit register consisting of two 8-bit
registers, DPL and DPH. The DPTR Register is
used as a base register to create an address for indirect jumps, table look-up operations, and for external data transfers (XDATA). When not used for
addressing, the DPTR Register can be used as a
general purpose 16-bit data register.
Accumulator
B Register
Stack Pointer
Program Counter
Program Status Word
General Purpose
Register (Bank0-3)
Data Pointer Register
uPSD33xx
■I/O Ports
■MCU Bus Interface
■Supervisory Functions
■Standard 8032 Timer/Counters
■Serial UART Interf ac e s
■IrDA Interface
2
■I
C Interface
■SPI Interface
■Analog to Digital Converter
■Programmable Counter Array (PCA)
Note: A full description of the 8032 instruction set
may be found in the uPSD33xx Programmers
Guide.
Very frequently, the DPTR Register is used to access XDATA using the External Direct addressing
mode. The uPSD33 xx has a specia l set of SFR
registers (DPTC, DPTM) to control a secondary
DPTR Register to speed memory-to-memory
XDATA transfers. Having dual DPTR Registers allows rapid switching between source and destination addresses (see details in DUAL DATA
POINTERS, page 37).
Program Counter (PC)
The PC is a 16-bit register consisting of two 8-bit
registers, PCL and PCH. This counter indicates
the address of the next instruction in program
memory to be fetched and executed. A reset forces the PC to location 0000h, which is where the reset jump vector is stored.
Accumulator (ACC)
This is an 8-bit general purpose register which
holds a source operand and rece ives the result of
arithmetic operations. The ACC Register can also
be the source or destination of logic and data
movement operations. For MUL and DIV instructions, ACC is combined with the B Register to hold
16-bit operands. The ACC is referred to as “A” in
the MCU instruction set.
B Register (B)
The B Register is a gene ra l purpo se 8-bit regi ster
for temporary data storage and also used as a 16bit register when concatenated with the ACC Register for use with MUL and DIV instructions.
21/231
uPSD33xx
General Purpose Registers (R0 - R7)
There are four banks of eight general purpose 8bit registers (R0 - R7), but only o ne bank of eight
registers is active at any given time dependin g on
the setting in the PSW word (described next). R0 R7 are generally used to assist in manipulating
values and moving data from one memory location
to another. These register banks physically reside
in the first 32 locations of 8032 internal DATA
SRAM, starting at address 00h. At reset, only the
first bank of eight registers is active (addresses
00h to 07h), and the stack begins at address 08h.
Program Stat us Wor d (PSW )
The PSW is an 8-bit regi ster wh ich st ores s everal
important bits, or flags, that are set and cleared by
many 8032 instructions, reflecting the current
state of the MCU core. Figure 12., page 22 shows
the individual flags.
Carry Flag (CY). This flag is set when the last
arithmetic operation that was executed results in a
carry (addition) or borrow (subtraction). It is
cleared by all other arithmetic operations. The CY
flag is also affected by Shift and Rotate Instructions.
Auxiliary Carry Flag (AC). This flag i s set when
the last arithmetic operation that was executed results in a carry into (addition) or borrow from (subtraction) the high-order nibble. It is cleared by all
other arithmetic operations.
General Purpose Flag (F0). This is a bit-addressable, general-purpose flag for use under software
control.
Register Bank Select Flags (RS1, RS0). These
bits select which ba nk of eight regist ers is used
during R0 - R7 register accesses (see Table 4)
Overflow Flag (OV). The OV flag is set when: an
ADD, ADDC, or SUBB instruction causes a sign
change; a MUL instruction results in an overflow
(result greater than 255); a DIV instruction causes
a divide-by-zero condition. The OV f lag is cl eared
by the ADD, ADDC, SUBB, MUL, and DIV instructions in all other cases. The CLRV instruction will
clear the OV flag at any time.
Parity Flag (P). The P flag is set if the sum of the
eight bits in the Accumulator is odd, and P is
cleared if the sum is even.
Figure 12. Program Statu s W or d (PS W ) Re gi st er
MSB
CY
PSW
Carry Flag
Auxillary Carry Flag
General Purpose Flag
AC FO RS1 RS0 OVP
Register Bank Select Flags
(to select Bank0-3)
LSB
Reset Value 00h
Parity Flag
Bit not assigned
Overflow Flag
AI06639
22/231
SPECIA L FUNCTION REGISTER S (SFR)
A group of registers designated as Special Function Register (SFR) is shown in Table 5., page 24.
SFRs control the operating modes of the MCU
core and also control the peripheral interfaces and
I/O pins on the MCU Module. The SFRs can be accessed only by using the Direct Addressing method within the address range from 80h t o FFh of
internal 8032 SRAM. Sixteen addresses in SFR
address space are both byte- and bit-addressable.
The bit-addressable SFRs are noted in Table 5.
86 of a possible 128 SFR addresses are occupied.
The remaining unoccupied SFR addresses (designated as “RESERVED” in Table 5) should not be
written. Reading unoccupied lo cations will return
an undefined value.
Note: There is a separate set of control registers
for the PSD Module, designated as csiop, and they
are described in the PSD MODULE, page 133.
The I/O pins, PLD, and other functions on the PSD
Module are NOT controlled by SFRs.
Note: 1. This SFR can be addressed by i ndividual bits (Bit Addr ess mode) or addressed by the entire by te (Direct Address mode) .
SFR
Name
76 5 43210
Bit Name and <Bit Address>Reset
Value
(hex)
with Link
21., page
68., page
69., page
Reg.
Descr.
Table
47
Table
125
Table
125
29/231
uPSD33xx
8032 ADDRESSING MODES
The 8032 MCU uses 11 different addressing
modes listed below:
■Register
■Direct
■Register Indirect
■Immediate
■External Direct
■External Indirect
■Indexed
■Relative
■Absolute
■Long
■Bit
Register Addressing
This mode uses the con tents of one of the registers R0 - R7 (selected by the last three bits in the
instruction opcode) as the operand source or destination. This mode is very efficient since an additional instruction byte is not needed to ident ify the
operand. For example:
MOV A, R7; Move contents of R7 to accumulator
Direct Addressing
This mode uses an 8-bit address, which is contained in the second byte of the instruction, to directly address an operand which reside s in either
8032 DATA SRAM (internal address range 00h07Fh) or resides in 8032 SFR (internal address
range 80h-FFh). This m ode is quite fast sin ce the
range limit is 256 bytes of internal 8032 SRAM.
For example:
MOV A, 40h; Move contents of DATA SRAM
; at location 40h into the accumulator
Register Indirect Addressing
This mode uses an 8-bit address contained in either Register R0 or R1 to indirectly address an operand which resides in 8032 IDATA SRAM
(internal address range 80h-FFh). Although 8 032
SFR registers also occupy the same physical address range as IDATA, SFRs will not be accessed
by Register Indirect mode. S F Rs m ay on ly be accesses using Direct address mode. For example:
MOV A, @R0; Move into the accumulator the
; contents of IDATA SRAM that is
; pointed to by the address
; contained in R0.
Imm ediate Addressing
This mode uses 8-bits of dat a (a constant) contained in the second byte of the instruction, and
stores it into the memory location or register indicated by the first byte of the in struction. Thu s, the
data is immediately available within the instruction.
This mode is commonly used to initialize registers
and SFRs or to perform mask operations.
There is also a 16-bit version of this mode for loading the DPTR Register. In this case, the two bytes
following the instruction byte contain the 16-bit value. For example:
MOV A, 40#; Move the constant, 40h, into
; the accumulator
MOV DPTR, 1234# ; Move the constant, 1234h, into
; DPTR
External Direct Addressing
This mode will access external me mory (XDATA)
by using the 1 6-bit address stored in the DPTR
Register. There are only two instructions using this
mode and both use the accumulator to either receive a byte from external memory addressed by
DPTR or to send a byte from the accumul ator to
the address in DPTR. The uPSD 33xx has a special feature to alternate the contents (source and
destination) of DPTR rapidly to implement very efficient memory-to-memory transfers. For example:
MOVX A, @DPTR ; Move contents of accumulator to
; XDATA at address contained in
; DPTR
MOVX @DPTR, A ; Move XDATA to accumulator
Note: See details in DUAL DATA
POINTERS, page 37.
External Indirect Addressing
This mode will access external me mory (XDATA)
by using the 8-bit address stored in either Register
R0 or R1. This is the fastest way to access XDATA
(least bus cycles), but because only 8-bits are
available for address, this mode limits XDATA to a
size of only 256 bytes (the traditional Port 2 of the
8032 MCU is not available in the uPSD33xx, so it
is not possible to write the upper address byte).
This mode is not supported by uPSD33xx.
For example:
MOVX @R0,A; Move into the accumulator the
; XDATA that is pointed to by
; the address contained in R0.
30/231
Loading...
+ 201 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.