Professional Documents
Culture Documents
FEATURES SUMMARY
8-bit System On Chip for Embedded Control Figure 1. 52-lead, Thin, Quad, Flat Package
The Turbo uPSD3300 Series combines a power-
ful, 8051-based microcontroller with a flexible
memory structure, programmable logic, and a rich
peripheral mix to form an ideal SOC for embedded
control. At it's core is a fast, 4-cycle 8032 MCU
with a 6-byte instruction prefetch queue and a 4-
entry, fully associative branching cache to maxi-
mize MCU performance, enabling smaller loops of
code to execute very quickly.
■ Fast Turbo 8032 MCU
TABLE OF CONTENTS
SUMMARY DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
MEMORY ORGANIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Internal Memory (MCU Module, Standard 8032 Memory: DATA, IDATA, SFR) . . . . . . . . . . . . 16
External Memory (PSD Module: Program memory, Data memory). . . . . . . . . . . . . . . . . . . . . . 16
INTERRUPT SYSTEM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
External Int0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Timer 0 and 1 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Timer 2 Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
I2C Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
External Int1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
ADC Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
PCA Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
SPI Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
UART Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Debug Interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Interrupt Priority Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Interrupts Enable Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
CLOCK GENERATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2/129
uPSD33XX
OSCILLATOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
SUPERVISORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
External Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Low VCC Voltage Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Watchdog Timer Overflow Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Debug Unit Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Reset Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Power-up Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
WATCHDOG TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Watchdog Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
WDT Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
I2C INTERFACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
I2C Registers Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Serial Status Register (S1STA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Data Shift Register (S1DAT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Address Register (S1ADR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3/129
uPSD33XX
PSD MODULE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Functional Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
MEMORY BLOCKS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Primary Flash Memory and Secondary Flash memory Description . . . . . . . . . . . . . . . . . . . . . 74
Memory Block Select Signals. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Flash Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
READ Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Programming Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Erasing Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Specific Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Sector Select and SRAM Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Page Register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
PLDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
The Turbo Bit in PSD Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Decode PLD (DPLD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Complex PLD (CPLD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Output Macrocell (OMC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Product Term Allocator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Input Macrocells (IMC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
4/129
uPSD33XX
POWER MANAGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
PLD Power Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
PSD Chip Select Input (CSI, PD2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Input Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Input Control Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
5/129
uPSD33XX
SUMMARY DESCRIPTION
For the Turbo uPSD3300 Series, code develop- ■ Programmable Logic, General Purpose
ment is easily managed without a hardware In-Cir- – 16 Macrocells with architecture similar to in-
cuit Emulator by using the serial JTAG debug dustry standard 22V10 PLDs
interface. JTAG is also used for In-System Pro-
gramming (ISP), perfect for manufacturing and lab – Create shifters, state machines, chip-selects,
glue-logic to keypads, panels, LCDs, others
development. The 8032 core is coupled to Pro-
grammable System Device (PSD) architecture to – Configure PLD with simple PSDsoft Express
optimize 8032 memory structure, offering two in- software ... download at no charge from web.
dependent banks of Flash memory that can be ■ Dual Flash Memories w/Memory Managment
placed at virtually any address within 8032 pro- – True READ-while-WRITE concurrent access
gram or data space, and easily paged beyond 64K
bytes using on-chip programmable decode logic. – Main Flash size: 64K, 128K, or 256K Bytes
Dual Flash memory banks provide a robust solu- – Secondary Flash size: 16K or 32K bytes
tion for remote product updates in the field through – 100,000 min erase cycles, 15 year retention
In-Application Programming (IAP). Dual Flash – On-chip programmable memory decode logic
banks also support EEPROM emulation, eliminat-
ing the need for external EEPROM chips. ■ SRAM
A wide variety of Flash and SRAM memory sizes – 2K, 8K, or 32K Bytes; use as XDATA or code.
are available, some reaching the largest on the 8- – Capable of battery backup w/external battery.
bit MCU market today. General purpose program- ■ Peripheral Interfaces
mable logic is included to build an endless variety – Eight channels of 10-bit ADC, 10µsec
of glue-logic, saving external chips. This SOC also
conversion
provides a rich array of peripherals, including ana-
log and supervisor functions. – I2C Master/Slave bus controller up to 800kHz
■ Fast Turbo 8032 MCU – SPI Master bus controller
– Advanced 8032 core: four clocks per instruc- – Two standard UARTs with independent baud
tion instruction; pre-fetch; branching cache – IrDA protocol support up to 115K baud rate
– 10 MIPs peak performance @40MHz clock – 8032 address/data bus (80 pin package only)
5.0V VCC ... 8 MIPs peak @40MHz, 3.3V VCC – Up to 46 I/O; eight can sink/source 10mA.
– 8032 core compatible with 3rd party tools ■ Supervisor Functions
– Internal clock divider for lower-power mode – Watchdog timer, VCC monitor with 10ms
– Three 8032 16-bit timers and external Reset generator, Filtered Reset input
interrupts ■ Content Security
– Dual XDATA pointers with auto incr & decr – Cannot use JTAG to read or alter Flash
■ Programmable Counter Array (PCA) memory and chip configuration once the
– Dual independent timer/counter blocks, each Security Bit is set.
with three 16-bit timer/counters modules – Defeat the Security Bit only be full-chip erase,
– Use any of the 6 modules as: 16-bit capture/ then the chip may be used again.
compare, 16-bit timer/counter, 8/16 bit PWM. ■ Operating Range
■ JTAG Debug and In-System Programming – 3.3V applications: VCC = 3.3V ± 10%
– Set Breakpoints, trace, single-step, display, – 5.0V applications: VCC: Both 5.0V ± 10% and
modify memory and SFRs; external event 3.3V ± 10% sources are required.
pin. – Temp: –40°C to +85°C (Industrial Range)
– ISP the chip in 10-20sec, 8032 not involved. ■ TQFP Packaging
– 52-pin (10x10mm) or 80-pin (12x12mm)
6/129
uPSD33XX
7/129
uPSD33XX
41 P1.7/SPISEL_(2)/ADC7
40 P1.6/SPITXD(2)/ADC6
47 3.3V VCC/VREF(3)
44 RESET_IN_
45 GND
52 PB0
51 PB1
50 PB2
49 PB3
48 PB4
46 PB5
43 PB6
42 PB7
PD1/CLKIN 1 39 P1.5/SPIRXD(2)/ADC5
PC7 2 38 P1.4/SPICLK(2)/ADC4
JTAG TDO 3 37 P1.3/TXD1(IrDA)(2)/ADC3
JTAG TDI 4 36 P1.2/RXD1(IrDA)(2)/ADC2
DEBUG 5 35 P1.1/T2X(2)/ADC1
3.3V VCC 6 34 P1.0/T2(2)/ADC0
PC4/TERR_ 7 33 VDD(1)
VDD (1) 8 32 XTAL2
GND 9 31 XTAL1
PC3/TSTAT 10 30 P3.7/I2CSCL
PC2/VSTBY 11 29 P3.6/I2CSDA
JTAG TCK 12 28 P3.5/C1
JTAG TMS 13 27 P3.4/C0
SPISEL_(2)/PCACLK1/P4.7 14
SPITXD(2)/TCM5/P4.6 15
SPIRXD(2)/TCM4/P4.5 16
SPICLK(2)/TCM3/P4.4 17
TXD1(IrDA)(2)/PCACLK0/P4.3 18
GND 19
20
T2X(2)/TCM1/P4.1 21
T2(2)/TCM0/P4.0 22
RXD0/P3.0 23
TXD0/P3.1 24
EXTINT0/TG0/P3.2 25
EXTINT1/TG1/P3.3 26
RXD1(IrDA)(2)/TCM2/P4.2
AI07822
Note: 1. For 5V applications, VDD must be connected to a 5.0V source. For 3.3V applications, VDD must be connected to a 3.3V source.
2. These signals can be used on one of two different ports (Port 1 or Port 4) for flexibility. Default is Port1.
3. VREF and 3.3V VCC are shared in the 52-pin package only. ADC channels must use 3.3V as VREF for the 52-pin package.
8/129
uPSD33XX
64 P1.7/SPISEL_(2)/ADC7
61 P1.6/SPITXD(2)/ADC6
79 P3.2/EXINT0/TG0
68 RESET_IN_
75 P3.0/RXD0
77 P3.1/TXD0
72 3.3V VCC
63 PSEN_
70 VREF
69 GND
62 WR_
65 RD_
80 PB0
78 PB1
76 PB2
74 PB3
73 PB4
71 PB5
67 PB6
66 PB7
PD2 1 60 P1.5/SPIRXD(2)/ADC5
P3.3/TG1/EXINT1 2 59 P1.4/SPICLK(2)/ADC4
PD1 3 58 P1.3/TXD1(IrDA)(2)/ADC3
ALE 4 57 MCU A11
PC7 5 56 P1.2/RXD1(IrDA)(2)/ADC2
JTAG TDO 6 55 MCU A10
JTAG TDI 7 54 P1.1/T2X(2)/ADC1
DEBUG 8 53 MCU A9
PC4/TERR_ 9 52 P1.0/T2(2)/ADC0
3.3V VCC 10 51 MCU A8
NC 11 50 VDD(1)
VDD(1) 12 49 XTAL2
GND 13 48 XTAL1
PC3/TSTAT 14 47 MCU AD7
PC2/VSTBY 15 46 P3.7/I2CSCL
JTAG TCK 16 45 MCU AD6
NC 17 44 P3.6/I2CSDA
SPISEL_(2)/PCACLK1/P4.7 18 43 MCU AD5
SPITXD(2)/TCM5/P4.6 19 42 P3.5/C1
JTAG TMS 20 41 MCU AD4
PA7 21
PA6 22
SPIRXD(2)/TCM4/P4.5 23
PA5 24
SPICLK(2)/TCM3/P4.4 25
PA4 26
TXD1(IrDA)(2)/PCACLK0/P4.3 27
PA3 28
GND 29
RXD1(IrDA)(2)/TCM2/P4.2 30
T2X(2)/TCM1/P4.1 31
PA2 32
T2(2)/TCM0/P4.0 33
PA1 34
PA0 35
MCU AD0 36
MCU AD1 37
MCU AD2 38
MCU AD3 39
P3.4/C0 40
AI07823
9/129
uPSD33XX
10/129
uPSD33XX
11/129
uPSD33XX
12/129
uPSD33XX
5V:
3.3V 5.0V 3.3V but 5V tolerant 5V
uPSD33XX
3.3V:
3.3V 3.3V 3.3V but 5V tolerant 3.3V. NOT 5V tolerant
uPSD33XXV
13/129
uPSD33XX
Port 3 Port 1
VCC Pins
XTAL Turbo 8032 Core
PCA 2 3.3V
Clock Unit 10-bit I C
Dual 3 Timer / SPI PWM
UARTs Counters ADC Unit
Counters
Interrupt 256 Byte SRAM
Ext.
8032 Internal Bus
Dedicated Memory Bus
Interface Reset Input Reset
Prefetch, Jump Cache LVD
JTAG Pin
Internal Reset Logic
DEBUG
Reset WDT
8-Bit Die-to-Die Bus
PSD
Enhanced MCU Interface Reset
PSD Page Register Main Flash
Secondary
SRAM PSD Module
Flash
Decode PLD
VDD Pins
JTAG ISP CPLD - 16 MACROCELLS 3.3V or 5V
uPSD33XX Port C
Port A,B,C PLD Port D
JTAG and
I/O and GPIO GPIO
GPIO
AI07842
14/129
uPSD33XX
MEMORY ORGANIZATION
The 8032 MCU core views memory on the MCU dress space is for data memory. Program memory
module as "internal" memory and it views memory is accessed using the 8032 signal, PSEN_. Data
on the PSD module as "external" memory, see memory is accessed using the 8032 signals, RD_
Figure 6. and WR_. If the 8032 needs to access more than
Internal memory on the MCU Module consists of 64K bytes of external program or data memory, it
DATA, IDATA, and SFRs. These standard 8032 must use paging (or banking) techniques provided
memories reside in 384 bytes of SRAM located at by the Page Register in the PSD Module.
a fixed address space starting at address 0x0000. Note: When referencing program and data mem-
External memory on the PSD Module consists of ory spaces, it has nothing to do with 8032 internal
four types: main Flash (64K, 128K, or 256K bytes), SRAM areas of DATA, IDATA, and SFR on the
a smaller secondary Flash (16K, or 32K), SRAM MCU Module. Program and data memory spaces
(2K, 8K, or 32K bytes), and a block of PSD Module only relate to the external memories on the PSD
control registers called CSIOP (256 bytes). These Module.
external memories reside at programmable ad- External memory on the PSD Module can overlap
dress ranges, specified using the software tool the internal SRAM memory on the MCU Module in
PSDsoft Express. See the PSD Module section of the same physical address range (starting at
this document for more details on these memories. 0x0000) without interference because the 8032
External memory is accessed by the 8032 in two core does not assert the RD_ or WR_ signals
separate 64K byte address spaces. One address when accessing internal SRAM.
space is for program memory and the other ad-
AI07843
15/129
uPSD33XX
Internal Memory (MCU Module, Standard 8032 various combinations of 8032 program address
Memory: DATA, IDATA, SFR) space or 8032 data address space by using the
DATA Memory. The first 128 bytes of internal software tool PSDsoft Express.
SRAM ranging from address 0x0000 to 0x007F Program Memory. External program memory is
are called DATA, which can be accessed using addressed by the 8032 using its 16-bit Program
8032 direct or indirect addressing schemes and Counter (PC) and is accessed with the 8032 sig-
are typically used to store variables and stack. nal, PSEN_. Program memory can be present at
Four register banks, each 8 registers wide (R0 – any address in program space between 0x0000
R7), occupy addresses 0x0000 to 0x001F. Only and 0xFFFF.
one of these four banks may be enabled at a time. After a power-up or reset, the 8032 begins execu-
The next 16 locations at 0x0020 to 0x002F contain tion from location 0x0000 where the reset vector is
128 directly addressable bit locations that can be stored, causing a jump to an initialization routine in
used as software flags. SRAM locations 0x0030 firmware. At address 0x0003, just following the re-
and above may be used for variables and stack. set vector are the interrupt service locations. Each
IDATA Memory. The next 128 bytes of internal interrupt is assigned a fixed interrupt service loca-
SRAM are named IDATA and range from address tion in program memory. An interrupt causes the
0x0080 to 0x00FF. IDATA can be accessed only 8032 to jump to that service location, where it com-
through 8032 indirect addressing and is typically mences execution of the service routine. External
used to hold the MCU stack as well as data vari- Interrupt 0 (EXINT0), for example, is assigned to
ables. The stack can reside in both DATA and service location 0x0003. If EXINT0 is going to be
IDATA memories and reach a size limited only by used, its service routine must begin at location
the available space in the combined 256 bytes of 0x0003. Interrupt service locations are spaced at
these two memories (since stack accesses are al- 8-byte intervals: 0x0003 for EXINT0, 0x000B for
ways done using indirect addressing, the bound- Timer 0, 0x0013 for EXINT1, and so forth. If an in-
ary between DATA and IDATA does not exist with terrupt service routine is short enough, it can re-
regard to the stack). side entirely within the 8-byte interval. Longer
service routines can use a jump instruction to
SFR Memory. Special Function Registers (Table somewhere else in program memory.
4, page 21) occupy a separate physical memory,
but they logically overlap the same 128 bytes as Data Memory. External data is referred to as
IDATA, ranging from address 0x0080 to 0x00FF. XDATA and is addressed by the 8032 using Indi-
SFRs are accessed only using direct addressing. rect Addressing via its 16-bit Data Pointer Register
There 92 active registers used for many functions: (DPTR) and is accessed by the 8032 signals, RD_
changing the operating mode of the 8032 MCU and WR_. XDATA can be present at any address
core, controlling 8032 peripherals, controlling I/O, in data space between 0x0000 and 0xFFFF.
and managing interrupt functions. The remaining Note: the uPSD33XX has dual data pointers
unused SFRs are reserved and should not be ac- (source and destination) making XDATA transfers
cessed. much more efficient.
16 of the SFRs are both byte- and bit-addressable. Memory Placement. PSD Module architecture
Bit-addressable SFRs are those whose address allows the placement of its external memories into
ends in “0” or “8” hex as indicated by “*” in Table 4, different combinations of program memory and
page 21. data memory spaces. This means the main Flash,
External Memory (PSD Module: Program the secondary Flash, and the SRAM can be
memory, Data memory) viewed by the 8032 MCU in various combinations
of program memory or data memory as defined by
The PSD Module has four memories: main Flash, PSDsoft Express.
secondary Flash, SRAM, and CSIOP. See the
PSD MODULE section for more detailed informa- As an example of this flexibility, for applications
tion on these memories. that require a great deal of Flash memory in data
space (large lookup tables or extended data re-
Memory mapping in the PSD Module is imple- cording), the larger main Flash memory can be
mented with the Decode PLD (DPLD) and option- placed in data space and the smaller secondary
ally the Page Register. The user specifies decode
Flash memory can be placed in program space.
equations for individual segments of each of the
The opposite can be realized for a different appli-
memories using the software tool PSDsoft Ex- cation if more Flash memory is needed for code
press. This is a very easy point-and-click process
and less Flash memory for data.
allowing total flexibility in mapping memories. Ad-
ditionally, each of the memories may be placed in
16/129
uPSD33XX
By default, the SRAM and CSIOP memories on Standard 8032 MCU architecture cannot write to
the PSD Module must always reside in data mem- its own program memory space to prevent acci-
ory space and they are treated by the 8032 as dental corruption of firmware. However, this be-
XDATA. However, the SRAM may optionally re- comes an obstacle in typical 8032 systems when
side in program space in addition to data space if a remote update to firmware in Flash memory is
it is desired to execute code from SRAM. The main required using IAP. The PSD module provides a
Flash and secondary Flash memories may reside solution for remote updates by allowing 8032 firm-
in program space, data space, or both. ware to temporarily "reclassify" Flash memory to
These memory placement choices specified by reside in data space during a remote update, then
PSDsoft Express are programmed into non-vola- returning Flash memory back to program space
tile sections of the uPSD33XX, and are active at when finished. See the VM Register (Table 84,
power-up and after reset. It is possible to override page 81) in the PSD Module section of this docu-
these initial settings during runtime for In-Applica- ment for more details.
tion Programming (IAP).
17/129
uPSD33XX
4 clocks (one machine cycle) one machine cycle one machine cycle
MCU Clock
Instruction A
Execute Instruction A
Standard 8032 Fetch Byte for Instruction A and Fetch a Second Dummy Byte
Current
Branch
Address
Instruction Instruction
Byte Byte
8032
Program 8 8 MCU
Memory on
PSD Module 6 Bytes of Instruction
Address Address
16 16
18/129
uPSD33XX
Pre-Fetch Queue (PFQ) and Branch Cache PFQ Example, Multi-cycle Instructions
(BC) Let us look at a string of two-byte, two-cycle in-
The PFQ is always working to minimize the idle structions in Figure 9, page 20. There are three in-
bus time inherent to 8032 MCU architecture, to structions executed sequentially in this example,
eliminate wasted memory fetches, and to maxi- instructions A, B,and C. Each of the time divisions
mize memory bandwidth to the MCU. The PFQ in the figure is one machine-cycle of four clocks,
does this by running asynchronously in relation to and there are six phases to reference in this dis-
the MCU, looking ahead to pre-fetch code from cussion. Each instruction is pre-fetched into the
program memory during any idle bus periods. Only PFQ in advance of execution by the MCU. Prior to
necessary bytes will be fetched (no dummy fetch- Phase 1, the PFQ has pre-fetched the two instruc-
es like standard 8032). The PFQ will queue up to tion bytes (A1 and A2) of instruction A. During
six code bytes in advance of execution, which sig- Phase one, both bytes are loaded into the MCU
nificantly optimizes sequential program perfor- execution unit. Also in Phase 1, the PFQ is pre-
mance. However, when program execution fetching the first byte (B1) of instruction B from
becomes non-sequential (program branch), a typ- program memory. In Phase 2, the MCU is pro-
ical pre-fetch queue will empty itself and reload cessing Instruction A internally while the PFQ is
new code, causing the MCU to stall. The Turbo pre-fetching the second byte (B2) of Instruction B.
uPSD33XX diminishes this problem by using a In Phase 3, both bytes of instruction B are loaded
Branch Cache with the PFQ. The BC is a four-way, into the MCU execution unit and the PFQ begins
fully associative cache, meaning that when a pro- to pre-fetch bytes for the third instruction C. In
gram branch occurs, it's branch destination ad- Phase 4 Instruction B is processed and the pre-
dress is compared simultaneously with four recent fetching continues, eliminating idle bus cycles and
previous branch destinations stored in the BC. feeding a continuous flow of operands and op-
Each of the four cache entries contain up to six codes to the MCU execution unit.
bytes of code related to a branch. If there is a hit The uPSD33XX MCU instructions are an exact 1/
(a match), then all six code bytes of the matching 3 scale of all standard 8032 instructions with re-
program branch are transferred immediately and gard to number of cycles per instruction. Figure
simultaneously from the BC to the PFQ, and exe- 10, page 20 shows the equivalent instruction se-
cution on that branch continues with minimal de- quence from the example above on a standard
lay. This greatly reduces the chance that the MCU 8032 for comparison.
will stall from an empty PFQ, and improves perfor-
mance in embedded control systems where it is Aggregate Performance
quite common to branch and loop in relatively The stream of two-byte, two-cycle instructions in
small code localities. Figure 9, page 20, running on a 40MHz, 5V,
uPSD33XX will yield 5 MIPs. And we saw the
By default, the PFQ and BC are enabled after
power-up or reset. The 8032 can disable the PFQ stream of one-byte, one-cycle instructions in Fig-
ure 7, page 18 on the same MCU yield 10 MIPs.
and BC at runtime if desired by writing to a specific
Your effective performance will depend on a num-
SFR (BUSCON).
ber of things: your MCU clock frequency; the mix-
The memory in the PSD module operates with ture of instructions types (bytes and cycles) in your
variable wait states depending on the value spec- application; the amount of time an empty PFQ
ified in the SFR named BUSCON. For example, a stalls the MCU (mix of instruction types and miss-
5V uPSD33XX device operating at a 40MHz crys- es on Branch Cache); and the operating voltage.
tal frequency requires four memory wait states A 5V uPSD33XX device operates with four mem-
(equal to four MCU clocks). In this example, once ory wait states, but a 3.3V devices operates with
the PFQ has one or more bytes of code, the wait five memory wait states yielding 8 MIPS peak
states become transparent and a full 10 MIPS is compared to 10 MIPs peak for 5V devices. The
achieved when the program stream consists of se- same number of wait states will apply to both pro-
quential one-byte, one machine-cycle instructions gram fetches and to data READ/WRITEs unless
as shown in Figure 7, page 18 (transparent be- otherwise specified in the SFR named BUSCON.
cause a machine-cycle is four MCU clocks which
equals the memory pre-fetch wait time that is also In general, a 3X aggregate performance increase
is expected over any standard 8032 application
four MCU clocks). But it is also important to under-
running at the same clock frequency.
stand PFQ operation on multi-cycle instructions.
19/129
uPSD33XX
PFQ Inst A, Byte 1 Inst A, Byte 2 Inst B, Byte 1 Inst B, Byte 2 Inst C, Byte 1 Inst C, Byte 2 Continue to Pre-Fetch
4-clock
Macine Cycle
AI08810
1 Cycle
Std 8032 Byte 1 Byte 2 Process Inst A Byte 1 Byte 2 Process Inst B Byte 1 Byte 2 Process Inst C
1 Cycle
AI08811
20/129
uPSD33XX
21/129
uPSD33XX
Table 5. Data Pointer Control Register, DPTC, Bit Definition (85H, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
– AT – – – – – DPSEL0
22/129
uPSD33XX
Table 7. Data Pointer Mode Register, DPTM Bit Definition (86H, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
– – – – MD11 MD10 MD01 MD00
Debug Unit
The MCU Module has a Debug Unit which sup- – Four breakpoints, breaks on address/data
ports debugging functions that are required in new – Debug Interrupt to CPU at breakpoint
PC board development. The JTAG port in the
– Program tracing
uPSD33XX is responsible for communications be-
tween the host development system and the De- – READ/WRITE to SFR, PC and Memory
bug Unit. The basic debugging functions The Debug pin can be configured in the host sys-
supported include: tem to generate an output pulse for external trig-
– Halt or Start CPU execution gering when a break condition is met. It can also
be configured as an event input to the breakpoint
– Reset the CPU
logic in the Debug Unit. If not used, this pin should
– Single Step be pulled high.
23/129
uPSD33XX
INTERRUPT SYSTEM
There are interrupt requests from 10 sources as of their respective Timer/Counter registers
follows: (except for Timer 0 in Mode 3).
■ Debug Interrupt – These flags are cleared by the internal
■ INT0 External Interrupt hardware when the interrupt is serviced.
■ UART0 and UART1 Interrupt Timer 2 Interrupt
■ Timer 0 Interrupt – Timer 2 Interrupt is generated by TF2 which
2 is set by an overflow of Timer 2. This flag has
■ I C Interrupt
to be cleared by the software - not by
■ INT1 External Interrupt hardware.
■ ADC Interrupt – It is also generated by the T2EX signal (Timer
■ Timer 1 Interrupt 2 External Interrupt P1.1) which is controlled
■ SPI Interrupt by EXEN2 and EXF2 Bits in the T2CON
register.
■ Timer 2 Interrupt
I2C Interrupt
■ PCA Interrupt
– The interrupt of the I2C is generated by Bit
External Int0 INTR in the register S1STA.
– The INT0 can be either level-active or – This flag is cleared by hardware.
transition-active depending on Bit IT0 in
register TCON. The flag that actually External Int1
generates this interrupt is Bit IE0 in TCON. – The INT1 can be either level-active or
– When an external interrupt is generated, the transition-active, depending on Bit IT1 in
corresponding request flag is cleared by the register TCON.
hardware when the service routine is The flag that actually generates this interrupt
vectored to only if the interrupt was transition is Bit IE1 in TCON.
activated. – When an external interrupt is generated, the
– If the interrupt was level activated then the corresponding request flag is cleared by the
interrupt request flag remains set until the hardware when the service routine is
requested interrupt is actually generated. vectored to, but only if the interrupt was
Then it has to deactivate the request before transition-activated.
the interrupt service routine is completed, or – If the interrupt was level-activated, then the
else another interrupt will be generated. interrupt request flag remains set until the
Timer 0 and 1 Inputs requested interrupt is actually generated. It
– Timer 0 and Timer 1 Interrupts are generated then has to deactivate the request before the
by TF0 and TF1 which are set by an overflow interrupt service routine is completed, or else
another interrupt will be generated.
24/129
uPSD33XX
25/129
uPSD33XX
Interrupt P riority
Sources IE/IEA IP/IP A
High
Debug
Low
Ext
INT0
Timer 0
Ext
INT1
Timer 1
UART0
Interrupt Polling
Sequence
Timer 2
SP I
Reserved
I2C
ADC
P CA
UART1
Global
Enable
AI07844
26/129
uPSD33XX
9 I2C 0043H
10 ADC 003BH
11 PCA 005BH
12 UART1 004BH
Interrupt
A7 IEA ADC SPI PCA ES1 – – EI2C 00
Enable (2nd)
Interrupt
A8 IE EA EDB ET2 ES0 ET1 EX1 ET0 EX0 00
Enable
Interrupt
B7 IPA PADC PSPI PPCA PS1 – – PI2C 00
Enable (2nd)
Interrupt
B8 IP – PDB PT2 PS0 PT1 PX1 PT0 PX0 00
Priority
27/129
uPSD33XX
Table 12. Interrupt Enable Addition SFR IEA Bit Definition (A7H)
BIT SYMBOL FUNCTION
7 EADC ADC Interrupt
6 ESPI SPI Interrupt
5 EPCA Programmable Counter Array Interrupt
4 ES1 UART1 Interrupt
3 – Reserved
2 – Reserved
28/129
uPSD33XX
Table 14. Interrupt Priority Level Addition SFR IPA Bit Definition (B7H)
BIT SYMBOL FUNCTION
7 PADC ADC Interrupt priority level
6 PSPI SPI Interrupt priority level
5 PPCA PCA Interrupt level
4 PS1 UART1 Interrupt priority level
3 – Not used
2 – Not used
29/129
uPSD33XX
Idle Mode
The instruction that sets PCON.0 is the last in- – External hardware reset: the hardware reset
struction executed in the normal operating mode is required to be active for two machine
before Idle Mode is activated. Once in the Idle cycles to complete the RESET operation.
Mode, the CPU status is preserved in its entirety: – Internal reset: the microcontroller restarts
Stack pointer, Program counter, Program status after 3 machine cycles in all cases.
word, Accumulator, RAM, and All other registers
Power-down Mode
maintain their data during Idle Mode.
The instruction that sets PCON.1 is the last exe-
There are three ways to terminate the Idle Mode:
cuted prior to going into the Power-down Mode.
– Activation of any enabled interrupt will cause Once in Power-down Mode, the oscillator is
PCON.0 to be cleared by hardware, stopped. The contents of the on-chip RAM and the
terminating Idle Mode. The interrupt is
Special Function Register are preserved.
serviced, and following return from interrupt
instruction, RETI, the next instruction to be The Power-down Mode can be terminated by an
executed will be the one which follows the external RESET.
instruction that wrote a logic '1' to PCON.0.
Table 17. PCON Register Bit Definition (87H, Reset Value 00H)
BIT SYMBOL FUNCTION
Baud Rate Double Bit (UART0)
7 SMOD0 0 = No Doubling
1 = Doubling
Baud Rate Double Bit for 2nd UART (UART1)
6 SMOD1 0 = No Doubling
1 = Doubling
Disable LVD by setting this bit.
5 LVD 0 = Enable
1 = Disable
Power-on reset sets this bit to '1.' See SUPERVISORY, page 37 for details.
4 POR 0 = Clear with software
1 = Set by power-on reset generated by Supervisory circuit
30/129
uPSD33XX
OSCCLK
(TIMER0/1/2, UART0/1,
P CA0/1, SP I,ADC)
AI07845
CLOCK GENERATION
The clock unit uses the external crystal oscillator breakpoint match or when the CPU is put in the
as a reference input clock, whose frequency is de- halt state by the Debug Unit.
noted by FOSC. Based on the Frequency Selection CPUCLK_nonstop. A clock for CPU-loosely-re-
Control registers (CCON0), the clock unit gener- lated peripherals (e.g., Debug, Interrupt). This
ates the following clocks: clock is the same as CPUCLK, except this clock is
CPUCLK. A clock for CPU and CPU-tightly-relat- alive in Idle Mode.
ed peripherals (e.g., JTAG, WDT, IO_PORT). This PFQCLK. A clock for PFQ. This clock is same as
clock is disabled in both the Power-down Mode CPUCLK except that this is alive even in Idle Mode
and the Idle Mode. The frequency of CPUCLK is or when the CPU is stalled.
fCPU, which is obtained based on the fOSC, CP-
OSCCLK. A clock for non-CPU related peripher-
UPS[2:0], and internal signals Idle, and Stall.
als (e.g., TIMER0/1/2, UART0/1, PCA0/1, SPI).
When 'Idle' is 1, fCPU is 0MHz. Otherwise, fCPU is
a function of fOSC, CPUPS[2:0], and Stall. The The frequency of OSCCLK is fOSC, which is ob-
tained from the external clock input. This clock is
Stall signal is generated from the Pre-fetch Queue
disabled only in the Power-down Mode.
(PFQ) block when the requested program code is
not prepared in PFQ yet. CPUCLK is alive after a The clock status is summarized in Table 18, page
32.
31/129
uPSD33XX
Table 19. CCON0 Register Bit Definition (0F9H, Reset Value 10H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Reserved Reserved Reserved DBGCE CUPAR CPUPS[2:0]
32/129
uPSD33XX
OSCILLATOR
The oscillator circuit of the uPSD33XX Devices is and XTAL2 is the output. To drive the uPSD33XX
a single stage, inverting amplifier in a Pierce oscil- Devices externally, XTAL1 is driven from an exter-
lator configuration. The circuitry between XTAL1 nal source and XTAL2 left open-circuit.
and XTAL2 is basically an inverter biased to the The uPSD33XX can run at maximum 40MHz
transfer point. Either a crystal or ceramic resonator clock. The CPU clock frequency can be configured
can be used as the feedback element to complete in the CCON0 Register. However, the I2C bus re-
the oscillator circuit. Both are operated in parallel quires a minimum 8MHz clock to be functional.
resonance. XTAL1 is the high gain amplifier input,
8 to 40 MHz
External Clock
AI06620
33/129
uPSD33XX
34/129
uPSD33XX
Table 27. BUSCON Register Bit Definition (9DH, Reset Value 2BH)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
EPFQ EBC WRW1 WRW0 RDW1 RDW0 CW1 CW0
Table 28. Number of PFQ Clocks Required to Optimize Bus Transfer Rate
Code Data READ Data WRITE Data
PFQ Clock
Frequency
3V(1) 5V(1) 3V(1) 5V(1) 3V(1) 5V(1)
25-40MHz 5 4 5 4 5 4
8-24MHz 3 3 4 4 4 4
Note: 1. VDD of the PSD Module
35/129
uPSD33XX
36/129
uPSD33XX
SUPERVISORY
There are four ways to invoke a reset and initialize Each RESET source will cause an internal reset
the uPSD33XX Devices: signal to be active. The CPU responds by execut-
■ Via the external RESET pin ing an internal reset and puts the internal registers
in a defined state. This internal reset is also routed
■ Via the internal LVR Block.
as an active low reset input to the PSD Module.
■ Via Watch Dog timer
RESET
Input Pin CPU
Noise &
CPU
Cancel PERI.
Clock
Sync
WDT
LVR S Q
R
Debug
10ms(1)
PSD_RST
Timer
"Active Low signal"
AI07849
37/129
uPSD33XX
WATCHDOG TIMER
The hardware watchdog timer (WDT) resets the SFR, and the Watchdog Key Register (WDKEY).
uPSD33XX Devices when it overflows. The WDT Since the WDKEY register is loaded with 55h after
is intended as a recovery method in situations reset, the Watchdog is disabled until it is enabled
where the CPU may be subjected to a software by the software.
upset. To prevent a system reset the timer must be
Watchdog Counter
reloaded in time by the application software. If the
The 24-bit counter runs on machine cycle (4 fOSC
processor suffers a hardware/software malfunc-
clocks) and has a WDT reset period of about 1.6
tion, the software will fail to reload the timer. This
seconds (see Figure 15). The 8th MSB of the
failure will result in a reset upon overflow thus pre- counter is loaded from the Watch Dog Timer Clear
venting the processor running out of control. Register (WDRST). By writing to the WDRST reg-
In the Idle Mode the watchdog timer and reset cir- ister, the user can change the WDT reset period.
cuitry remain active. The WDT consists of a 24-bit The 24-bit counter overflows when it reaches
counter, the Watchdog Timer RESET (WDRST) FFFFFFh.
WDTRST
AI07850
38/129
uPSD33XX
WDT Registers
WDTKEY Register
– When this SFR is written as #55h, the WDT is always set up a timer that will periodically exit
disabled. Otherwise, writing any other values Idle, service the WDT, and re-enter Idle
to the register will disable the WDT. Since the Mode.
reset value of WDTKEY is #55h, the WDT is WDTRST Register
disabled at reset. The WDT is disabled after
– When this SFR is written as a value, the value
the reset that is generated by the WDT
is loaded into the upper 8 bits of 24-bit
counter overflow.
counter in WDT. And, the lower 16 bits are
– When the WDT is disabled, the 24-bit counter cleared.
is cleared. Therefore, the new value of
– If the user write "WDTRST" by '04h, then the
WDTRST must be written into the 24-bit
value of the 24-bit counter changes from
counter after the WDT is enabled.
040000, 040001, 040002, ..., FFFFFF, then
– In Idle Mode, the oscillator continues to run. generates the WDT reset.
To prevent the WDT from resetting the
processor while in Idle, the user should
Table 30. WDKEY: Watchdog Timer Key Register (0AEH, Reset Value 55H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
WDKEY7 WDKEY6 WDKEY5 WDKEY4 WDKEY3 WDKEY2 WDKEY1 WDKEY0
Table 32. WDRST: Watchdog Timer Clear Register (0A6H, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
WDRST7 WDRST6 WDRST5 WDRST4 WDRST3 WDRST2 WDRST1 WDRST0
39/129
uPSD33XX
40/129
uPSD33XX
Mode 0. Putting either Timer into Mode 0 makes Mode 2. Mode 2 configures the Timer register as
it look like an 8048 Timer, which is an 8-bit Counter an 8-bit Counter (TL1) with automatic reload, as
with a divide-by-32 prescaler. Figure 16 shows the shown in Figure 17, page 42. Overflow from TL1
Mode 0 operation as it applies to Timer 1. not only sets TF1, but also reloads TL1 with the
In this mode, the Timer register is configured as a contents of TH1, which is preset with software.
13-bit register. As the count rolls over from all '1s' The reload leaves TH1 unchanged. Mode 2 oper-
to all '0s,' it sets the Timer Interrupt flag TF1. The ation is the same for Timer/Counter 0.
counted input is enabled to the Timer when Mode 3. Timer 1 in Mode 3 simply holds its count.
TR1 = 1 and either GATE = 0 or /INT1 = 1. (Setting The effect is the same as setting TR1 = 0.
GATE = 1 allows the Timer to be controlled by ex- Timer 0 in Mode 3 establishes TL0 and TH0 as two
ternal input /INT1 to facilitate pulse width mea- separate counters. The logic for Mode 3 on Timer
surements). TR1 is a control bit in the Special 0 is shown in Figure 18. TL0 uses the Timer 0 con-
Function Register TCON (TCON Control Regis- trol Bits: C/T, GATE, TR0, INT0, and TF0. TH0 is
ter). GATE is in TMOD (see Table 36 and Table locked into a timer function (counting machine cy-
37, page 43). cles) and takes over the use of TR1 and TF1 from
The 13-bit register consists of all 8 bits of TH1 and Timer 1. Thus, TH0 now controls the “Timer 1“In-
the lower 5 bits of TL1. The upper 3 bits of TL1 are terrupt.
indeterminate and should be ignored. Setting the Mode 3 is provided for applications requiring an
run flag does not clear the registers. extra 8-bit timer on the counter (see Figure 18,
Mode 0 operation is the same for the Timer 0 as page 42). With Timer 0 in Mode 3, an uPSD33XX
for Timer 1. Substitute TR0, TF0, and /INT0 for the Devices can look like it has three Timer/Counters.
corresponding Timer 1 signals in Figure 16. There When Timer 0 is in Mode 3, Timer 1 can be turned
are two different GATE Bits, one for Timer 1 and on and off by switching it out of and into its own
one for Timer 0. Mode 3, or can still be used by the serial port as a
Mode 1. Mode 1 is the same as Mode 0, except baud rate generator, or in fact, in any application
that the Timer register is being run with all 16 bits. not requiring an interrupt.
fOSC ÷ 12
C/T = 0 TL1 TH1
(8 bits) TF1 Interrupt
(5 bits)
T1 pin C/T = 1
Control
TR1
Gate
INT1 pin
AI06622
41/129
uPSD33XX
fOSC ÷ 12
C/T = 0 TL1
TF1 Interrupt
(8 bits)
T1 pin C/T = 1
Control
TR1
Gate
INT1 pin
TH1
(8 bits)
AI06623
fOSC ÷ 12
C/T = 0 TL0
TF0 Interrupt
(8 bits)
T0 pin C/T = 1
Control
TR0
Gate
INT0 pin
TH0
fOSC ÷ 12 TF1 Interrupt
(8 bits)
Control
TR1 AI06624
42/129
uPSD33XX
Timer 2
Like Timers 0 and 1, Timer 2 can operate as either terrupt. The Capture Mode is illustrated in Figure
an event timer or as an event counter. This is se- 19, page 45.
lected by Bit C/T2 in the special function register In the Auto-reload Mode, there are again two op-
T2CON. It has three operating modes: capture, tions, which are selected by bit EXEN2 in T2CON
autoload, and baud rate generator, which are se- (see Table 40, page 45). If EXEN2 = 0, then when
lected by bits in the T2CON as shown in Table 38 Timer 2 rolls over it not only sets TF2 but also
and Table 39, page 44. In the Capture Mode there causes the Timer 2 registers to be reloaded with
are two options which are selected by Bit EXEN2 the 16-bit value in registers RCAP2L and
in T2CON. If EXEN2 = 0, then Timer 2 is a 16-bit RCAP2H, which are preset with software. If
timer or counter which upon overflowing sets Bit EXEN2 = 1, then Timer 2 still does the above, but
TF2, the Timer 2 Overflow Bit, which can be used with the added feature that a 1-to-0 transition at
to generate an interrupt. If EXEN2 = 1, then Timer external input T2EX will also trigger the 16-bit re-
2 still does the above, but with the added feature load and set EXF2. The Auto-reload Mode is illus-
that a 1-to-0 transition at external input T2EX trated in Standard Serial Interface (UART) Figure
causes the current value in the Timer 2 registers, 20, page 46. The Baud Rate Generation Mode is
TL2 and TH2, to be captured into registers selected by (RCLK, RCLK1)=1 and/or (TCLK,
RCAP2L and RCAP2H, respectively. In addition, TCLK1)=1. It will be described in conjunction with
the transition at T2EX causes Bit EXF2 in T2CON the serial port.
to be set, and EXF2 like TF2 can generate an in-
43/129
uPSD33XX
Table 38. T2CON: Timer/Counter 2 Control Register (C8H, Reset Value 00H))
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
TF2 EXF2 RCLK TCLK EXEN2 TR2 C/T2 CP/RL2
Capture/Reload flag. When set, capture will occur on negative transition of T2EX if
EXEN2=1. When cleared, auto-reload will occur either with TImer 2 overflows, or
0 CP/RL2
negative transitions of T2EX when EXEN2=1. When either (RCLK, RCLK1)=1 or (TCLK,
TCLK1)=1, this bit is ignored, and timer is forced to auto-reload on Timer 2 overflow
Note: 1. The RCLK1 and TCLK1 Bits in the PCON Register control UART1, and have the same function as RCLK and TCLK.
44/129
uPSD33XX
fOSC ÷ 12
C/T2 = 0 TL2 TH2
TF2
(8 bits) (8 bits)
T2 pin C/T2 = 1
Control
TR2
Capture Timer 2
Interrupt
RCAP2L RCAP2H
Transition
Detector
Control
EXEN2
AI06625
45/129
uPSD33XX
fOSC ÷ 12
C/T2 = 0 TL2 TH2
TF2
(8 bits) (8 bits)
T2 pin C/T2 = 1
Control
TR2
Reload Timer 2
Interrupt
RCAP2L RCAP2H
Transition
Detector
Control
EXEN2
AI06626
46/129
uPSD33XX
47/129
uPSD33XX
48/129
uPSD33XX
Baud Rates. The baud rate in Mode 0 is fixed: The Baud Rate Generator Mode is similar to the
Mode 0 Baud Rate = fOSC / 12 Auto-reload Mode, in that a roll over in TH2 causes
the Timer 2 registers to be reloaded with the 16-bit
The baud rate in Mode 2 depends on the
value in registers RCAP2H and RCAP2L, which
value of Bit SMOD = 0 (which is the value on are preset with software.
reset), the baud rate is 1/64 the oscillator
frequency. If SMOD = 1, the baud rate is 1/32 Now, the baud rates in Modes 1 and 3 are deter-
the oscillator frequency. mined at Timer 2’s overflow rate as follows:
Mode 2 Baud Rate = (2SMOD / 64) x fOSC Mode 1,3 Baud Rate =
In the uPSD33XX Devices, the baud rates in Timer 2 Overflow Rate / 16
Modes 1 and 3 are determined by the Timer The timer can be configured for either “timer” or
1 overflow rate. “counter” operation. In the most typical applica-
Using Timer 1 to Generate Baud Rates. When tions, it is configured for “timer” operation (C/T2 =
Timer 1 is used as the baud rate generator, the 0). “Timer” operation is a little different for Timer 2
baud rates in Modes 1 and 3 are determined by when it's being used as a baud rate generator. In
the Timer 1 overflow rate and the value of SMOD this case, the baud rate is given by the formula:
as follows: Mode 1,3 Baud Rate =
Mode 1,3 Baud Rate = fOSC/(32 x [65536 – (RCAP2H, RCAP2L)]
(2SMOD / 32) x (Timer 1 overflow rate) where (RCAP2H, RCAP2L) is the content of
The Timer 1 Interrupt should be disabled in this RC2H and RC2L taken as a 16-bit unsigned inte-
application. The Timer itself can be configured for ger.
either “timer” or “counter” operation, and in any of Timer 2 also may be used as the Baud Rate Gen-
its 3 running modes. In the most typical applica- erating Mode. This mode is valid only if RCLK +
tions, it is configured for “timer” operation, in the TCLK = 1 in T2CON or in PCON.
Auto-reload Mode (high nibble of TMOD = 0010B).
In that case the baud rate is given by the formula: Note: A roll-over in TH2 does not set TF2, and will
not generate an interrupt. Therefore, the Timer In-
Mode 1,3 Baud Rate = terrupt does not have to be disabled when Timer 2
(2SMOD / 32) x (fOSC / (12 x [256 – (TH1)])) is in the Baud Rate Generator Mode.
One can achieve very low baud rates with Timer 1 Note: If EXEN2 is set, a 1-to-0 transition in T2EX
by leaving the Timer 1 Interrupt enabled, and con- will set EXF2 but will not cause a reload from
figuring the Timer to run as a 16-bit timer (high nib- (RCAP2H, RCAP2L) to (TH2, TL2). Thus when
ble of TMOD = 0001B), and using the Timer 1 Timer 2 is in use as a baud rate generator, T2EX
Interrupt to do a 16-bit software reload. Figure 16, can be used as an extra external interrupt, if de-
page 41 lists various commonly used baud rates sired.
and how they can be obtained from Timer 1. Note: When Timer 2 is running (TR2 = 1) in “timer”
Using Timer/Counter 2 to Generate Baud function in the Baud Rate Generator Mode, one
Rates. In the uPSD33XX Devices, Timer 2 select- should not try to READ or WRITE TH2 or TL2. Un-
ed as the baud rate generator by setting TCLK der these conditions the timer is being increment-
and/or RCLK (see Figure 16, page 41, Timer/ ed every state time, and the results of a READ or
Counter 2 Control Register). WRITE may not be accurate.
Note: The baud rate for transmit and receive can The RC registers may be read, but should not be
be simultaneously different. Setting RCLK and/or written to, because a WRITE might overlap a re-
TCLK puts Timer into its Baud Rate Generator load and cause WRITE and/or reload errors.
Mode. Turn the timer off (clear TR2) before accessing the
The RCLK and TCLK Bits in the T2CON register Timer 2 or RC registers, in this case.
configure UART0. The RCLK1 and TCLK1 Bits in
the PCON register configure UART1.
49/129
uPSD33XX
SIRClk TxD1-IrDA
IrDA
UART1 IrDA Transceiver
Interface RxD1-IrDA
TxD
RxD
uPSD33XX
AI07851
Table 44. IRDACON Register Bit Definition (CEH, Reset Value 0FH)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
– IRDAEN PULSE CDIV4 CDIV3 CDIV2 CDIV1 CDIV0
50/129
uPSD33XX
40.0MHz 22 1.8181MHz
33.0MHz 18 1.8333MHz
30.0MHz 16 1.8750MHz
24.0MHz 13 1.8461MHz
16.0MHz 9 1.7777MHz
12.0MHz 7 1.7142MHz
Note: 1. fSIRCLK at 1.8342MHz is needed to generate the 1.627µs pulse.
51/129
uPSD33XX
I2C INTERFACE
There is a serial I2C port implemented in the These functions are controlled by the I2C SFRs:
uPSD33XX Devices. The serial port supports the S1CON: the Control register - control of byte han-
twin line I2C -bus and consists of a data line (SDA) dling and the operation of 4 mode
and a clock line (SCL). Depending on the configu-
ration, the SDA and SCL lines may require pull-up S1STA: the Status register - contents of its register
may also be used as a vector to various service
resistors.
routines.
The system is unique because data transport,
S1DAT: Data Shift register.
clock generation, address recognition, and bus
control arbitration are all controlled by hardware. S1ADR: Slave Address register. Slave address
The I2C serial I/O has complete autonomy in byte recognition is performed by On-Chip Hardware.
handling and operates in 4 modes: Table 49, page 53 shows the divisor values and
■ Master transmitter the I2C bit rate for some common fOSC frequen-
cies.
■ Master receiver
■ Slave transmitter
■ Slave receiver
Internal Bus
Arbitration + Sync. Logic
AI07852
Table 47. Serial Control Register S1CON (DCH, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
CR2 ENI1 STA STO ADDR AA CR1 CR0
52/129
uPSD33XX
START flag. When this bit is set, the SIO H/W checks the status of the I2C bus and
generates a START condition if the bus is free. If the bus is busy, the SIO will generate a
repeated START condition when this bit is set.
5 STA When a START condition is detected on the I2C Bus, the I2C hardware clears the STA
flag.
Note: If this bit is set during an interrupt service, the START condition occurs after the
interrupt service.
STOP flag. With this bit set while in Master Mode a STOP condition is generated.
When a STOP condition is detected on the I2C bus, the I2C hardware clears the STO
4 STO flag.
Note: If this bit is set during an interrupt service, the STOP condition occurs after the
interrupt service.
3 ADDR This bit is set when address byte was received. Must be cleared with software.
Acknowledge enable signal. If this bit is set, an acknowledge (low level to SDA is
returned during the acknowledge clock pulse on the SCL line when:
■ Own slave address is received;
2 AA ■ A data byte is received while the device is programmed to be a Master Receiver;
■ A data byte is received while the device is a selected Slave Receiver; and
■ When this bit is reset, no acknowledge is returned.
SIO release SDA line as high during the acknowledge clock pulse.
These two bits, along with the CR2 Bit determine the serial clock frequency when SIO is
1, 0 CR1, CR0
in the Master Mode.
Table 49. Selection of the Serial Clock Frequency SCL in Master Mode
Bit Rate (kHz) @ fOSC
CR2 CR1 CR0 fOSC Divisor
12MHz 24MHz 36MHz 40MHz
53/129
uPSD33XX
Table 50. Serial Status Register S1STA (DDH, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
GC STOP INTR TX_MODE BBUSY BLOST ACK_REP SLV
Table 52. Data Shift Register S1DAT (DEH, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
S1DAT7 S1DAT6 S1DAT5 S1DAT4 S1DAT3 S1DAT2 S1DAT1 S1DAT0
54/129
uPSD33XX
Table 54. Start/Stop Hold Time Detection Register S1SETUP (DBH, Reset Value 00H)
Bit 7 Bit 6 - Bit 0
Enable S1SETU Bit 6 - 0 specify the number of sample clocks
55/129
uPSD33XX
SPI
Tx[7:0] S PIS EL
S PITDR
Tx_Shift_R eg S PITXD
7 6 5 4 3 2 1 0
Rx_Shift_R eg S PIR XD
7 6 5 4 3 2 1 0
Rx[7:0] S PIC LK
S PIR D R
S C LKDIV
fOS C
Clock Divider
AI07853
56/129
uPSD33XX
Table 58. SPICON0 (Control Register 0) Details (D6H, Reset Value 00H)
BIT SYMBOL RW Definition
7 – Reserved
Transmitter Enable
6 TE RW 0 = Transmitter is disabled
1 = Transmitter is enabled
Receiver Enable
5 RE RW 0 = Receiver is disabled
1 = Receiver is enabled
SPI Enable
4 SPIEN RW 0 = SPI is disabled
1 = SPI is enabled
Slave Selection
3 SSEL RW 0 = Slave Select output is disabled
1 = Slave Select output is enabled on Port pin P1.7 (or P4.7)
First LSB
2 FLSB RW 0 = Transfer the most significant bit (MSB) first
1 = Transfer the least significant bit (LSB) first
Sampling Polarity
0 = Sample transfer data at the falling edge of clock (SPICLK is '0'
1 SPO RW when idle)
1 = Sample transfer data at the rising edge of clock (SPICLK is '1'
when idle)
0 – Reserved
57/129
uPSD33XX
Table 59. SPICON1 (Control Register 1) Details (D7H, Reset Value 00H)
BIT SYMBOL RW Definition
7-4 – Reserved
Transmission End Interrupt Enable
3 TEIE RW 0 = SPI Transmission end Interrupt Disable
1 = SPI Transmission end Interrupt Enable
Receive Overrun Interrupt Enable
2 RORIE RW 0 = Receive Overrun Interrupt Disable
1 = Receive Overrun Interrupt Enable
Transmission Interrupt Enable
1 TIE RW 0 = SPITDR empty interrupt Disable
1 = SPITDR Empty interrupt Enable
Reception Interrupt Enable
0 RIE RW 0 = SPIRDR full interrupt Disable
1 = SPIRDR full interrupt Enable
Table 60. SPICLKD (SPI Prescaler) Register (D2H, Reset Value 04H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
DIV128 DIV64 DIV32 DIV16 DIV8 DIV4 – –
T0 = No division
6 DIV64 RW
1 = Divide fOSC clock by 64
0 = No division
5 DIV32 RW
1 = Divide fOSC clock by 32
0 = No division
4 DIV16 RW
1 = Divide fOSC clock by 16
0 = No division
3 DIV8 RW
1 = Divide fOSC clock by 8
0 = No division
2 DIV4 RW
1 = Divide fOSC clock by 4
58/129
uPSD33XX
The SPI serial clock frequency in Master Mode is guaranteed valid at the fall of serial clock. When
the fOSC clock divided by the SPICLKD divisors. SPO is set to '1,' the data bit is placed on the com-
The bits in the SPICLKD register can be set to pro- munication line from one falling edge of serial
vide divisor values of multiple of 4: 4, 8, 12, 16, clock to the next and is guaranteed valid at the rise
20… to 252. of serial clock.
Operation The FLSB Bit determines the format of 8-bit serial
The SPI transmitter and receiver share the same data transfer. When FLSB is '0,' the 8-bit data is
clock but are independent, so full-duplex commu- transferred in order from MSB (first) to LSB (last).
nication is possible. The transmitter and receiver When FLSB is '1,' the data is transferred in order
are also double-buffered, so continuous transmit- from LSB (first) to MSB (last).
ting or receiving (back-to-back transfer) is possible The bit rate requires the programming of the clock
by reading or writing data while transmitting or re- divider register SPICLKD. The value of SPICLKD
ceiving is in progress. divides the fOSC clock to provide the serial transfer
SPI Configuration clock output -SPICLK.
The SPI is reset by the CPU Reset. Control regis- The SPICON1 and SPICON0 have SPI Transmit-
ter SPICON0 needs to be programmed to decide ter Enable (TE) and Receiver Enable (RE) and In-
several operation parameters. The SPO Bit deter- terrupt Enable Bits (TEIE, RORIE,TIE, RIE). If TE
mines clock polarity. When SPO is set to '0,' the is disabled, both transmitting and receiving are
data bit is placed on the communication line from disabled because SPICLK is forced to LOW
one rising edge of serial clock to the next and is (SPO=0) or HIGH (SPO=1).
59/129
uPSD33XX
1 frame
SPICLK
(SPO=0)
SPICLK
(SPO=1)
TISF
TEISF
BUSY
SPISEL
SPIINTR
60/129
uPSD33XX
Receive Operation
In receiving serial data, the SPI operates as fol- When the check fails (i.e., the RIS flag is '1' or
lows: the last received data in SPIRDR is not read
1. The SPI generates serial clock and until the 8th bit of currently received data is
synchronizes internally. received in the RSR), the RORIS flag is set to '1'
and received data in the RSR is lost. When the
2. Received data is stored in the RSR (Receive
RORIS flag is set to '1' and the RORIE Bit is set
Shift Register) in order from MSB to LSB
to '1' at SPICON1, the subsequent transmit and
(FLSB = 0) or from LSB to MSB (FLSB = 1). receive operations are disabled.
After receiving the data, the SPI checks to see if
the RIS flag is '0' or not. 3. If the RIE Bit in SPICON1 is set to '1' and the
RIS flag is set to '1,' the SPIRDR Full Interrupt is
If this check passes, the received data in the
requested.
RSR is stored in SPIRDR and the RIS flag is set
to 1. If the RORIE Bit in SPICON1 is set to '1' and the
RORIS flag is set to '1,' the Receive Overrun
Interrupt is requested.
1 frame
SPICLK
(SPO=0)
SPICLK
(SPO=1)
RISF
RORIS
BUSY
SPIINTR
61/129
uPSD33XX
AVREF
AVREF
P1.0
ADC0
P1.1
ADC1
P1.2 10-BIT SAR ADC
ADC2
P1.3 ANALOG
ADC3 MUX
P1.4
ADC4
P1.5 CONTROL ADC OUT - 10 BITS
ADC5
P1.6
ADC6
P1.7
ADC7 SELECT
ADAT1
ACON REG REG ADAT 0 REG
AI07856
62/129
uPSD33XX
63/129
uPSD33XX
P4.3/ECI
EOVFI
EN_PCA
AI07857
64/129
uPSD33XX
TCM Mode
A9, BD, TCMMODE0 TCMMODE3
■ Capture, Compare, and Toggle Enable
AA, BE, TCMMODE1 TCMMODE4 RW
Interrupts
AB BF TCMMODE2 TCMMODE5
■ PWM Mode Select.
AC C1 CAPCOML0 CAPCOML3
RW Capture/Compare registers of TCM0
AD C2 CAPCOMH0 CAPCOMH3
AF C3 CAPCOML1 CAPCOML4
RW Capture/Compare registers of TCM1
B1 C4 CAPCOMH1 CAPCOMH4
B2 C5 CAPCOML2 CAPCOML5
RW Capture/Compare registers of TCM2
B3 C6 CAPCOMH2 CAPCOMH5
The 8-bit register to program the PWM
B4 C7 PWMF0 PWMF1 RW frequency. This register is used for
programmable, 8-bit PWM Mode only.
65/129
uPSD33XX
ENABLE
16-bit COMPARATOR
MATCH
8 8
PCACHm PCACLm
16-bit up Timer/Counter
WRITE to
CAPCOMLn AI07858
Note: m = 0: n = 0, 1, or 2
m = 1: n = 3, 4, or 5
CAPCOMHn
CAPCOMLn
OVERFLOW R CLR Q
PCACLm
AI07859
Note: m = 0: n = 0, 1, or 2
m = 1: n = 3, 4, or 5
66/129
uPSD33XX
PWMFm CAPCOMHn
8 8
PWMFm = PCACLm
PCACHm CAPCOMLn
MATCH SET
ENABLE 8-bit COMPARATORm ENABLE 8-bit COMPARATORn
S Q CEXn
8 R Q
CLR
PCACLm
CLR
AI07860
Note: m = 0: n = 0, 1, or 2
m = 1: n = 3, 4, or 5
67/129
uPSD33XX
Table 70. PCA0 Control Register PCACON0 (0A4H, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
EN-ALL EN_PCA EOVFI PCAIDLE – – CLK_SEL[1:0]
Table 71. PCA1 Control Register PCACON0 (0BCH, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
EN-ALL EN_PCA EOVFI PCAIDLE – – CLK_SEL[1:0]
Table 73. PCA Status Register PCASTA (0A5H, Reset Value 00H)
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
OVF1 INTF5 INTF4 INTF3 OVF0 INTF2 INTF1 INTF0
68/129
uPSD33XX
TCM Interrupts
There are 8 TCM interrupts: 6 match or capture in- ly. If they do, the CPU has to read the interrupt
terrupts and two counter overflow interrupts. The 8 flags and determine which one to serve. The soft-
interrupts are “ORed” as one PCA interrupt to the ware has to clear the interrupt flag in the Status
CPU. By the nature of PCA application, it is unlike- Register after serving the interrupt.
ly that many of the interrupts occur simultaneous-
69/129
uPSD33XX
70/129
uPSD33XX
PSD MODULE
■ The PSD Module provides configurable Examples include state machines, loadable
Program and Data memories to the Turbo 8032 shift registers, and loadable counters.
MCU Module. In addition, it has its own set of I/ ■ Decode PLD (DPLD) that decodes address for
O ports and a PLD with 16 macrocells for selection of memory blocks in the PSD Module.
general logic implementation.
■ Configurable I/O ports (Port A,B,C and D) that
■ Ports A,B,C, and D are general purpose can be used for the following functions:
programmable I/O ports that have a port
– MCU I/Os
architecture which is different from the I/O ports
in the MCU Module. – PLD I/Os
■ The PSD Module communicates with the MCU – Latched MCU address output
Module through the internal address, data bus
(A0-A15, D0-D7) and control signals (RD, WR, – Special function I/Os.
PSEN, ALE, RESET). The user defines the – I/O ports may be configured as open-drain
Decoding PLD in the PSDsoft Development outputs.
Tool and can map the resources in the PSD
Module to any program or data address space. ■ Built-in JTAG compliant serial port allows full-
Figure 31, page 72 shows the functional blocks chip In-System Programmability (ISP). With it,
in the PSD Module. you can program a blank device or reprogram a
device in the factory or the field.
Functional Overview
■ Internal page register that can be used to
■ 64K, 128K, or 256K bytes Flash memory. This
expand the 8032 MCU Module address space
is the main Flash memory. It is divided into by a factor of 256.
equally-sized blocks that can be accessed with
user-specified addresses. ■ Internal programmable Power Management
Unit (PMU) that supports a low-power mode
■ Secondary 16K or 32K bytes Flash boot
called Power-down Mode. The PMU can
memory. It is divided into equally-sized blocks automatically detect a lack of the 8032 CPU
that can be accessed with user-specified core activity and put the PSD Module into
addresses. This secondary memory brings the Power-down Mode.
ability to execute code and update the main
Flash concurrently. ■ Erase/WRITE cycles:
■ 2K, 8K, or 32K bytes SRAM. The SRAM’s – Flash memory - 100,000 minimum
contents can be protected from a power failure – PLD - 1,000 minimum
by connecting an external battery.
– Data Retention: 15 year minimum (for Main
■ CPLD with 16 Output Micro Cells (OMCs} and
Flash memory, Boot, PLD and Configuration
20 Input Micro Cells (IMCs). The CPLD may be
used to efficiently implement a variety of logic bits)
functions for internal and external control.
71/129
72/129
ADDRESS/DATA/CONTROL BUS
8032 Bus
uPSD33XX
PLD
INPUT
BUS
PAGE
REGISTER PRIMARY
EMBEDDED FLASH MEMORY
ALGORITHM
8
WR_, RD_, POWER
MANGMT VSTDBY
PSEN_, ALE,
RESET_, SECTOR UNIT (PC2)
SECONDARY
A0-A15 SELECTS NON-VOLATILE MEMORY
BUS FLASH DECODE
Interface (BOOT OR DATA)
PLD (DPLD)
73
SECTOR
SELECTS
Figure 31. PSD Module Block Diagram
PORT
20 INPUT MACROCELLS B
CLKIN PORT A ,B & C
PROG.
PORT PC0 – PC7
PROG.
PORT PD1 – PD2
PLD, CONFIGURATION JTAG
CLKIN SERIAL PORT
& FLASH MEMORY
(PD1) D
LOADER CHANNEL
AI07872
uPSD33XX
73/129
uPSD33XX
74/129
uPSD33XX
75/129
uPSD33XX
76/129
uPSD33XX
Figure 32. Data Polling Flowchart Figure 33. Data Toggle Flowchart
START START
NO YES
NO DQ5 NO DQ5
=1 =1
YES YES
NO YES
AI01369B AI01370B
77/129
uPSD33XX
Unlock Bypass. The Unlock Bypass instructions The status of the internal timer can be monitored
allow the system to program bytes to the Flash through the level of the Erase Time-out Flag Bit
memories faster than using the standard Program (DQ3). If the Erase Time-out Flag Bit (DQ3) is '0,'
instruction. The Unlock Bypass Mode is entered the Sector Erase instruction has been received
by first initiating two Unlock cycles. This is followed and the time-out period is counting. If the Erase
by a third WRITE cycle containing the Unlock By- Time-out Flag Bit (DQ3) is '1,' the time-out period
pass code, 20h (as shown in Table 80). has expired and the embedded algorithm is busy
The Flash memory then enters the Unlock Bypass erasing the Flash memory sector(s). Before and
Mode. A two-cycle Unlock Bypass Program in- during Erase time-out, any instruction other than
struction is all that is required to program in this Suspend Sector Erase and Resume Sector Erase
mode. The first cycle in this instruction contains instructions abort the cycle that is currently in
the Unlock Bypass Program code, A0h. The sec- progress, and reset the device to READ Mode.
ond cycle contains the program address and data. During a Sector Erase, the memory status may be
Additional data is programmed in the same man- checked by reading the Error Flag Bit (DQ5), the
ner. These instructions dispense with the initial Toggle Flag Bit (DQ6), and the Data Polling Flag
two Unlock cycles required in the standard Pro- Bit (DQ7), as detailed in Programming Flash Mem-
gram instruction, resulting in faster total Flash ory, page 77.
memory programming. During execution of the Erase cycle, the Flash
During the Unlock Bypass Mode, only the Unlock memory accepts only RESET and Suspend Sec-
Bypass Program and Unlock Bypass Reset Flash tor Erase instructions. Erasure of one Flash mem-
instructions are valid. ory sector may be suspended, in order to read
To exit the Unlock Bypass Mode, the system must data from another Flash memory sector, and then
issue the two-cycle Unlock Bypass Reset Flash in- resumed.
struction. The first cycle must contain the data Suspend Sector Erase. When a Sector Erase
90h; the second cycle the data 00h. Addresses are cycle is in progress, the Suspend Sector Erase in-
Don’t Care for both cycles. The Flash memory struction can be used to suspend the cycle by writ-
then returns to READ Mode. ing 0B0h to any address when an appropriate
Erasing Flash Memory Sector Select (FS0-FS7 or CSBOOT0-CSBOOT3)
is High. (See Table 80). This allows reading of
Flash Bulk Erase. The Flash Bulk Erase instruc-
data from another Flash memory sector after the
tion uses six WRITE operations followed by a
Erase cycle has been suspended. Suspend Sec-
READ operation of the status register, as de-
tor Erase is accepted only during an Erase cycle
scribed in Table 80. If any byte of the Bulk Erase and defaults to READ Mode. A Suspend Sector
instruction is wrong, the Bulk Erase instruction
Erase instruction executed during an Erase time-
aborts and the device is reset to the READ Flash
out period, in addition to suspending the Erase cy-
memory status. cle, terminates the time out period.
During a Bulk Erase, the memory status may be The Toggle Flag Bit (DQ6) stops toggling when the
checked by reading the Error Flag Bit (DQ5), the
internal logic is suspended. The status of this bit
Toggle Flag Bit (DQ6), and the Data Polling Flag
must be monitored at an address within the Flash
Bit (DQ7), as detailed in Programming Flash Mem-
memory sector being erased. The Toggle Flag Bit
ory, page 77. The Error Flag Bit (DQ5) returns a '1' (DQ6) stops toggling between 0.1µs and 15µs af-
if there has been an Erase Failure (maximum
ter the Suspend Sector Erase instruction has been
number of Erase cycles have been executed).
executed. The Flash memory is then automatically
It is not necessary to program the memory with set to READ Mode.
00h because the PSD Module automatically does If an Suspend Sector Erase instruction was exe-
this before erasing to 0FFh.
cuted, the following rules apply:
During execution of the Bulk Erase instruction, the
– Attempting to read from a Flash memory sector
Flash memory does not accept any instructions.
that was being erased outputs invalid data.
Flash Sector Erase. The Sector Erase instruc-
– Reading from a Flash sector that was not being
tion uses six WRITE operations, as described in erased is valid.
Table 80. Additional Flash Sector Erase codes
and Flash memory sector addresses can be writ- – The Flash memory cannot be programmed, and
ten subsequently to erase other Flash memory only responds to Resume Sector Erase and
sectors in parallel, without further coded cycles, if Reset Flash instructions (READ is an operation
the additional bytes are transmitted in a shorter and is allowed).
time than the time-out period of about 100µs. The – If a Reset Flash instruction is received, data in
input of a new Sector Erase code restarts the time- the Flash memory sector that was being erased
out period. is invalid.
78/129
uPSD33XX
Resume Sector Erase. If a Suspend Sector gram. This automatically protects selected sectors
Erase instruction was previously executed, the when the device is programmed through the JTAG
erase cycle may be resumed with this instruction. Port or a Device Programmer. Flash memory sec-
The Resume Sector Erase instruction consists of tors can be unprotected to allow updating of their
writing 030h to any address while an appropriate contents using the JTAG Port or a Device Pro-
Sector Select (FS0-FS7 or CSBOOT0-CSBOOT3) grammer. The MCU can read (but cannot change)
is High. (See Table 80.) the sector protection bits.
Specific Features Any attempt to program or erase a protected Flash
Flash Memory Sector Protect. Each primary memory sector is ignored by the device. The Verify
and secondary Flash memory sector can be sepa- operation results in a READ of the protected data.
rately protected against Program and Erase cy- This allows a guarantee of the retention of the Pro-
cles. Sector Protection provides additional data tection status.
security because it disables all Program or Erase The sector protection status can be read by the
cycles. This mode can be activated through the MCU through the Flash memory protection regis-
JTAG Port or a Device Programmer. ters (in the CSIOP block). See Table 82 and Table
Sector protection can be selected for each sector 83.
using the PSDsoft Express Configuration pro-
Table 83. Sector Protection/Security Bit Definition – Secondary Flash Protection Register
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Security_Bit not used not used not used Sec3_Prot Sec2_Prot Sec1_Prot Sec0_Prot
Note: Bit Definitions:
Sec<i>_Prot 1 = Secondary Flash memory Sector <i> is write-protected.
Sec<i>_Prot 0 = Secondary Flash memory Sector <i> is not write-protected.
Security_Bit 0 = Security Bit in device has not been set; 1 = Security Bit in device has been set.
79/129
uPSD33XX
Reset Flash. The Reset Flash instruction con- contents of the SRAM are retained in the event of
sists of one WRITE cycle (see Table 80). It can a power loss. The contents of the SRAM are re-
also be optionally preceded by the standard two tained so long as the battery voltage remains at 2V
WRITE decoding cycles (writing AAh to 555h and or greater. If the supply voltage falls below the bat-
55h to AAAh). It must be executed after: tery voltage, an internal power switch-over to the
– Reading the Flash Protection Status battery occurs.
– An Error condition has occurred (and the device PC4 can be configured as an output that indicates
has set the Error Flag Bit (DQ5) to '1' during a when power is being drawn from the external bat-
Flash memory Program or Erase cycle. tery. Battery-on Indicator (VBATON, PC4) is High
with the supply voltage falls below the battery volt-
The Reset Flash instruction puts the Flash memo-
age and the battery on Voltage Stand-by (VSTBY,
ry back into normal READ Mode. If an Error condi-
PC2) is supplying power to the internal SRAM.
tion has occurred (and the device has set the Error
Flag Bit (DQ5) to '1' the Flash memory is put back SRAM Select (RS0), Voltage Stand-by (VSTBY,
into normal READ Mode within 25µs of the Reset PC2) and Battery-on Indicator (VBATON, PC4) are
Flash instruction having been issued. The Reset all configured using PSDsoft Express Configura-
Flash instruction is ignored when it is issued dur- tion.
ing a Program or Bulk Erase cycle of the Flash Sector Select and SRAM Select
memory. The Reset Flash instruction aborts any Sector Select (FS0-FS7, CSBOOT0-CSBOOT3)
on-going Sector Erase cycle, and returns the and SRAM Select (RS0) are all outputs of the
Flash memory to the normal READ Mode within DPLD. They are setup by writing equations for
25µs. them in PSDsoft Express. The following rules ap-
Reset (RESET) Signal. A pulse on Reset (RE- ply to the equations for these signals:
SET) aborts any cycle that is in progress, and re- 1. Primary Flash memory and secondary Flash
sets the Flash memory to the READ Mode. When memory Sector Select signals must not be larg-
the reset occurs during a Program or Erase cycle, er than the physical sector size.
the Flash memory takes up to 25µs to return to the
2. Any primary Flash memory sector must not be
READ Mode. It is recommended that the Reset
mapped in the same memory space as another
(RESET) pulse (except for Power-on RESET, as
Flash memory sector.
described on page 100) be at least 25µs so that
the Flash memory is always ready for the MCU to 3. A secondary Flash memory sector must not be
retrieve the bootstrap instructions after the reset mapped in the same memory space as another
cycle is complete. secondary Flash memory sector.
SRAM 4. SRAM, I/O, and Peripheral I/O spaces must not
overlap.
The SRAM is enabled when SRAM Select (RS0)
from the DPLD is High. SRAM Select (RS0) can 5. A secondary Flash memory sector may overlap
contain up to two product terms, allowing flexible a primary Flash memory sector. In case of over-
memory mapping. lap, priority is given to the secondary Flash
memory sector.
The SRAM can be backed up using an external
battery. The external battery should be connected 6. SRAM, I/O, and Peripheral I/O spaces may
to Voltage Stand-by (VSTBY, PC2). If you have an overlap any other memory sector. Priority is giv-
external battery connected to the uPSD3200, the en to the SRAM, I/O, or Peripheral I/O.
80/129
uPSD33XX
Example. FS0 is valid when the address is in the changed by the MCU so that memory mapping
range of 8000h to BFFFh, CSBOOT0 is valid from can be changed on-the-fly.
8000h to 9FFFh, and RS0 is valid from 8000h to For example, you may wish to have SRAM and pri-
87FFh. Any address in the range of RS0 always mary Flash memory in the Data space at Boot-up,
accesses the SRAM. Any address in the range of and secondary Flash memory in the Program
CSBOOT0 greater than 87FFh (and less than space at Boot-up, and later swap the primary and
9FFFh) automatically addresses secondary Flash secondary Flash memories. This is easily done
memory segment 0. Any address greater than with the VM Register by using PSDsoft Express
9FFFh accesses the primary Flash memory seg- Configuration to configure it for Boot-up and hav-
ment 0. You can see that half of the primary Flash ing the MCU change it when desired. Table 84 de-
memory segment 0 and one-fourth of secondary scribes the VM Register.
Flash memory segment 0 cannot be accessed in
this example.
Figure 34. Priority Level of Memory and I/O
Note: An equation that defined FS1 to anywhere
in the range of 8000h to BFFFh would not be valid. Components in the PSD Module
Figure 34 shows the priority levels for all memory Highest Priority
components. Any component on a higher level can
overlap and has priority over any component on a
lower level. Components on the same level must Level 1
SRAM, I /O, or
not overlap. Level one has the highest priority and Peripheral I /O
level 3 has the lowest.
Level 2
Memory Select Configuration in Program and Secondary
Data Spaces. The MCU Core has separate ad- Non-Volatile Memory
dress spaces for Program memory and Data Level 3
memory. Any of the memories within the PSD Primary Flash Memory
Module can reside in either space or both spaces.
Lowest Priority AI02867D
This is controlled through manipulation of the VM
Register that resides in the CSIOP space.
The VM Register is set using PSDsoft Express to
have an initial value. It can subsequently be
81/129
uPSD33XX
Separate Space Mode. Program space is sepa- Combined Space Modes. The Program and
rated from Data space. For example, Program Se- Data spaces are combined into one memory
lect Enable (PSEN) is used to access the program space that allows the primary Flash memory, sec-
code from the primary Flash memory, while READ ondary Flash memory, and SRAM to be accessed
Strobe (RD) is used to access data from the sec- by either Program Select Enable (PSEN) or READ
ondary Flash memory, SRAM and I/O Port blocks. Strobe (RD). For example, to configure the prima-
This configuration requires the VM Register to be ry Flash memory in Combined space, Bits b2 and
set to 0Ch (see Figure 35). b4 of the VM Register are set to '1' (see Figure 36).
FS0-FS7
CS CS CS
OE OE OE
PSEN
RD
AI02869C
FS0-FS7
CS CS CS
OE OE OE
VM REG BIT 3
VM REG BIT 4
PSEN
VM REG BIT 1
VM REG BIT 2 RD
VM REG BIT 0
AI02870C
82/129
uPSD33XX
Page Register
The 8-bit Page Register increases the addressing If memory paging is not needed, or if not all 8 page
capability of the MCU Core by a factor of up to 256. register bits are needed for memory paging, then
The contents of the register can also be read by these bits may be used in the CPLD for general
the MCU. The outputs of the Page Register logic.
(PGR0-PGR7) are inputs to the DPLD decoder Figure 37 shows the Page Register. The eight flip-
and can be included in the Sector Select (FS0- flops in the register are connected to the internal
FS7, CSBOOT0-CSBOOT3), and SRAM Select data bus D0-D7. The MCU can write to or read
(RS0) equations. from the Page Register. The Page Register can be
accessed at address location CSIOP + E0h.
PAGE PLD
REGISTER AI05799
83/129
uPSD33XX
PLDS
The PLDs bring programmable logic functionality Table 85. DPLD and CPLD Inputs
to the uPSD. After specifying the logic for the No. of
PLDs in PSDsoft Express, the logic is pro- Input Source Input Name
Signals
grammed into the device and available upon Pow-
er-up. MCU Address Bus A15-A0 16
The PSD Module contains two PLDs: the Decode PSEN, RD, WR,
PLD (DPLD), and the Complex PLD (CPLD). MCU Control Signals 4
ALE
The DPLD performs address decoding for Select
RESET RST 1
signals for PSD Module components, such as
memory, registers, and I/O ports. Power-down PDN 1
The CPLD can be used for logic functions, such as Port A Input
loadable counters and shift registers, state ma- PA7-PA0 8
Macrocells(1)
chines, and encoding and decoding logic.
The Turbo Bit in PSD Module Port B Input
PB7-PB0 8
Macrocells
The PLDs can minimize power consumption by
switching off when inputs remain unchanged for Port C Input
PC2-4, PC7 4
an extended time of about 70ns. Resetting the Macrocells
Turbo Bit to '0' (Bit 3 of PMMR0) automatically Port D Inputs PD2-PD1 2
places the PLDs into standby if no inputs are
changing. Turning the Turbo Mode off increases Page Register PGR7-PGR0 8
propagation delays while reducing power con- Macrocell AB MCELLAB.FB7-
sumption. See POWER MANAGEMENT, page 96 Feedback FB0
8
for details on setting the Turbo Bit.
Macrocell BC MCELLBC.FB7-
8
Feedback FB0
Flash memory
Ready/Busy 1
Program Status Bit
Note: 1. These inputs are not available in the 52-pin package.
Figure 38. PLD Diagram
8
PAGE
DATA REGISTER
BUS
73 8
DECODE PLD PRIMARY FLASH MEMORY SELECTS
4
SECONDARY NON-VOLATILE MEMORY SELECTS
1
SRAM SELECT
1
CSIOP SELECT
2
PERIPHERAL SELECTS
PLD INPUT BUS
16 OUTPUT MACROCELL FEEDBACK DIRECT MACROCELL ACCESS FROM MCU DATA BUS
TO PORT B OR C
20 INPUT MACROCELL
(PORT A,B,C) 2
2 PORT D INPUTS
AI06600
84/129
uPSD33XX
3 CSBOOT 0
3 CSBOOT 1
3 CSBOOT 2
3 CSBOOT 3
(INPUTS) 3
FS0
I /O PORTS (PORT A,B,C)1 (20)
3
FS1
MCELLAB.FB [7:0] (FEEDBACKS) (8)
3
FS2
MCELLBC.FB [7:0] (FEEDBACKS) (8)
3 8 PRIMARY FLASH
FS3
PGR0 -PGR7 (8) MEMORY SECTOR
3 SELECTS
FS4
A[15:0]2 (16)
3
FS5
PD[2:1] (2)
3
FS6
PDN (APD OUTPUT) (1)
3
FS7
PSEN, RD, WR, ALE2 (4)
2
RESET (1)
2 RS0
SRAM SELECT
RD_BSY (1)
1 CSIOP I/O DECODER
SELECT
1 PSEL0
PERIPHERAL I/O
1 PSEL1 MODE SELECT
AI06601
85/129
uPSD33XX
FROM OTHER
MACROCELLS
TO OTHER I/O PORTS
PRODUCT TERMS
MACROCELL CPLD OUTPUT
OUT TO
MCU
POLARITY
MUX
SELECT
PR DI LD
D/T Q SELECT
PT
CLOCK CPLD PDR
D/T/JK FF COMB. OUTPUT INPUT
SELECT /REG
MUX
GLOBAL
PLD INPUT BUS
CLOCK SELECT
CK MACROCELL
TO
CL I/O PORT
CLOCK ALLOC. D Q
SELECT DIR
WR REG.
PT CLEAR
Q D
ALE G
AI06602
86/129
uPSD33XX
87/129
uPSD33XX
MASK
REG.
WR
PT DIRECTION
ALLOCATOR REGISTER
ENABLE (.OE)
PRESET(.PR) COMB/REG
AND ARRAY
SELECT
PT
PT
DIN PR
PLD INPUT BUS
CLKIN MUX
FEEDBACK (.FB)
AI06617
88/129
uPSD33XX
The OMC Mask Register. There is one Mask If the Output Macrocell (OMC) output is declared
Register for each of the two groups of eight Output as an internal node and not as a port pin output in
Macrocells (OMC). The Mask Registers can be the PSDabel file, the port pin can be used for other
used to block the loading of data to individual Out- I/O functions. The internal node feedback can be
put Macrocells (OMC). The default value for the routed as an input to the AND Array.
Mask Registers is 00h, which allows loading of the Input Macrocells (IMC)
Output Macrocells (OMC). When a given bit in a
The CPLD has 20 Input Macrocells (IMC), one for
Mask Register is set to a '1,' the MCU is blocked
from writing to the associated Output Macrocells each pin on Ports A and B, and 4 on Port C. The
architecture of the Input Macrocells (IMC) is
(OMC). For example, suppose McellAB0-
shown in Figure 42. The Input Macrocells (IMC)
McellAB3 are being used for a state machine. You
would not want a MCU write to McellAB to over- are individually configurable, and can be used as
write the state machine registers. Therefore, you a latch, register, or to pass incoming Port signals
prior to driving them onto the PLD input bus. The
would want to load the Mask Register for McellAB
outputs of the Input Macrocells (IMC) can be read
(Mask Macrocell AB) with the value 0Fh.
by the MCU through the internal data bus.
The Output Enable of the OMC. The Output
Macrocells (OMC) block can be connected to an I/ The enable for the latch and clock for the register
are driven by a multiplexer whose inputs are a
O port pin as a PLD output. The output enable of
product term from the CPLD AND Array or the
each port pin driver is controlled by a single prod-
uct term from the AND Array, ORed with the Direc- MCU Address Strobe (ALE). Each product term
tion Register output. The pin is enabled upon output is used to latch or clock four Input Macro-
cells (IMC). Port inputs 3-0 can be controlled by
Power-up if no output enable equation is defined
one product term and 7-4 by another.
and if the pin is declared as a PLD output in PSD-
soft Express.
OUTPUT
PT MACROCELLS BC
AND
AND ARRAY
MACROCELL AB
PLD INPUT BUS
I/O PIN
PT
PORT
DRIVER
MUX Q D PT
MUX ALE
D FF
FEEDBACK Q D
G
LATCH
INPUT MACROCELL
AI06603
89/129
uPSD33XX
ADDRESS ADDRESS
D Q PORT PIN
ALE OUTPUT
G MUX
MACROCELL OUTPUTS
EXT CS
READ MUX
P
OUTPUT
MCU DATA BUS
D SELECT
DATA IN
B
CONTROL REG.(1)
ENABLE OUT
D Q
WR
DIR REG.
D Q
WR
CPLD-INPUT
AI07873
90/129
uPSD33XX
The Port pin’s tri-state output driver enable is con- is configured as an output, the content of the Data
trolled by a two input OR gate whose inputs come Out Register drives the pin. When configured as
from the CPLD AND Array enable product term an input, the MCU can read the port input through
and the Direction Register. If the enable product the Data In buffer. See Figure 43, page 90.
term of any of the Array outputs are not defined Ports C and D do not have Control Registers, and
and that port pin is not defined as a CPLD output are in MCU I/O Mode by default. They can be used
in the PSDsoft, then the Direction Register has for PLD I/O if equations are written for them in PS-
sole control of the buffer that drives the port pin. Dabel.
The contents of these registers can be altered by PLD I/O Mode
the MCU. The Port Data Buffer (PDB) feedback
The PLD I/O Mode uses a port as an input to the
path allows the MCU to check the contents of the
CPLD’s Input Macrocells (IMC), and/or as an out-
registers.
put from the CPLD’s Output Macrocells (OMC).
Ports A, B, and C have embedded Input Macro- The output can be tri-stated with a control signal.
cells (IMC). The Input Macrocells (IMC) can be This output enable control signal can be defined
configured as latches, registers, or direct inputs to by a product term from the PLD, or by resetting the
the PLDs. The latches and registers are clocked corresponding bit in the Direction Register to '0.'
by Address Strobe (ALE) or a product term from The corresponding bit in the Direction Register
the PLD AND Array. The outputs from the Input must not be set to '1' if the pin is defined for a PLD
Macrocells (IMC) drive the PLD input bus and can input signal in PSDsoft. The PLD I/O Mode is
be read by the MCU. See Input Macrocell, page specified in PSDsoft by declaring the port pins,
89. and then writing an equation assigning the PLD I/
Port Operating Modes O to a port.
The I/O Ports have several modes of operation. Address Out Mode
Some modes can be defined using PSDsoft, some Address Out Mode can be used to drive latched
by the MCU writing to the Control Registers in MCU addresses on to the port pins. These port
CSIOP space, and some by both. The modes that pins can, in turn, drive external devices. Either the
can only be defined using PSDsoft must be pro- output enable or the corresponding bits of both the
grammed into the device and cannot be changed Direction Register and Control Register must be
unless the device is reprogrammed. The modes set to a '1' for pins to use Address Out Mode. This
that can be changed by the MCU can be done so must be done by the MCU at run-time. See Table
dynamically at run-time. The PLD I/O, Data Port, 89 for the address output pin assignments on
Address Input, and Peripheral I/O Modes are the Ports A and B for various MCUs.
only modes that must be defined before program-
ming the device. All other modes can be changed Peripheral I/O Mode
by the MCU at run-time. See Application Note Peripheral I/O Mode can be used to interface with
AN1171 for more detail. external peripherals. In this mode, all of Port A
serves as a tri-state, bi-directional data buffer for
Table 87 summarizes which modes are available
on each port. Table 90 shows how and where the the MCU. Peripheral I/O Mode is enabled by set-
ting Bit 7 of the VM Register to a '1.' Figure 44
different modes are configured. Each of the port
shows how Port A acts as a bi-directional buffer for
operating modes are described in the following
sections. the MCU data bus if Peripheral I/O Mode is en-
abled. An equation for PSEL0 and/or PSEL1 must
MCU I/O Mode be written in PSDsoft. The buffer is tri-stated when
In the MCU I/O Mode, the MCU uses the I/O Ports PSEL0 or PSEL1 is low (not active). The PSEN
block to expand its own I/O ports. By setting up the signal should be “ANDed” in the PSEL equations
CSIOP space, the ports on the PSD Module are to disable the buffer when PSEL resides in the
mapped into the MCU address space. The ad- data space.
dresses of the ports are listed in Table 78, page JTAG In-System Programming (ISP)
73.
Port C is JTAG compliant, and can be used for In-
A port pin can be put into MCU I/O Mode by writing System Programming (ISP). For more information
a '0' to the corresponding bit in the Control Regis- on the JTAG Port, see PROGRAMMING IN-CIR-
ter. The MCU I/O direction may be changed by CUIT USING THE JTAG SERIAL INTERFACE,
writing to the corresponding bit in the Direction page 101.
Register, or by the output enable product term
(see Peripheral I/O Mode, page 91). When the pin
91/129
uPSD33XX
RD
PSEL0
PSEL
PSEL1
D0 - D7
VM REGISTER BIT 7 PA0 - PA7
DATA BUS
WR
AI02886
PLD I/O
McellAB Outputs Yes Yes No No
McellBC Outputs No Yes Yes(2) No
Additional Ext. CS Outputs No No No Yes
PLD Inputs Yes Yes Yes Yes
Address Out
Declare pins only 1 1 (Note 2) N/A
(Port A,B)
Peripheral I/O Logic equations
N/A N/A PIO Bit = 1
(Port A) (PSEL0 & 1)
Note: 1. N/A = Not Applicable
2. The direction of the Port A,B,C, and D pins are controlled by the Direction Register ORed with the individual output enable product
term (.oe) from the CPLD AND Array.
92/129
uPSD33XX
93/129
uPSD33XX
94/129
uPSD33XX
programming (TMS, TCK, TDI, TDO, see flops and APD counter, and
PROGRAMMING IN-CIRCUIT USING THE ■ PSD Chip Select Input (CSI, PD2). Driving this
JTAG SERIAL INTERFACE, page 101, for signal High disables the Flash memory, SRAM
more information on JTAG programming.) and CSIOP.
95/129
uPSD33XX
POWER MANAGEMENT
All PSD Module offers configurable power saving Once in Power-down Mode, all address/data
options. These options may be used individually or signals are blocked from reaching memory and
in combinations, as follows: PLDs, and the memories are deselected
■ The primary and secondary Flash memory, and internally. This allows the memory and PLDs to
SRAM blocks are built with power management remain in Standby Mode even if the address/
technology. In addition to using special silicon data signals are changing state externally
design methodology, power management (noise, other devices on the MCU bus, etc.).
technology puts the memories into Standby Keep in mind that any unblocked PLD input
Mode when address/data inputs are not signals that are changing states keeps the PLD
changing (zero DC current). As soon as a out of Stand-by Mode, but not the memories.
transition occurs on an input, the affected ■ PSD Chip Select Input (CSI, PD2) can be used
memory “wakes up,” changes and latches its to disable the internal memories, placing them
outputs, then goes back to standby. The in Standby Mode even if inputs are changing.
designer does not have to do anything special to This feature does not block any internal signals
achieve Memory Standby Mode when no inputs or disable the PLDs. This is a good alternative
are changing—it happens automatically. to using the APD Unit. There is a slight penalty
The PLD sections can also achieve Standby in memory access time when PSD Chip Select
Mode when its inputs are not changing, as Input (CSI, PD2) makes its initial transition from
described in the sections on the Power deselected to selected.
Management Mode Registers (PMMR). ■ The PMMRs can be written by the MCU at run-
■ As with the Power Management Mode, the time to manage power. The PSD Module
Automatic Power Down (APD) block allows the supports “blocking bits” in these registers that
PSD Module to reduce to stand-by current are set to block designated signals from
automatically. The APD Unit can also block reaching both PLDs. Current consumption of
MCU address/data signals from reaching the the PLDs is directly related to the composite
memories and PLDs. frequency of the changes on their inputs (see
Figure 48 and Figure 49). Significant power
Built in logic monitors the Address Strobe of the savings can be achieved by blocking signals
MCU for activity. If there is no activity for a
that are not used in DPLD or CPLD logic
certain time period (MCU is asleep), the APD
equations.
Unit initiates Power-down Mode (if enabled).
APD EN
PMMR0 BIT 1=1
TRANSITION
DETECTION DISABLE BUS
INTERFACE
ALE
CLR PD
DISABLE
FLASH/SRAM AI06608
96/129
uPSD33XX
The PSD Module has a Turbo Bit in PMMR0.This ■ Typical standby current is of the order of
bit can be set to turn the Turbo Mode off (the de- microamperes. These standby current values
fault is with Turbo Mode turned on). While Turbo assume that there are no transitions on any PLD
Mode is off, the PLDs can achieve standby current input.
when no PLD inputs are changing (zero DC cur- Other Power Saving Options. The PSD Module
rent). Even when inputs do change, significant offers other reduced power saving options that are
power can be saved at lower frequencies (AC cur- independent of the Power-down Mode. Except for
rent), compared to when Turbo Mode is on. When the SRAM Stand-by and PSD Chip Select Input
the Turbo Mode is on, there is a significant DC cur- (CSI, PD2) features, they are enabled by setting
rent component and the AC component is higher. bits in PMMR0 and PMMR2.
Automatic Power-down (APD) Unit and Power-
down Mode. The APD Unit, shown in Figure 45,
puts the PSD Module into Power-down Mode by
monitoring the activity of Address Strobe (ALE). If
the APD Unit is enabled, as soon as activity on Ad-
dress Strobe (ALE) stops, a four-bit counter starts Figure 46. Enable Power-down Flow Chart
counting. If Address Strobe (ALE/AS, PD0) re-
mains inactive for fifteen clock periods of CLKIN RESET
(PD1), Power-down (PDN) goes High, and the
PSD Module enters Power-down Mode, as dis-
Enable APD
cussed next. Set PMMR0 Bit 1 = 1
Power-down Mode. By default, if you enable the
APD Unit, Power-down Mode is automatically en-
abled. The device enters Power-down Mode if Ad-
dress Strobe (ALE) remains inactive for fifteen OPTIONAL
periods of CLKIN (PD1). Disable desired inputs to PLD
by setting PMMR0 bits 4 and 5
The following should be kept in mind when the and PMMR2 bits 2 through 6.
PSD Module is in Power-down Mode:
■ If Address Strobe (ALE) starts pulsing again, the
PSD Module returns to normal Operating mode.
The PSD Module also returns to normal
Operating mode if either PSD Chip Select Input
(CSI, PD2) is Low or the RESET input is High. No ALE idle
for 15 CLKIN
■ The MCU address/data bus is blocked from all clocks?
memory and PLDs.
■ Various signals can be blocked (prior to Power- Yes
down Mode) from entering the PLDs by setting
PSD Module in Power
the appropriate bits in the PMMR registers. The Down Mode
AI06609
blocked signals include MCU control signals
and the common CLKIN (PD1).
Note: Blocking CLKIN (PD1) from the PLDs
does not block CLKIN (PD1) from the APD Unit. Table 96. Power-down Mode’s Effect on Ports
■ All memories enter Standby Mode and are Port Function Pin Level
drawing standby current. However, the PLD and MCU I/O No Change
I/O ports blocks do not go into Standby Mode
because you don’t want to have to wait for the PLD Out No Change
logic and I/O to “wake-up” before their outputs
Address Out Undefined
can change. See Table 96 for Power-down
Mode effects on PSD Module ports. Peripheral I/O Tri-State
97/129
uPSD33XX
98/129
uPSD33XX
99/129
uPSD33XX
VCC(min)
VCC
tNLNH
tNLNH-PO tNLNH-A
Power-On Reset Warm Reset
RESET
AI07874
Table 100. Status During Power-on RESET, Warm RESET and Power-down Mode
Port Configuration Power-On RESET Warm RESET Power-down Mode
MCU I/O Input mode Input mode Unchanged
Valid after internal PSD Depends on inputs to PLD
PLD Output configuration bits are Valid (addresses are blocked in
loaded PD Mode)
Address Out Tri-stated Tri-stated Not defined
Peripheral I/O Tri-stated Tri-stated Tri-stated
100/129
uPSD33XX
JTAG Extensions
TSTAT and TERR are two JTAG extension signals
enabled by an “ISC_ENABLE” command received
over the four standard JTAG signals (TMS, TCK,
101/129
uPSD33XX
AC/DC PARAMETERS
These tables describe the AD and DC parameters – WRITE Timing
of the uPSD33XX Devices: – Power-down and RESET Timing
■ DC Electrical Specification
The following are issues concerning the parame-
■ AC Timing Specification ters presented:
■ PLD Timing ■ In the DC specification the supply current is
70
ICC – (mA)
)
(25%
FF
60
O ON
URB
O
T
O
50
RB
TU
40
30
F
20 OF PT 100%
B O
UR PT 25%
T
10
0
0 5 10 15 20 25
40
ICC – (mA)
30
FF
5%)
O
(2
O ON
O
TURB
RB
20
TU
PT 100%
10 F
OF PT 25%
O
RB
TU
0
0 5 10 15 20 25
102/129
uPSD33XX
Table 102. PSD Module Example, Typ. Power Calculation at VCC = 5.0V (Turbo Mode Off)
Conditions
MCU Clock Frequency = 12MHz
Highest Composite PLD input frequency
(Freq PLD) = 8MHz
MCU ALE frequency (Freq ALE) = 2MHz
% Flash memory
= 80%
Access
% SRAM access = 15%
% I/O access = 5% (no additional power above base)
Operational Modes
% Normal = 40%
% Power-down Mode = 60%
Number of product terms used
(from fitter report) = 45 PT
% of total product terms = 45/182 = 24.7%
Turbo Mode = Off
Calculation (using typical values)
ICC total = ICC(MCUactive) x %MCUactive + ICC(PSDactive) x %PSDactive + IPD(pwrdown) x %pwrdown
ICC(MCUactive) = 20mA
IPD(pwrdown) = 250uA
103/129
uPSD33XX
MAXIMUM RATING
Stressing the device above the rating listed in the plied. Exposure to Absolute Maximum Rating con-
Absolute Maximum Ratings” table may cause per- ditions for extended periods may affect device
manent damage to the device. These are stress reliability. Refer also to the STMicroelectronics
ratings only and operation of the device at these or SURE Program and other relevant quality docu-
any other conditions above those indicated in the ments.
Operating sections of this specification is not im-
DC AND AC PARAMETERS
This section summarizes the operating and mea- ment Conditions summarized in the relevant
surement conditions, and the DC and AC charac- tables. Designers should check that the operating
teristics of the device. The parameters in the DC conditions in their circuit match the measurement
and AC Characteristic tables that follow are de- conditions when relying on the quoted parame-
rived from tests performed under the Measure- ters.
104/129
uPSD33XX
M Output Macrocell
Example: tAVLX – Time from Address Valid to ALE
Invalid.
AI03102
105/129
uPSD33XX
106/129
uPSD33XX
Output High Voltage Except IOH = –20uA, VDD = 4.5V 4.4 4.49 V
VOH
VSTBY On IOH = –2mA, VDD = 4.5V 2.4 3.9 V
VOH1 Output High Voltage VSTBY On IOH1 = 1uA VSTBY – 0.8 V
VSTBY SRAM Stand-by Voltage 2.0 VDD V
ISTBY SRAM Stand-by Current VDD = 0V 0.5 1 uA
IIDLE Idle Current (VSTBY input) VDD > VSTBY –0.1 0.1 uA
VDF SRAM Data Retention Voltage Only on VSTBY 2 VDD – 0.2 V
107/129
uPSD33XX
Output High Voltage Except IOH = –20uA, VDD = 3.0V 2.9 2.99 V
VOH
VSTBY On IOH = –1mA, VDD = 3.0V 2.7 2.8 V
VOH1 Output High Voltage VSTBY On IOH1 = 1uA VSTBY – 0.8 V
VSTBY SRAM Stand-by Voltage 2.0 VDD V
ISTBY SRAM Stand-by Current VDD = 0V 0.5 1 uA
IIDLE Idle Current (VSTBY input) VDD > VSTBY –0.1 0.1 uA
VDF SRAM Data Retention Voltage Only on VSTBY 2 VDD – 0.2 V
108/129
uPSD33XX
ALE
tAVLL tPLPH
PSEN
RD tLLAX tPXAV
tPXIZ
tAZPL
MCU INSTR
AD0 - AD7 A0-A7 A0-A7
IN
tAVIV tPXIX
MCU
A8 - A11 A8-A11 A8-A11
AI07875
109/129
uPSD33XX
ALE
tLHLL
tWHLH
PSEN
tLLWL tWLWH
WR
tWHQX
tAVLL
tLLAX
tQVWH
MCU DATA OUT A0-A7 INSTR IN
A0-A7
AD0 - AD7
tAVWL
MCU
A8-A11 A8-A11
A8 - A11
AI07877
110/129
uPSD33XX
111/129
uPSD33XX
INPUT
tER tEA
INPUT TO
OUTPUT
ENABLE/DISABLE
AI02863
112/129
uPSD33XX
CLKIN
tS tH
INPUT
tCO
REGISTERED
OUTPUT
AI02860
Table 117. CPLD Macrocell Synchronous Clock Mode Timing (5V PSD Module)
PT Turbo Slew
Symbol Parameter Conditions Min Max Unit
Aloc Off rate(1)
Maximum Frequency
1/(tS+tCO) 40.0 MHz
External Feedback
Maximum Frequency
fMAX 1/(tS+tCO–10) 66.6 MHz
Internal Feedback (fCNT)
Maximum Frequency
1/(tCH+tCL) 83.3 MHz
Pipelined Data
tS Input Setup Time 12 +2 + 10 ns
tH Input Hold Time 0 ns
tCH Clock High Time Clock Input 6 ns
tCL Clock Low Time Clock Input 6 ns
tCO Clock to Output Delay Clock Input 13 –2 ns
tARD CPLD Array Delay Any macrocell 11 +2 ns
tMIN Minimum Clock Period(2) tCH+tCL 12 ns
Note: 1. Fast Slew Rate output available on PA3-PA0, PB3-PB0, and PD2-PD1. Decrement times by given amount.
2. CLKIN (PD1) tCLCL = tCH + tCL.
Table 118. CPLD Macrocell Synchronous Clock Mode Timing (3V PSD Module)
PT Turbo Slew
Symbol Parameter Conditions Min Max Unit
Aloc Off rate(1)
Maximum Frequency
1/(tS+tCO) 22.2 MHz
External Feedback
Maximum Frequency
fMAX 1/(tS+tCO–10) 28.5 MHz
Internal Feedback (fCNT)
Maximum Frequency
1/(tCH+tCL) 40.0 MHz
Pipelined Data
tS Input Setup Time 20 +4 + 20 ns
tH Input Hold Time 0 ns
tCH Clock High Time Clock Input 15 ns
tCL Clock Low Time Clock Input 10 ns
tCO Clock to Output Delay Clock Input 25 –6 ns
tARD CPLD Array Delay Any macrocell 25 +4 ns
tMIN (2) tCH+tCL 25 ns
Minimum Clock Period
Note: 1. Fast Slew Rate output available on PA3-PA0, PB3-PB0, and PD2-PD1. Decrement times by given amount.
2. CLKIN (PD1) tCLCL = tCH + tCL.
113/129
uPSD33XX
RESET/PRESET
INPUT
tARP
REGISTER
OUTPUT
AI02864
CLOCK
tSA tHA
INPUT
tCOA
REGISTERED
OUTPUT
AI02859
Table 119. CPLD Macrocell Asynchronous Clock Mode Timing (5V PSD Module)
PT Turbo Slew
Symbol Parameter Conditions Min Max Unit
Aloc Off Rate
Maximum Frequency
1/(tSA+tCOA) 38.4 MHz
External Feedback
Maximum Frequency
fMAXA 1/(tSA+tCOA–10) 62.5 MHz
Internal Feedback (fCNTA)
Maximum Frequency
1/(tCHA+tCLA) 71.4 MHz
Pipelined Data
tSA Input Setup Time 7 +2 + 10 ns
tHA Input Hold Time 8 ns
tCHA Clock Input High Time 9 + 10 ns
tCLA Clock Input Low Time 9 + 10 ns
tCOA Clock to Output Delay 21 + 10 –2 ns
tARDA CPLD Array Delay Any macrocell 11 +2 ns
tMINA Minimum Clock Period 1/fCNTA 16 ns
114/129
uPSD33XX
Table 120. CPLD Macrocell Asynchronous Clock Mode Timing (3V PSD Module)
PT Turbo Slew
Symbol Parameter Conditions Min Max Unit
Aloc Off Rate
Maximum Frequency
1/(tSA+tCOA) 21.7 MHz
External Feedback
Maximum Frequency
fMAXA 1/(tSA+tCOA–10) 27.8 MHz
Internal Feedback (fCNTA)
Maximum Frequency
1/(tCHA+tCLA) 33.3 MHz
Pipelined Data
tSA Input Setup Time 10 +4 + 20 ns
tHA Input Hold Time 12 ns
tCHA Clock High Time 17 + 20 ns
tCLA Clock Low Time 13 + 20 ns
tCOA Clock to Output Delay 36 + 20 –6 ns
tARD CPLD Array Delay Any macrocell 25 +4 ns
tMINA Minimum Clock Period 1/fCNTA 36 ns
PT CLOCK
t IS t IH
INPUT
OUTPUT
t INO
AI03101
115/129
uPSD33XX
Table 123. Program, WRITE and Erase Times (5V, 3V PSD Modules)
Symbol Parameter Min. Typ. Max. Unit
Flash Program 8.5 s
116/129
uPSD33XX
ALE
tAVQV (PA)
tSLQV (PA)
CSI
tRLQV (PA)
tRHQZ (PA)
RD
tDVQV (PA)
DATA ON PORT A
AI06610
Table 124. Port A Peripheral Data Mode READ Timing (5V PSD Module)
Turbo
Symbol Parameter Conditions Min Max Unit
Off
Address Valid to Data
tAVQV–PA (Note 1) 37 + 10 ns
Valid
tSLQV–PA CSI Valid to Data Valid 27 + 10 ns
Table 125. Port A Peripheral Data Mode READ Timing (3V PSD Module)
Turbo
Symbol Parameter Conditions Min Max Unit
Off
117/129
uPSD33XX
ALE
WR
tDVQV (PA)
PORT A
DATA OUT
AI06611
Table 126. Port A Peripheral Data Mode WRITE Timing (5V PSD Module)
Symbol Parameter Conditions Min Max Unit
tWLQV–PA WR to Data Propagation Delay 25 ns
Table 127. Port A Peripheral Data Mode WRITE Timing (3V PSD Module)
Symbol Parameter Conditions Min Max Unit
tWLQV–PA WR to Data Propagation Delay 42 ns
118/129
uPSD33XX
VCC VCC(min)
tNLNH
tNLNH-PO tNLNH-A
Power-On Reset Warm Reset
RESET
AI07874
119/129
uPSD33XX
TCK
t ISCCL
t ISCPSU t ISCPH
TDI/TMS
t ISCPZV
t ISCPCO
ISC OUTPUTS/TDO
t ISCPVZ
ISC OUTPUTS/TDO
AI02865
tISCCF Clock (TCK, PC1) Frequency (except for PLD) (Note 1) 20 MHz
tISCCH Clock (TCK, PC1) High Time (except for PLD) (Note 1) 23 ns
tISCCL Clock (TCK, PC1) Low Time (except for PLD) (Note 1) 23 ns
tISCCHP Clock (TCK, PC1) High Time (PLD only) (Note 2) 240 ns
tISCCLP Clock (TCK, PC1) Low Time (PLD only) (Note 2) 240 ns
120/129
uPSD33XX
tISCCF Clock (TCK, PC1) Frequency (except for PLD) (Note 1) 12 MHz
tISCCH Clock (TCK, PC1) High Time (except for PLD) (Note 1) 40 ns
tISCCL Clock (TCK, PC1) Low Time (except for PLD) (Note 1) 40 ns
tISCCHP Clock (TCK, PC1) High Time (PLD only) (Note 2) 240 ns
tISCCLP Clock (TCK, PC1) Low Time (PLD only) (Note 2) 240 ns
VCC – 0.5V
0.2 VCC + 0.9V
Test Points
0.2 VCC – 0.1V
0.45V
AI06650
Note: AC inputs during testing are driven at VCC–0.5V for a logic '1,' and 0.45V for a logic '0.'
Timing measurements are made at VIH(min) for a logic '1,' and VIL(max) for a logic '0'
AI06651
Note: For timing purposes, a Port pin is considered to be no longer floating when a 100mV change from load voltage occurs, and begins to
float when a 100mV change from the loaded VOH or VOL level occurs
IOL and IOH ≥ 20mA
121/129
uPSD33XX
Figure 66. PSD Module AC Measurement I/O Figure 67. PSD Module AC Measurement Load
Waveform Circuit
2.01 V
3.0V 195 Ω
Test Point 1.5V
Device
Under Test
0V CL = 30 pF
AI03103b (Including Scope and
Jig Capacitance)
AI03104b
122/129
uPSD33XX
PART NUMBERING
Device Type
uPSD = Microcontroller PSD
Family
33 = Turbo core
SRAM Size
1 = 16Kbit
3 = 64Kbit
5 = 256Kbit
IP Mix
D = IP Mix: I2C, SPI, UART (2), IrDA, ADC, Supervisor, PCA
Operating Voltage
blank = VCC = 4.5 to 5.5V
V = VCC = 3.0 to 3.6V
Speed
–24 = 24MHz
–40 = 40MHz
Package
T = 52-pin TQFP
U = 80-pin TQFP
Temperature Range
1 = 0 to 70°C
6 = –40 to 85°C
Shipping Option
Tape & Reel Packing = T
For a list of available options (e.g., Speed, Package) or for further information on any aspect of this device,
please contact the ST Sales Office nearest to you.
123/129
uPSD33XX
D1
D2 A2
Ne E2 E1 E
b
N
1
Nd A
CP
L1
c
QFP-A A1 α L
Note: Drawing is not to scale.
124/129
uPSD33XX
Table 135. TQFP52 – 52-lead Plastic Quad Flatpack Package Mechanical Data
mm inches
Symb
Typ Min Max Typ Min Max
A – – 1.75 – – 0.069
125/129
uPSD33XX
D1
D2 A2
Ne E2 E1 E
b
N
1
Nd A
CP
L1
c
QFP-A A1 α L
Note: Drawing is not to scale.
126/129
uPSD33XX
Table 136. TQFP80 – 80-lead Plastic Quad Flatpack Package Mechanical Data
mm inches
Symb
Typ Min Max Typ Min Max
A – – 1.60 – – 0.063
127/129
uPSD33XX
REVISION HISTORY
128/129
uPSD33XX
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences
of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted
by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject
to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not
authorized for use as critical components in life support devices or systems without express written approval of STMicroelectronics.
129/129