UPSD3422 UPSD3433
UPSD3434 UPSD3454
Turbo Plus series
Fast Turbo 8032 MCU with USB and programmable logic
Features
■
Fast 8-bit Turbo 8032 MCU, 40 MHz
– Advanced core, 4-clocks per instruction
– 10 MIPs peak performance at 40 MHz (5 V)
– JTAG debug and in-system programming
– 16-bit internal instruction path fetches
double-byte instruction in a single memory
cycle
– Branch cache & 4 instruction prefetch
queue
– Dual XDATA pointers with automatic
increment and decrement
– 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 EEPROM
emulation
– Single voltage program and erase
– 100 000 guaranteed erase cycles, 15-year
retention
Clock, reset, and power supply management
– Flexible 8-level CPU clock divider register
– Normal, Idle, and power-down modes
– Power-on-reset and low-voltage-reset
supervisor
– Programmable watchdog timer
LQFP52 (T), 52-lead,
thin, quad, flat
■
LQFP80 (U), 80-lead,
thin, quad, flat
■
)-
(s
so
b
ct
u
d
-O
ro
s)
P
t(
te
uc
le
o
od
r
s
P
b
O
te
le
so
b
O
■
■
■
b
O
Communication interfaces
– USB v2.0 Full Speed (12Mbps)
– 10 endpoint pairs (In/Out), each endpoint
with 64-byte FIFO (supports Control, Intr,
and Bulk transfer types)
– I
2
C Master/Slave controller, 833kHz
– SPI Master controller, 10MHz
– Two UARTs with independent baud rate
– IrDA potocol: up to 115 kbaud
– Up to 46 I/O, 5 V tolerant uPSD34xxV
so
te
le
ro
P
uc
d
s)
t(
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
– 12 Interrupt sources with two external
interrupt pins
Packages
– ECOPACK
®
compliant
Device summary
Part number
UPSD3422E, UPSD3422EV
UPSD3433E, UPSD3433EV
UPSD3434E, UPSD3434EV
UPSD3454E, UPSD3454EV
P
te
le
od
r
s)
t(
uc
Table 1.
Reference
■
Programmable logic, general purpose
– 16 macrocells for logic applications (e.g.,
shifters, state machines, chip-selects, glue-
logic to keypads, and LCDs)
A/D converter
– Eight channels, 10-bit resolution, 6 µs
Operating voltage source (±10%)
– 5 V devices: 5.0 V and 3.3 V sources
– 3.3 V devices: 3.3 V source
uPSD3422
uPSD3433E
uPSD3434
uPSD3454
■
■
January 2009
Rev 5
1/300
www.st.com
1
Contents
UPSD3422, UPSD3433, UPSD3434, UPSD3454
Contents
1
2
3
4
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Hardware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.1
Internal memory (MCU module, standard 8032 memory:
DATA, IDATA, SFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.1.1
4.1.2
4.1.3
DATA memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
IDATA memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
SFR memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.2
External memory (PSD module: program memory, data memory) . . . . . 31
4.2.1
4.2.2
4.2.3
Program memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Data memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Memory placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
)-
(s
so
b
ct
u
d
-O
ro
s)
P
t(
te
uc
le
o
od
r
s
P
b
O
te
le
so
b
O
5
5.1
5.2
5.3
b
O
so
te
le
ro
P
uc
d
s)
t(
8032 MCU core performance enhancements . . . . . . . . . . . . . . . . . . . . 33
Pre-fetch queue (PFQ) and branch cache (BC) . . . . . . . . . . . . . . . . . . . . 34
PFQ example, multi-cycle instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
P
te
le
od
r
s)
t(
uc
Aggregate performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6
7
MCU module description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
8032 MCU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
7.1
7.2
Stack pointer (SP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Data pointer (DPTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Program counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
7.3
7.4
7.5
7.6
7.7
Accumulator (ACC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
B register (B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
General purpose registers (R0 - R7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Program status word (PSW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
7.7.1
7.7.2
Carry flag (CY) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Auxiliary carry flag (AC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2/300
UPSD3422, UPSD3433, UPSD3434, UPSD3454
7.7.3
7.7.4
7.7.5
7.7.6
Contents
General purpose flag (F0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Register bank select flags (RS1, RS0) . . . . . . . . . . . . . . . . . . . . . . . . . 39
Overflow flag (OV) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Parity flag (P) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
8
9
Special function registers (SFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
8032 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.1
9.2
9.3
9.4
9.5
9.6
9.7
9.8
9.9
9.10
9.11
Register addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Direct addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Register indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Immediate addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
External direct addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
External indirect addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Indexed addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Relative addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Absolute addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Long addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
)-
(s
so
b
ct
u
d
-O
ro
s)
P
t(
te
uc
le
o
od
r
s
P
b
O
te
le
so
b
O
10
11
11.1
11.2
11.2.1
b
O
so
te
le
ro
P
uc
d
s)
t(
Bit addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
P
te
le
od
r
s)
t(
uc
UPSD34xx instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Dual data pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Data pointer control register, DPTC (85h) . . . . . . . . . . . . . . . . . . . . . . . . 57
Data pointer mode register, DPTM (86h) . . . . . . . . . . . . . . . . . . . . . . . . . 58
Firmware example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
12
13
Debug unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Interrupt system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Individual interrupt sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
External interrupts Int0 and Int1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Timer 0 and 1 overflow interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Timer 2 overflow interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
UART0 and UART1 interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
SPI interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
13.1.1
13.1.2
13.1.3
13.1.4
13.1.5
13.1
3/300
Contents
13.1.6
13.1.7
13.1.8
13.1.9
UPSD3422, UPSD3433, UPSD3434, UPSD3454
I
2
C interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
ADC interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
PCA interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
USB interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
14
MCU clock generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
14.1
14.2
MCU_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
PERIPH_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
14.2.1
14.2.2
JTAG interface clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
USB_CLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
15
Power saving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
15.1
15.2
15.3
Idle mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Power-down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Reduced frequency mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
16
17
Oscillator and external components . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
I/O ports of mcu module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
MCU port operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
GPIO function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
GPIO input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
GPIO output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
17.1.1
17.1.2
17.1.4
17.1.3
)-
(s
so
b
ct
u
d
-O
ro
s)
P
t(
te
uc
le
o
od
r
s
P
b
O
te
le
so
b
O
17.1
b
O
so
te
le
ro
P
uc
d
s)
t(
P
te
le
od
r
s)
t(
uc
18
MCU bus interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
PSEN bus cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
READ or WRITE bus cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
18.1
18.2
18.3
Connecting external devices to the MCU bus . . . . . . . . . . . . . . . . . . . . . 86
Programmable bus timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
18.4
18.5
Controlling the PFQ and BC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
19
Supervisory functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
19.1
19.2
19.3
External reset input pin, RESET_IN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Low V
CC
voltage detect, LVD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Power-up reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
4/300
UPSD3422, UPSD3433, UPSD3434, UPSD3454
Contents
19.4
19.5
JTAG debug reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Watchdog timer, WDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
19.5.1
Firmware example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
20
Standard 8032 timer/counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
20.1
20.2
20.3
20.4
20.5
Standard timer SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
SFR, TCON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
SFR, TMOD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Timer 0 and Timer 1 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
20.5.1
20.5.2
20.5.3
20.5.4
Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Mode 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
20.6
Timer 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
20.6.1
20.6.2
20.6.3
Capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Auto-reload mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Baud rate generator mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
)-
(s
so
b
ct
u
d
-O
ro
s)
P
t(
te
uc
le
o
od
r
s
P
b
O
te
le
so
b
O
21
21.1
21.1.1
21.1.2
21.1.3
21.1.4
21.1.5
b
O
so
te
le
ro
P
uc
d
s)
t(
Serial UART interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
UART operation modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Mode 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Mode 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Multiprocessor communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
P
te
le
od
r
s)
t(
uc
21.2
Serial port control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
UART baud rates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Using timer 1 to generate baud rates . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Using timer/counter 2 to generate baud rates . . . . . . . . . . . . . . . . . . . 111
21.3
21.3.1
21.3.2
21.4
21.5
More about UART mode 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
More about UART mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
More about UART modes 2 and 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
21.6
22
IrDA interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
22.1
Baud rate selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
5/300