ST9291
®
July 1995
16-48K ROM HCMOS MCU WITH
ON SCREEN DISPLAY AND VOLTAGE TUNING OUTPUT
(Ordering Information at the end of the Datasheet)
PSDIP42
PSDIP56
Device
ROM
RAM
PACKAGE
ST9291J2/N2
16K
384
PSDIP42/56
ST9291J3/N3
16K
640
PSDIP42/56
ST9291J4/N4
24K
384
PSDIP42/56
ST9291J5/N5
24K
640
PSDIP42/56
ST9291J6/N6
32K
640
PSDIP42/56
ST9291J7/N7
48K
640
PSDIP42/56
DEVICE SUMMARY
Register oriented 8/16 bit CORE with
RUN, WFI and HALT modes
Minimum instruction cycle time: 500ns
(12MHz internal)
16 to 48K bytes of ROM,
384/640 bytes of RAM,
224 general purpose registers available as RAM,
accumulators or index registers (Register File)
42-lead Shrink DIP package or
56-lead Shrink DIP package
Interrupt handler and Serial Peripheral Interface
as standard features
31 (42 pin package) / 42 (56 pin package) fully
programmable I/O pins
34 character x15 rows software programmable
On Screen Display module with colour, italic, un-
derline, flash, transparent and fringe attribute
options
14-bit Voltage Synthesis for tuning reference
voltage.
8 8-bit PWM D/A outputs with repetition frequency
2 to 32kHz and 12V Open Drain Capability
16 bit Timer with 8 bit Prescaler, able to be used
as a Watchdog Timer
16-bit programmable Slice Timer with 8-bit pres-
caler
3 channel Analog to Digital Converter, with inte-
gral sample and hold, fast 5.75
µ
s conversion
time, 6-bit guaranteed resolution
Rich Instruction Set and 14 Addressing modes
Division-by-Zero trap generation
Versatile Development tools, including assembler,
linker, C-compiler, archiver, graphic oriented de-
bugger and hardware emulators
Real Time Operating System
Windowed EPROM parts available for prototyp-
ing and pre-production development phases
FUNCTIONAL DESCRIPTION
1/20
3
19
20
24
23
22
21
VR01740B
40
2
1
42
41
Figure 1. 42 Pin Shrink DIP Pinout
Pin
Pin
name
1
P2.0/INT7
2
RESET
3
P0.7
4
P0.6
5
P0.5
6
P0.4
7
P0.3
8
P0.2
9
P0.1
10
P0.0
11
P3.7
12
P3.6
13
P3.5
14
P3.4
15
P3.3/B
16
P3.2/G
17
P3.1/R
18
P3.0/FB
19
P5.1/SDIO
20
P5.0/SCK/INT2
21
V
DD
Pin
Pin
name
42
P2.1/INT5/AIN1
41
P2.2/INT0/AIN2
40
P2.3/INT6/VSO1
39
P2.4/NMI
38
P2.5/AIN3/VSO2
37
OSCIN
36
OSCOUT
35
P4.7/PWM7/
EXTRG (AD)
34
P4.6/PWM6
33
P4.5/PWM5
32
P4.4/PWM4
31
P4.3/PWM3
30
P4.2/PWM2
29
P4.1/PWM1
28
P4.0/PWM0
27
VSYNC
26
HSYNC
25
AV
DD
24
PLLR
23
PLLF
22
V
SS
ST9291J Pin Description
Pin
Pin
name
1
P2.1/INT5/AIN1
2
P2.0/INT7
3
RESET
4
P0.7
5
P0.6
6
P0.5
7
N.C
.(1)
8
P0.4
9
P0.3
10
P0.2
11
P0.1
12
P0.0
13
N.C.
(1)
14
V
DD
(2)
15
N.C.
(1)
16
P3.7
17
P3.6
18
P3.5
19
P3.4
20
P3.3/B
21
P3.2/G
22
P3.1/R
23
P3.0/FB
24
P5.3
25
P5.2
26
P5.1/SDIO
27
P5.0/SCK/INT2
28
V
DD
(2)
Pin
Pin
name
56
P2.2/INT0/AIN2
55
P2.3/INT6/VSO1
54
P2.4/NMI
53
P2.5/AIN3/VSO2
52
P1.0
51
P1.1
50
P1.2
49
P1.3
48
P1.4
47
P1.5
46
P1.6
45
P1.7
44
OSCIN
43
OSCOUT
42
P4.7/PWM7/
EXTRG (AD)
41
P4.6/PWM6
40
P4.5/PWM5
39
P4.4/PWM4
38
P4.3/PWM3
37
P4.2/PWM2
36
P4.1/PWM1
35
P4.0/PWM0
34
VSYNC
33
HSYNC
32
AV
DD
31
PLLR
30
PLLF
29
V
SS
ST9291N Pin Description
3
26
27
31
30
29
28
VR01740A
54
2
1
56
55
Figure 2. 56 Pin Shrink DIP Pinout
Notes (N Package only) :
1. N.C. means “not connected”
2. Pins 14 and 28 (VDD) are internally connected
®
ST9291
2/20
GENERAL DESCRIPTION
The ST9291 is a ROM member of the ST9 family of
microcontrollers, completely developed and pro-
duced by SGS-THOMSON Microelectronics using
a proprietary n-well HCMOS process.
The ROM parts are fully compatible with their
EPROM and OTP (One-Time Programmable) ver-
sions, which may be used for the prototyping and
pre-production phases of development.
The nucleus of the ST9291 is the advanced ST9
Core which includes the Central Processing Unit
(CPU), the Register File, a 16-bit Timer/Watchdog
with 8-bit Prescaler, a Serial Peripheral Interface
supporting S-bus, I
2
C-bus and IM-bus Interface,
plus two 8-bit I/O ports. The Core has independent
memory and register buses allowing a high degree
of pipelining to add to the efficiency of the code
execution speed of the extensive instruction set.
The powerful I/O capabilities demanded by micro-
controller applications are fulfilled by the ST9291
with up to 32/42 I/O lines dedicated to digital In-
put/Output. These lines are grouped into up to six
I/O Ports and can be configured on a bit basis un-
der software control to provide timing, status sig-
nals, timer inputs and outputs, analog inputs, ex-
ternal interrupts, OSD (On Screen Display) output
and serial or parallel I/O.
Three basic memory spaces are available to sup-
port this wide range of configurations: Program
Memory, Data Memory and the Register File,
which includes the control and status registers of
the on-chip peripherals.
The human interface is provided by the On Screen
Display module, this can produce up to 15 lines of
up to 34 characters from a ROM defined 128 char-
acter set. The 9x13 character can be modified by 4
different pixel sizes, with character rounding, and
formed into words with colour and format attrib-
utes.
A 14-bit VS (Voltage Synthesis) output using the
PWM (Pulse Width Modulation)/BRM (Bit Rate
Modulation) is present to generate tuning voltages
for low-mid range TV set applications. The tuning
voltage is output on one of two separate output
pins.
A 16-bit Slice Timer with an 8-bit Prescaler is also
present.
CPU
16-Bit TIMER/WATCHDOG+SPI
SLICE
TIMER
VOLTAGE
SYNTHESIS
I/O PORT 0
8
I/O PORT
3
7
On Screen
Display
PLL
HSYNC
PLLR
PLLF
AV
DD
VSYNC
I/O PORT 4
P.W.M.
Outputs
8
P.W.M.
D / A
Converter
I/O PORT 2
( Analog Inputs )
6
A / D
Converter
I/O PORT 5
( SPI )
2
MEMORY BUS ( Address & Data )
REGISTER BUS ( Address & Data )
Note : 42 SDIP shown
VR01995E
16 k / 48 k Bytes
ROM or EPROM
(1)
384 / 640 Bytes
RAM
256 Bytes
REGISTER FILE
Figure 3. ST9291 Block Diagram
Note 1. EPROM version only
®
ST9291
3/20
The control of TV or Satellite receiver setting can
be done by up to eight 8-bit PWM outputs, with a
frequency maximum of 23,437Hz at 8-bit resolu-
tion (INTCLK = 12MHz). Low resolutions with
higher frequency operation can be programmed.
In addition thereis a 3 channel Analog to Digital Con-
verter with integral sample and hold, fast 5.75
µ
s con-
version time and 6-bit guaranteed resolution.
PIN DESCRIPTION
VSYNC.
Vertical Sync. Vertical video synchronisa-
tion input to OSD. Positive or negative polarity.
HSYNC.
Horizontal Sync. Horizontal video syn-
chronisation input to OSD. Positive or negative po-
larity.
PLLF.
PLL Filter input. Filter input for the OSD for
PLL feed-back.
PLLR.
PLL Resistor connection pin. For resistor
connection to select the PLL gain adjust.
RESET.
Reset (input, active low). The ST9 is initial-
ised by the Reset signal. With the deactivationof RE-
SET, program execution begins from the Program
memory location pointed to by the vector contained
in program memory locations 00h and 01h.
OSCIN, OSCOUT.
Oscillator (input and output).
These pins connect a parallel-resonant crystal
GENERAL DESCRIPTION (Continued)
(24MHz maximum), or an external source to the
on-chip clock oscillator and buffer. OSCIN is the in-
put of the oscillator inverter and internal clock gen-
erator; OSCOUT is the output of the oscillator
inverter.
AV
DD
. Analog V
DD
of PLL. This pin must be tied to
V
DD
externally to the ST9291.
V
DD
. Main Power Supply Voltage (5V
±
10%)
V
SS
. Digital Circuit Ground.
P0.0-P0.7,
P2.0-P2.5,
P3.0-P3.7,
P4.0-P4.7,
P5.0-P5.1 (J suffix)
P0.0-P0.7,
P1.0-P1.7,
P2.0-P2.5,
P3.0-P3.7,
P4.0-P4.7, P5.0-P5.3 (N suffix)
I/O Port Lines (In-
put/Output, TTL or CMOS compatible). 32/42 lines
grouped into I/O ports, bit programmable under
program control as general purpose I/O or as Alter-
nate functions (see next section).
P4.0 - P4.7 are high voltage (12V) open drain out-
puts. The voltage in open drain output mode for all
other I/O bits must not exceed V
DD
.
I/O Port Alternate Functions.
Each pin of the I/O ports of the ST9291 may as-
sume software programmable Alternative Func-
tions as shown in the Pin Configuration Drawings.
Table 1 shows the Functions allocated to each I/O
Port pin.
®
ST9291
4/20
PIN DESCRIPTION (Continued)
I/O PORT
Name
Function
Alternate Function
Pin Assignment
Port.bit
9291J
9291N
P0.0
I/O
10
12
P0.1
I/O
9
11
P0.2
I/O
8
10
P0.3
I/O
7
9
P0.4
I/O
6
8
P0.5
I/O
5
6
P0.6
I/O
4
5
P0.7
I/O
3
4
P1.0
I/O
-
52
P1.1
I/O
-
51
P1.2
I/O
-
50
P1.3
I/O
-
49
P1.4
I/O
-
48
P1.5
I/O
-
47
P1.6
I/O
-
46
P1.7
I/O
-
45
P2.0
INT7
I
External Interrupt 7 with Schmitt Trigger
1
2
P2.1
INT5
I
External Interrupt 5 with Schmitt Trigger
42
1
P2.1
AIN1
I
A/D Analog Input 1
42
1
P2.2
INT0
I
External Interrupt 0
41
56
P2.2
AIN2
I
A/D Analog Input 2
41
56
P2.3
INT6
I
External Interrupt 6
40
55
P2.3
VSO1
O
Voltage Synthesis Output 1
40
55
P2.4
NMI
I
Non-Maskable Interrupt
39
54
P2.5
AIN3
I
A/D Analog Input 3
38
53
P2.5
VSO2
O
Voltage Synthesis Output 2
38
53
P3.0
FB
O
Fast Blanking OSD output
18
23
P3.1
R
O
Red Video Colour OSD output
17
22
P3.2
G
O
Green Video Colour OSD output
16
21
P3.3
B
O
Blue Video Colour OSD output
15
20
Table 1.ST9291 I/O Port Alternative Function Summary
®
ST9291
5/20
PIN DESCRIPTION (Continued)
I/O PORT
Name
Function
Alternate Function
Pin Assignment
Port.bit
9291J
9291N
P3.4
I/O
14
19
P3.5
I/O
13
18
P3.6
I/O
12
17
P3.7
I/O
-
16
P4.0
PWM0
O
PWM Output 0
28
35
P4.1
PWM1
O
PWM Output 1
29
36
P4.2
PWM2
O
PWM Output 2
30
37
P4.3
PWM3
O
PWM Output 3
31
38
P4.4
PWM4
O
PWM Output 4
32
39
P4.5
PWM5
O
PWM Output 5
33
40
P4.6
PWM6
O
PWM Output 6
34
41
P4.7
PWM7
O
PWM Output 7
35
42
P4.7
EXTRG
I
A/D External Trigger
35
42
P5.0
SCK
O
SPI Serial Clock
(1)
20
27
P5.0
INT2
I
External Interrupt 2
(1)
20
27
P5.1
SDIO
I/O
SPI Serial Data Input/Output
(1 )
19
26
P5.2
I/O
-
25
P5.3
I/O
-
24
Notes.
1. The alternate functions of SCK/INT2 and SDIO may be swapped by using the SWAP Register Function.
2. Schmitt trigger options are available as a mask option for any input pin.
Table 1. ST9291 I/O Port Alternative Function Summary (Continued)
®
ST9291
6/20
64K
PROGRAM
MEMORY
REGISTER
FILE
64K
DATA
MEMORY
VA00430
Figure 1-4. Address Spaces
1 CORE DESCRIPTION
1.1 CORE ARCHITECTURE
1.1.1 INTRODUCTION
The Core or Central Processing Unit (CPU) of the
ST9 includes the 8 bit Arithmetic Logic Unit and the
16 bit Program Counter, System and User Stack
Pointers. The microcoded Instruction Set is highly
optimised for both byte (8 bit) and word (16 bit)
data, BCD and Boolean data types, with 14 ad-
dressing modes.
Three independent buses are controlled by the
Core, a 16 bit Memory bus, an 8 bit Register ad-
dressing bus and a 6 bit Interrupt/DMA bus con-
nected to the interrupt and DMA controllers in the
on-chip peripherals and the Core. This multiple bus
architecture allows a high degree of pipelining and
parallel operation, giving the ST9 its efficiency in
both numerical calculations and communication
with the on-chip peripherals.
1.1.2 ADDRESS SPACES
The ST9 has three separate address spaces:
-
Register File: 240 8-bit registers plus up to 64
pages of 16 bytes each, located in the on-chip
peripherals.
-
Data memory with up to 64K (65536) bytes
-
Program memory with up to 64K (65536) bytes
The Data and Program memory spaces will be ad-
dressed in further detail in section 1.3.
1.1.2.1 Register File
The Register File consists of:
-
224 general purpose registers R0 to R223
-
16 system registers in the System Group
(R224 to R239).
-
I/O pages depending on the configuration of
the ST9, each containing up to 16 registers,
with paging facilities based on the top group
(R240 to R255).
®
ST9291
7/20
ADDRESS SPACES (Continued)
F
E
D
C
B
A
9
8
7
6
5
4
3
PAGED REGISTERS
SYSTEM REGISTERS
2
1
0
0
0
15
255
240
239
224
223
VA00432
UP TO
64 PAGES
GENERAL
REGISTERS
PURPOSE
224
Figure 1-5. Register Grouping
PAGE 63
PAGE 5
PAGE 0
PAGE POINTER
R255
R240
R224
R0
VA00433
Figure 1-6. Page Pointer Configuration
REGISTER FILE
SYSTEM REGISTERS
GROUP D
GROUP B
GROUP C
(1100) (0011)
R192
R207
255
240
239
224
223
F
E
D
C
B
A
9
8
7
6
5
4
3
2
1
0
15
VR000118
0
0
R195
R195
(R0C3h)
PAGE REGISTERS
Figure 1-7. Addressing the Register File
®
ST9291
8/20
1.1.2.2 Addressing Registers
All registers in the Register File and pages can be
specified by using a decimal, hex or binary ad-
dress, e.g. R231, RE7h or R11100111b is the
same register.
The registers can be referred to by their hexadeci-
mal group address, so that registers R0-R15 form
group 0, R160-R175 form group A and so on.
Working Register Addresses
The 8-bit register address is formed by 2 nibbles,
for example, for register R195 or RC3h or
R11000011, 1100 specifies the 13th group (i.e.
group C) and 0011 specifies the 3rd register in that
group.
Working registers are addressed by supplying the
least significant nibble in the instruction and adding
it to the most significant nibble found in the Regis-
ter Pointer (R233). Working register addressing is
shown in Figure 1-7.
System Registers
The 16 system registers at addresses R224 to
R239 form Group E.
The system registers are addressable using any of
the 4 register addressing modes and the most sig-
nificant nibble will, in all cases, be 14 (0Eh).
Paged Registers
There are a maximum of 64 pages each containing
16 registers. These are addressed using the regis-
ter addressing modes with the addition of the Page
Pointer register, R234. This register selects the
page to be addressed in group F and once set,
does not need to be changed if two or more regis-
ters on the same page are to be addressed in suc-
cession.
Therefore if the Page Pointer, R234, is set to 5, the
instructions
spp 5
ld R242, r4
will load the contents of working register r4 into the
third register (R242) of page 5.
These paged registers hold data and control regis-
ters related to the on-chip peripherals, and thus the
configuration depends upon the peripheral organi-
sation of each ST9 family member. i.e. pages only
exist if the peripheral exists.
Available pages are shown in Table 1-3.
1.1.2.3 Input/Output Ports
The Input/Output ports are located in two areas.
The port registers for Ports 0-5 are located at the
bottom of the System register group in locations
R224 to R229.
Each Port has three associated Control registers,
which determine the individual pin modes (I/O,
Open-Drain etc). These registers are located in
pages 2 and 3.
ADDRESS SPACES (Continued)
Hex.
Address
Decimal
Address
Function
Register File
Group
F0-FF
240-255
Paged
Registers
Group F
E0-EF
224-239
System
Registers
Group E
D0-DF
208-223
General
Purpose
Registers
Group D
C0-CF
192-207
Group C
B0-BF
176-191
Group B
A0-AF
160-175
Group A
90-9F
144-159
Group 9
80-8F
128-143
Group 8
70-7F
112-127
Group 7
60-6F
96-111
Group 6
50-5F
80-95
Group 5
40-4F
64-79
Group 4
30-3F
48-63
Group 3
20-2F
32-47
Group 2
10-1F
16-31
Group 1
00-0F
00-15
Group 0
Table 1-2. Register File Organization
®
ST9291
9/20
Applicable for ST9291
DEC
HEX
00
00
02
02
03
03
0B
11
28
40
29
41
2A
42
3B
59
3E
62
R255
RFF
SWAP
RESER
VSO
RFF
R254
RFE
SPI
RESER
RFE
R253
RFD
PORT 3
RESER
RFD
R252
RFC
WCR
RFC
R251
RFB
RESER
RESER
RFB
R250
RFA
T/WD
RESER
RFA
R249
RF9
PORT 2
OSD
OSD
RESER
RF9
R248
RF8
CHAR
CHAR
OSD
RF8
R247
RF7
RESER
1 to 16
17 to 32
PWM
RF7
R246
RF6
RF6
R245
RF5
EXT INT PORT1
PORT 5
RF5
R244
RF4
RF4
R243
RF3
RESER
RESER
OSD
RF3
R242
RF2
SLICE
CHAR
RF2
R241
RF1
RESER
PORT 0 PORT 4 TIMER
33 to 36
A/D
RF1
R240
RF0
CONV
RF0
Table 1-3. Group F Peripheral Organization
ADDRESS SPACES (Continued)
®
ST9291
10/20
R239 (EFh)
SYS. STACK POINTER LOW
R238 (EEh)
SYS. STACK POINTER HIGH
R237 (EDh)
USER STACK POINTER LOW
R236 (ECh)
USER STACK POINTER HIGH
R235 (EBh)
MODE REGISTER
R234 (EAh)
PAGE POINTER
R233 (E9h)
REGISTER POINTER 1
R232 (E8h)
REGISTER POINTER 0
R231 (E7h)
FLAGS
R230 (E6h)
CENTRAL INT. CNTL REG
R229 (E5h)
PORT5
R228 (E4h)