256 bytes RAM of Register file (accumulators or
index registers)
■ 256 to 512 bytes of on-chip static RAM
■
2 or 8 Kbytes of TDSRAM (Teletext and Display
Storage RAM)
■
28 fully programmable I/O pins
■ Serial Peripheral Interface
■
Flexible Clock controller for OSD, Data Slicer
and Core clocks running from a single low
frequency external crystal.
■
Enhanced display controller with 26 rows of
40/80 characters
–2sets of 512 characters
– Serial and Parallel attributes
– 10x10 dot matrix, definable by user
– 4/3 and 16/9 supported in 50/60Hz and 100/
120 Hz mode
– Rounding, fringe, double width, double height,
scrolling, cursor, full background color, halfintensity color, translucency and half-tone
modes
■ Teletext unit, including Data Sli cer, Acquisition
Unit and up to 8 Kbytes RAM for data storage
■
VPS and Wide Screen Signalling slicer
■ Integrated Sync Extractor and Sync Controller
■
14-bit Voltage Synthesis for tuning reference
voltage
■
Up to 6 external interrupts plus one NonMaskable Interr upt
■
8 x 8-bit programmable PWM outputs with 5V
open-drain or push-pull capab ilit y
■ 16-bit watchdog timer with 8-bit prescaler
■ 1 or 2 16-bit standard timer(s) with 8-bit
prescaler
ST92195C/D
PSDIP56
TQFP64
See end of Datasheet for ordering information
■
I²C Master/Slave (on some devices)
■
4-channel A/D converter; 5-bit guaranteed
■
Rich instruction set and 14 addressing modes
■
Versatile development tools, including
Assembler, Linker, C-compiler, Archiver,
Source Level Debugger and hardware
emulators with Real-Time Operating System
available from third parties
The ST92195C and ST92195D microcontrollers
are developed and manufactured by STMicroelectronics using a proprietary n-well HCMOS process. Their performance de rives from the use of a
flexible 256-register programming model for ultrafast context switching and real-time event response. The intelligent on-chip peripherals offload
the ST9 core from I/O and data management
processing tasks allowing critical application tasks
to get the maximum use of core resources. The
ST92195C/D MCU support low power consumption and low voltage operat ion for power-efficient
and low-cost embedded systems.
1.1.1 ST9+ Core
The advanced Core consists of the Central
Processing Unit (CPU), the Registe r File and the
Interrupt controller.
The general-purpose registers can be used as accumulators, index registers, or address pointers.
Adjacent register pairs make up 16-bit registers for
addressing or 16-bit processing. Although the ST9
has an 8-bit ALU, the chip handles 16-bit operations, including arithmetic, loads/stores, and memory/register and memory/memory exchanges.
Two basic addressable sp aces are available: the
Memory space and the Register File, which includes the control and status registers of the onchip peripherals.
1.1.2 Power Saving Modes
To optimize performance versus power consumption, a range of operating modes can be dynamically sele cted .
Run Mode. This is the f ull s pee d execution mod e
with CPU and peripherals running at the maximum
clock speed delivered by the Phase Lo cked Loo p
(PLL) of the Clock Control Unit (CCU).
Wait For I nterrup t Mode. The W ait For Interrupt
(WFI) instruction suspends program execution until an interrupt request is acknowledged. During
WFI, the CPU clock is halted while the peripherals
and interrupt controller keep running at a frequen-
cy programmable via the CCU. In this mode, the
power consumption of the device can be reduc ed
by more than 95% (Low power WFI).
Halt Mode. When executing the HALT instruction,
and if the Watchdo g is not enab led, the CP U and
its peripherals stop operating and the status of the
machine remains frozen (the clock is also
stopped). A reset is necessary to exit from Halt
mode.
1.1.3 I/O Ports
Up to 28 I/O lines are dedicated to digital Input/
Output. These lines are grouped into up to five I/O
Ports and can be configured on a bit basis under
software control to provide timing, status signals,
timer and output, analog inputs, external interrupts
and serial or parallel I/O.
1.1.4 TV Peripherals
A set of on-chip perip herals form a com plete system for TV set and VCR applications:
– Voltage Synthes is
– VPS/WSS Slicer
– Teletext S licer
– Teletext Display RAM
– OSD
1.1.5 On Screen Display
The human interface is provided by the On Screen
Display module, this can produce up to 26 lines of
up to 80 characters from a ROM of two 512-character sets. The character resolution is 10x10 dot.
Four character sizes are supported. Serial attributes allow the user to select foreground and
background colors, character size and fringe background. Parallel attributes can be used to select
additional foreground a nd background colo rs and
underline on a character by character basis.
1.1.6 Teletext and Display Storage RAM
The internal Teletext and Display storage RAM
can be used to store Teletext pages as well as Display parameters.
8/249
INTRODUCTION (Cont’d)
1.1.7 Tele t e x t , VPS a nd WSS Dat a Sli c ers
The three on-board data slicers us ing a s ingle ex ternal crystal are used to extract the Teletext, VPS
and WSS information from the video signal. Hardware Hamming decoding is provided.
1.1.8 Voltage Synthesis Tuning Control
14-bit Voltage Synthesis using the PWM (Pulse
Width Modulation)/BRM (Bit Rate Modulation)
technique can be used to generate tuning voltages
for TV set applications. The tuning voltage is output on one of two separate output pins.
1.1.9 PWM Output
Control of TV settings can be made with up to
eight 8-bit PWM outputs, with a maximum frequency of 23,437Hz at 8-bit resolution (INTCLK = 12
MHz). Low resolutions with higher frequency operation can be programmed.
1.1.10 Serial Peripheral Interface (SPI)
The SPI bus is used to communicate with external
devices via the SPI, or I²C bus communication
standards. The SPI uses a single data line for data
input and output. A s econd lin e is us ed for a s ynchronous clock signal.
ST92195C/D - GENERAL DESCRIPTION
1.1.11 Standard Timer (STIM)
The ST92195C and ST92195D have one or two
Standard Timer(s) that include a programmable
16-bit down counter and an associated 8-bit prescaler with Single and Continuous counting modes.
1.1.12 I²C Bus Interface
The ST92195D versions have one I²C bus in terface. The I²C bus is a synchronous serial bus for
connecting multiple devices using a data line and
a clock line. Multimaster and slave modes are supported. Up to two channels are supported. The I²C
interface supports 7-bit addressing. It supports
speeds of up to 800 KHz. Bus events (Bus busy,
slave address recognised) and error conditions
are automatically flagged in peripheral registers
and interrupts are optionally generated.
1.1.13 Analog/Digital Converter (ADC)
In addition there is a 4-channel Analog to Digital
Converter with integral sample and hold, fast
5.75µs conversion time and 6-bit guaranteed resolution.
tialised by the Reset signal. Wi th the d eactivation
of RESET, program execution begins from the
Program memory location pointed to by the vector
contained in program memory locations 00h and
01h.
R/G/B
Red/Green/Blue
. Video color analog DAC
outputs.
Fast Blanking
FB
V
Main power supply voltage (5V±10%, digital)
DD
. Video analog DAC output.
WSCF, WSCR Analog pins for th e VPS/WSS slicer . These pins must be tied to ground or not connected.
: On EPROM/O TP devices, the WSCR pin is
V
PP
replaced by V
pin. V
should be tied to GND in user mode.
PP
which is the programming voltage
PP
MCFM Analog pin for the display pixel frequency
multiplier.
OSCIN, OSCOUT
Oscillator
(input and output).
These pins connect a parallel-resonant crystal
(24MHz maximum), or an external source to the
on-chip clock oscillator and buffer. OSCIN is the
input of the oscillator inverter and internal clock
generator; OSCOUT is the output of the oscillator
inverter.
P2.1/INT5/AIN1
56
P2.2/INT0/AIN2
55
P2.3/INT6/VS01
54
P2.4/NMI
53
P2.5/AIN3/INT4/VS02
52
OSCIN
51
OSCOUT
50
P4.7/PWM7/EXTRG/STOUT0
49
P4.6/PWM6
48
P4.5/PWM5/SDA2
47
P4.4/PWM4/SCL2
46
P4.3/PWM3/TSLU/HT
45
P4.2/PWM2
44
P4.1/PWM1
43
P4.0/PWM0
42
VSYNC
41
HSYNC/CSYNC
40
AVDD1
39
PXFM
38
37
JTRSTO
GND
36
AGND
35
CVBS1
34
CVBS2
33
JTMS
32
AVDD2
31
CVBSO
30
29
TXCF
VSYNC
Vertical Sync
. Vertical video synchronisa-
tion input to OSD. Positive or negative polarity.
HSYNC/CSYNC
Horizontal/Composite sync
. Horizontal or composite video synchronisation input to
OSD. Positive or negative polarity.
PXFM Analog pin for the Display P i xel F requency
Multiplier
AVDD3
to V
Analog VDD of PLL.
externa lly.
DD
This pin must be tied
GND Digital circuit ground.
AGND Analog circuit ground (must be tied exter-
nally to digital GND).
CVBS1 Composite video input signal for the Tele-
text slicer and sync extraction.
CVBS2 Composite video input signal for the VPS/
WSS slicer. Pin AC coupled.
AVDD1, AVDD2 Analog power supplies (mus t be
tied externally to AVDD3).
TXCF Analog pin for the Teletext slicer line PLL.
CVBSO, JTDO, JTCK Test pins: leave floating.
TEST0 Test pins: must be tied to AVDD2.
JTRST0 Test pin: must be tied to GND.
All ports useable
for general purpose I/O (input,
output or bidirectional)
Pin No.
TQFP64 SDIP56
410I/O
AIN1IA/D Analog Data Input 1
INT5IExternal Interrupt 5
INT0IExternal Interrupt 0
AIN2IA/D Analog Data Input 2
INT6IExternal Interrupt 6
VSO1O Voltage Synthesis Output 1
AIN3IA/D Analog Data Input 3
INT4IExternal Interrupt 4
VSO2O Voltage Synthesis Output 2
All ports useable
for general purpose I/O (input,
output or bidirectional)
Pin No.
TQFP64 SDIP56
4446
Alternate Functions
PWM4O PWM Output 4
SCL2I/O I²C Channel 2 Serial Clock
PWM5O PWM Output 5
SDA2I/O I²C Channel 2 Serial Data
EXTRGIA/D Converter External Trigger Input
PWM7O PWM Output 7
STOUT0O Standard Timer 0 Output
INT2IExternal Interrupt 2
SCKO SPI Serial Clock
SCL1I/O I²C Channel 1 Serial Clock
SDOO SPI Serial Data Out
SDIISPI Serial Data In
SDA1I/O I²C Channel 1 Serial Data
Note 1: I²C available on ST92195D devices only.
Table 2. I/O Port Styles
PinsWeak Pull-UpPort StyleReset Values
P0[7:0]noStandard I/O BID / OD / TTL
P2[5,4,3,2]noStandard I/O BID / OD / TTL
P2[1,0]noSchmitt trigger BID / OD / TTL
P3.7yesStandard I/O AF / PP / TTL
P3[6,5,4]noStandard I/O BID / OD / TTL
P4[7:0]noStandard I/OBID / OD / TTL
P5[1:0]noStandard I/O BID / OD / TTL
Legend:
AF= Alternate Function, BID = Bidirectional, OD = Open Drain
PP = Push-Pull, TTL = TTL Standard Input Levels
1)
1)
1)
1)
How to Read this Table
To configure the I/O ports, use the information in
this table and the Port Bit Configuration Table in
the I/O Ports Chapter on page 71.
Port S ty le= the hardware charact eristics fixed for
each port line.
Inputs:
– If port style = Standard I/O, either TTL or CMOS
input level can be selected by software.
– If port style = Schmitt trigger, selecting CMOS or
TTL input by software has no effect, the input will
always be Schmitt Trigger.
Weak Pull-Up = This column indicat es if a weak
pull-up is present or not.
16/249
– If WPU = yes, then the WPU can be enabled/dis-
able by software
– If WPU = no, then enabling the WPU by software
has no effect
Alternate Functions (AF) = More than one AF
cannot be assigned to an external pin at the same
time:
An alternate function can be selected as follows.
AF Inputs:
– AF is selected implicitly by enabling the corre-
sponding peripheral. Exception to this are ADC
analog inputs which must be explicitly selected
as AF by software.
PIN DESCRIPTION (Cont’d)
AF Outputs or Bidirectional Lines:
– In the case of Outputs or I/Os, AF is selected
explicitly by sof twa r e.
Example 1: ADC trigger digital input
AF: EXTRG, Port: P4.7, Port Style: Standard I/O.
Write the port configuration bits (for TTL level):
P4C2.7=1
P4C1.7=0
P4C0.7=1
Enable the ADC trigger by sof tware as described
in t he ADC c hapter.
Example 2:PWM 0 output
AF: PW M0, Port : P4 .0
Write the port configuration bits (for outp ut push-
pull):
P4C2.0=0
P4C1.0=1
P4C0.0=1
ST92195C/D - GENERAL DESCRIPTION
Example 3: ADC analog input
AF: AIN1, Port : P2.1, Port style: does not apply to
analog inputs
Write the port configuration bits:
P2C2.1=1
P2C1.1=1
P2C0.1=1
17/249
ST92195C/D - GENER AL DESCRIPTION
1.3 MEMORY MA P
Inter n a l ROM
The ROM memory is mapped in two segments:
segment 00h and segment 01h; It starts at address 0000h in MMU segment 00h.
The following pages contain a list of ST92195C/D
registers, grouped by peripheral or function.
Be very careful to correctly program both:
– The set of registers dedicated to a particular
function or peripheral.
– Registers common to other functions.
In particular, double-check that any registers with
“undefined” reset values h ave been correctly initialised .
Warning: Note that in the EIVR and each IVR reg-
ister, all bits are significant. Take care when defining base vector addresses that entries in the Interrupt Vector table do not overlap.
Table 3. G roup F Pages Reg ister Map
RegisterPage
0236112132 33343536 37 38 3944555962
R255
R254
R253
R252
R251
R250
R249
Res.Res.
SPI
Port 3
WCR
Res.
WDT
Port 2
Res.
Res.
STIM
1)
1
Res.
MMU
TSU
Res.
TCC
Res
RCCU
(PLL)
VS
Res.
Res.
R248
R247
R246
R245
R244
R243
R242
R240
Note 1: Depending on device. See device summary on page 1.
R240P4C0Port 4 Configuration Register 000
R241P4C1Port 4 Configuration Register 100
R242P4C2Port 4 Configuration Register 200
R244P5C0Port 5 Configuration Register 000
R245P5C1Port 5 Configuration Register 100
R246P5C2Port 5 Configuration Register 200
R240VPSSRVPS Status Register0 0170
R241VPSD0RVPS Data Register 000170
R242VPSD1RVPS Data Register 100170
R243VPSD2RVPS Data Register 200170
R244VPSD3RVPS Data Register 300171
R245VPSD4RVPS Data Register 400171
R246WSSDS0RWSS Data and Status Register 000171
R247WSSDS1RWSS Data and Status Register 100171
R248WSSDS2RWSS Data and Status Register 200171
R249VPSWSSCRVPS/WSS Control Register 00172
R250WSSDS3RWSS Data and Status Register 300172
R251WSSDS4RWSS Data and Status Register 400173
R252WSSDS5RWSS Data and Status Register 500173
R240ST0HRCounter High Byte RegisterFF85
R241ST 0LRCounter Low Byte RegisterF F85
R242ST0PRStandard Timer Prescaler RegisterFF85
R243ST0CRStandard Timer Control Register1485
R248ST1HRCounter High Byte RegisterFF85
R249ST 1LRCounter Low Byte RegisterF F85
R240HBLANKRHorizontal Blank Register03125
R241HPOSRHorizontal Position Register03125
R242VPOSRVertical Position Register00125
R243FSCCRFull Screen Color Control Register00126
R244HSCRHeader & Status Control Register2A127
R245NCSRNational Character Set Control Register00128
R246CHPOSRCursor Horizontal Position Register00129
R247CVPOSRCursor Vertical Position Register00129
R248SCLRScrolling Control Low Register00130
R249SCHRScrolling Control High Register00131
R250DCM0RDisplay Control Mode 0 Register00133
R251DCM1RDisplay Control Mode 1 Register00134
R252TDPRTDSRAM Pointer Register00134
R253DE0RDisplay Enable 0 Control RegisterFF135
R254DE1RDisplay Enable 1 Control RegisterFF135
R255DE2RDisplay Enable 2 Control RegisterxF135
R240DCRDefault Color Register70136
R241CAPVRCursor Absolute Vertical Position Register00136
R246TDPPRTDSRAM Page Pointer Registerx0136
R247TDHSPRTDSRAM Header/Status Pointer Registerx0136
R242ACQAD1RAcquisition Address Register 1xx163
R243ACQAD0RAcquisition Address Register 0xx163
R248ACQPORAcquisition Page Open Register00158
R249ACQMLRAcquisition Magazine Locked Register00158
R250ACQNHRRAcquisition New Header Received Register00158
R251ACQPRRAcquisition Packet Request Register00159
R252ACQTQMRAcquisition Teletext Quality Measure Register00159
R253ACQHD2RAcquisition Hamming Decoding Register 2xx160
R254ACQHD1RAcquisition Hamming Decoding Register 1xx160
R255ACQHD0RAcquisition Hamming Decoding Register 0xx160
R242SCCS0RSync Controller Control and Status Register 000144
R243SCCS1RSync Controller Control and Status Register 100145
R248TXSCRTeletext Slicer Control Register06163
R249TXSLIRTeletext Slicer Initialization Register0B164
R255PASRPre-Amplifier and ADC Selection Register00164
Register
Name
Description
Reset
Value
Hex.
Doc.
Page
22/249
ST92195C/D - GENERAL DESCRIPTION
Group F
Page
Dec.
36
38
39TCC
44I²C
55RCCU
Block
TDSRAM
1)
Reg.
No.
R240
..
R255
R240
..
R255
R240
..
R247
R248BUFCTDSRAM Buffer Control Register0892
R250MTBSA1Multi-byte Transfer Start Address Register 18091
R251MTBSA0Multi-byte Transfer Start Address Register 00091
R252CONFIGTDSRAM Interface Configuration Register0693
R251PXCCRPLL Clock Control Register0068
R252SLCCRSlicer Clock Control Register0068
R253MCCRMain Clock Control Register0067
R254SKCCRSkew Clock Control Register0067
R240C M0Compare Regis ter 0 0 0207
R241C M1Compare Regis ter 1 0 0207
R242C M2Compare Regis ter 2 0 0207
R243C M3Compare Regis ter 3 0 0207
R244C M4Compare Regis ter 4 0 0207
R245C M5Compare Regis ter 5 0 0207
R246C M6Compare Regis ter 6 0 0207
R247C M7Compare Regis ter 7 0 0207
R248ACRAutoclear RegisterFF208
R249CCRCounter Register00208
R250PCTLPrescaler and Control Register0C208
R251OCPLOutput Complement Register00209
R252OEROutput Enable Register00209
R254VSDR1Data and Control Register 100204
R255VSDR2Data Register 200204
R240ADDTR Channel i Data Registerxx199
R241ADCLRControl Logic Register00198
R242ADINT AD Interrupt Register 01199
Register
Name
Description
Reset
Value
Hex.
Doc.
Page
Note: xx denote s a by te wit h an u ndef ined v alue, howe ver s ome o f the bits m ay ha ve defined value s. Re fer to regis ter
description for details.
Note 1: Depending on device. See device summary on page 1.
24/249
2 DEVICE ARCHITECTUR E
2.1 CORE ARCHITECTURE
ST92195C/D - DEVICE ARCHITECTURE
The ST9 Core or Central Processing Unit (CPU)
features a highly optimised instruction set, capable
of handling bit, byte (8-bit) and word (16-bit) data,
as well as BCD and Boolean formats; 14 addressing modes are available.
Four independent buses are controlled by the
Core: a 16-bit Memory bus, an 8-bi t Registe r data
bus, an 8-bit Register ad dress bus an d a 6-bit Interrupt/DMA bus which connect s th e in terrupt an d
DMA controllers in the on-chip peripherals with the
Core.
This multiple bus architecture affords a high degree of pipelining and parallel operation, thus making the ST9 family devices highly efficient, both for
numerical calculation, data handling and with regard to communication with on-chip peripheral resources.
2.2 MEMORY SPACES
which hold data and control bits for the on-chip
peripherals and I/Os.
– A sing le linear memory space acc ommodating
both program and data. All of the physically separate memory areas, including the internal ROM,
internal RAM and ex ternal memory are mapped
in this common address space. The total addressable memory space of 4 Mbytes (limited by
the size of on-chip memory and the number of
external address pins) is arranged as 64 segments of 64 Kbytes. Each segment is further
subdivided into four pages of 16 Kbytes, as illustrated in Figure 1. A Memory Man agement Unit
uses a set of pointer registers to address a 22-bit
memory field using 16-bit address-based instructions.
2.2.1 Regist er File
The Register File consists of (see Figure 2):
– 224 general purpose registers (Group 0 to D,
There are two separate memory spaces:
– The Register File, which comprises 240 8-bit
registers, arranged as 15 groups (Group 0 to E),
each containing sixteen 8-bit registers plus up to
64 pages of 16 registers mapped in Group F,
registers R0 to R223)
– 6 system registers in the System Group (Group
E, registers R224 to R239)
– Up to 64 pages, depending on device configura-
tion, each containing up to 16 registers, mapped
to Group F (R240 to R255), see Figure 3.
Figure 7. Single Program and Data Memory Address Spac e
Data
Address16K Pages64K Segments
3FFFFFh
3F0000h
3EFFFFh
3E0000h
up to 4 Mbytes
255
254
253
252
251
250
249
248
247
Code
63
62
21FFFFh
210000h
20FFFFh
02FFFFh
020000h
01FFFFh
010000h
00FFFFh
000000h
Reserved
135
134
133
132
33
11
10
9
8
7
6
5
4
3
2
1
0
2
1
0
25/249
ST92195C/D - DEVICE ARCHITECTURE
MEMORY SPACES (Cont’d)
Figure 8. Regis te r Gr oupsFigure 9. Pag e Pointer for Group F m apping
255
F
PAGED REGISTERS
240
239
E
SYSTEM REGISTER S
224
223
D
C
B
A
9
8
7
6
5
4
3
2
1
0
00
15
UP TO
64 PAGES
224
GENERAL
PURPOSE
REGISTERS
VA00432
R255
R240
R234
R224
R0
PAGE 63
PAGE 5
PAGE 0
PAGE POINT ER
VA00433
Figure 10. Addressing the Register File
REGISTER FILE
255
240
239
224
223
PAGED REGISTERS
F
E
SYSTEM REGISTER S
D
C
B
A
9
8
7
6
5
4
3
2
1
0
00
15
R195
(R0C3h)
(1100)
GROU P D
R207
(0011)
GROUP C
R195
R192
GROUP B
VR000118
26/249
MEMORY SPACES (Cont’d)
2.2.2 Register Addressing
Register File registers, including Group F paged
registers (but excluding Group D), may be addressed explicitly by means of a decimal, hexadecimal or binary address; thus R231, RE7h and
R11100111b represent the same register (see
Figure 4). Group D registers can only be ad-
dressed in Working Register mode.
Note that an upper case “R” is used to denote this
direct addressing mode.
Working Re gi st ers
Certain types of instruction require that registers
be specified in the form “rx”, where x is in the
range 0 to 15: these are known as Working Registers.
Note that a lower case “r” is used to denote this indirect addressing mode.
Two addressing schemes are av ailable: a single
group of 16 working registers, or two separately
mapped groups, each consisting of 8 working registers. These groups may be mapped starting at
any 8 or 16 byte boundary in the register file by
means of dedicated pointer registers. This technique is described in more deta il in Section 1.3.3 ,
and illustrated in Figure 5 and in Figure 6.
System Registers
The 16 registers in Group E (R224 to R239) are
System registers and may be addressed using any
of the register addressing modes. Thes e registers
are described in greater detail in S ection 1.3.
Paged Registers
Up to 64 pages, each containing 16 registers, may
be mapped to G roup F. These are add ressed using any register addressing mode, in conjunctio n
with the Page Pointer register, R234, which is one
of the System registers. This register selects the
page to be mapped to Group F and, once set,
does not need to be changed if two or more registers on the same page are to be addressed in succession.
ST92195C/D - DEVICE ARCHITECTURE
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 of page 5 (R242).
These paged registers hold data and control information relating to the on-chip peripherals, each
peripheral always being associated with the sam e
pages and registers to ensure code com patibility
between ST9 devices. The number of these registers therefore depends on the peripherals which
are present in the s pecific ST9 family device. In
other words, pages only exist if the relevant peripheral is present.
Registers (Group E). The y are us ed to perform all
Note: If an MFT is not included in the ST9 device,
then this bit has no effect.
the important system settings. Their purpose is described in the following pages. Refer to the chapter
dealing with I/O for a description of the PORT[5:0]
Data registers.
PORT5 DATA REG.
PORT4 DATA REG.
PORT3 DATA REG.
PORT2 DATA REG.
PORT1 DATA REG.
PORT0 DATA REG.
Bit 6 = TLIP:
This bit is set by hardware when a Top Level Interrupt Request is recognized. This bit can also be
set by software to simulate a Top Level Interrupt
Request.
0: No Top Level Interrupt pending
1: Top Level Interrupt pending
Bit 5 = TLI:
0: Top Level Interrupt is acknowledged depending
on the TLNM bit in the NICR Register.
1: Top Level Interrupt is acknowledged depending
on the IEN and TLNM bits in the NICR Register
(described in the Interrupt chapter).
Bit 4 = IEN:
This bit is cleared by interrupt acknowledgement,
and set by interrupt return (iret). IEN is modified
implicitly by iret, ei and di instructions or by an
interrupt acknowledge cycle. It can also be explicitly written by the user, but only when no i nterrupt
is pending. Therefore, the user should execute a
di instruction (or guarantee by other means that
no interrupt request can arrive) before a ny write
operation to the CICR register.
Top Level Interrupt Pending
Top Level Interrupt bit
Interrupt Enable .
0: Disable all interrupts except Top Level Interrupt.
2.3.1 Central Interrupt Control Register
1: Enable Interrupts
Please refer to the ”INTERRUPT” chapter for a detailed description of the ST9 interrupt philosophy.
CENTRAL INTERRUPT CONTROL REGISTER
(CICR)
R230 - Read/Write
Register Group: E (System)
Bit 3 = IAM:
This bit is set and cleared by software to select the
arbitration mode.
0: Concurrent Mode
1: Nested Mode.
Interrupt Arbitration Mode
Reset Value: 1000 0111 (87h)
70
GCEN TLIP TLIIENIAMCPL2 CPL1 CPL0
Bits 2:0 = CPL[2:0]:
These three bits record the priority level of the routine currently running (i.e. the Current Priority Level, CPL). The highest priority level is represented
Current Priority Level
by 000, and the lowest by 111. The CPL bits can
Bit 7 = GCEN:
Global Counter Enable
.
This bit is the Global Counter Enable of the Multifunction Timers. The GCEN bit is ANDed with the
CE bit in the TCR Register (only in devices featuring the MFT Multifunction Timer) in order to enable
the Timers when both bits are set. This bit is set after the Reset cycle.
be set by hardware or software and provide the
reference according to which subsequent interrupts are either left pending or are allowed to interrupt the current interrupt service routine. When the
current interrupt is replaced by one of a higher priority, the current priority value is automatically
stored until required in the NICR register.
.
.
.
.
28/249
SYSTEM REGI STE R S (Cont’d)
2.3.2 Flag Register
The Flag Register contains 8 flags which indicate
the CPU status. During an interrupt, the flag register is automatically stored in the system stack area
and recalled at the end of the interrupt service routine, thus returning the CPU to its original status.
This occurs for all interrupts and, wh en operating
in nested mode, up to seven versions of the flag
register may be stored.
complement number, in a result register, is in error, since it has exceeded the largest (or is less
than the smallest), number that can be represented in two’s-complement notation.
Compare (cp, cpw),
Shift Right Arithmetic (sra, sraw),
Shift Left A r ith me t ic (sla, slaw),
Swap Nibbles (swap),
Rotate (rrc, rrcw, rlc, rlcw, ror,rol),
Decimal Adjust (da),
Multiply and Divide (mul, div, divws).
When set, it generally indicates a carry out of the
most significant bit position of the register being
used as an accumulator (bit 7 for byte operations
Bit 3 = DA:
Decimal Adjust Flag
The DA flag is used f or BCD arithm et ic. Si nce t he
algorithm for correcting BCD operations i s different for addition and subtraction, this flag is used to
specify which type of instruction was executed
last, so that the subsequen t Decimal Adjust (da)
operation can perform its function correctly. The
DA flag cannot normally be u sed as a test condition by the programmer.
and bit 15 for word operations).
The carry flag can be set by the S et Carry Flag
(scf ) instruction, cleared by the Reset Carry Flag
(rcf) instruction, and complemented by the Complement Carry Flag (ccf) instruction.
Bit 2 = H:
Half Carry Flag.
The H flag indicates a carry out of (or a borrow into) bit 3, as the resu lt of addin g or subt racti ng tw o
8-bit bytes, each representing two BCD digits. The
H flag is used by the Dec imal Adjust (da) instruc-
tion to convert the binary result of a previous addi-
Bit 6 = Z:
Zero Flag
. The Zero flag is affected by:
Addition (add, addw, adc, adcw),
Subtraction (sub, subw, sbc, sbcw),
tion or subtraction into the correct BCD result. Like
the DA flag, this flag is not norma lly accessed by
the user.
Compare (cp, cpw),
Shift Right Arithmetic (sra, sraw),
Shift Left A r ith me t ic (sla, slaw),
Bit 1 = Reserved bit (must be 0).
Swap Nibbles (swap),
This bit indicates the memory area addressed . Its
value is affected by the Set Data Memory (sdm)
and Set Program Mem ory (spm) instructions. Re-
fer to the Memory Management Unit for further de-
tails.
Data/Program Memory Flag
.
.
29/249
ST92195C/D - DEVICE ARCHITECTURE
SYSTEM REGI STE R S (Cont’d)
If the bit is set, dat a is accessed using the Data
Pointers (DPRs registers), otherwise it is pointed
to by the Code Pointer (CSR regist er); therefore,
the user initialization routine must include a Sdm
instruction. Note that code is always poi nted to by
the Code Pointer (CSR).
Note: In the current ST9 devices, the DP flag is
only for co mpatibility wit h software d eveloped for
the first generation of ST9 devices. With the single
memory addressing space, its us e is now redundant. It must be kept to 1 w ith a Sdm instruction at
the beginning of the program to ens ure a normal
use of the different memory pointers.
2.3.3 Register Pointing Techniques
Two registers within the System register group,
are used as pointers to the working registers. Register Pointer 0 (R232) may be used on its own as a
single pointer to a 16-register working space, or in
conjunction with Register Pointer 1 (R233), to
point to two separate 8-register spaces.
For the purpose of register pointing, the 16 register
groups of the register file are subdivided into 32 8register blocks. The values specified with the Set
Register Pointer instructions refer to the blocks to
be pointed to in twin 8-register mode, or to the lower 8-register block location in single 16-register
mode.
The Set Registe r Pointer instructions srp, srp0
and srp1 automatically inform the C PU whether
the Register File is to operate in single 16-register
mode or in twin 8-register mode. The srp instruction selects the single 16-register group mode and
specifies the location of the lower 8-register block,
while the srp0 and srp1 instructions automatical-
ly select the twin 8-register group mode and spec-
ify the locations of each 8-register block.
There is no limitation on the order or position of
these register groups, other than that they must
start on an 8-register boundary i n twin 8-register
mode, or on a 16-register boundary in single 16-
register mode.
The block number should always be an even
number in single 16-re gister mode. The 16-regis-
ter group will always start at the block whose
number is the nearest even number equal to or
lower than the block number specified in the srp
instruction. Avoid using odd block numbers , since
this can be confusing if twin mode is subsequently
selected.
Thus:
srp #3 will be interpreted as srp #2 and will al-
low using R16 ..R31 as r0 .. r15.
In single 16-register mode , the working registers
are referred to as r0 to r15. In twin 8-register
mode, registers r0 to r7 are in the block pointed
to by RP0 (by means of the srp0 instruction),
while registers r8 to r15 are in the block pointed
to by RP1 (by means of the srp1 instruction).
Caution:
Group D registers can only be accessed
as working registers using the Register Pointers,
or by means of the Stack Pointers. They cannot be
addressed explicitly in the form “Rxxx”.
30/249
Loading...
+ 219 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.