The ST7ULTRALITE is a member of the ST7 microcontroller family. All ST7 devices are
based on a common industry-standard 8-bit core, featuring an enhanced instruction set.
The ST7ULTRALITE features Flash memory with byte-by-byte in-circuit programming (ICP)
and in-application programming (IAP) capability.
Under software control, the ST7ULTRALITE device can be placed in Wait, Slow, or Halt
mode, reducing power consumption when the application is in idle or standby state.
The enhanced instruction set and addressing modes of the ST7 offer both power and
flexibility to software developers, enabling the design of highly efficient and compact
application code. In addition to standard 8-bit data management, all ST7 microcontrollers
feature true bit manipulation, 8x8 unsigned multiplication and indirect addressing modes.
For easy reference, all parametric data are located in Section 13 on page 95.
The devices feature an on-chip Debug Module (DM) to support in-circuit debugging (ICD).
For a description of the DM registers, refer to the ST7 ICC Protocol Reference Manual.
Figure 1.General block diagram
12/139
ST7LITEU05 ST7LITEU09Pin description
V
DD
PA5 (HS) / AIN4 / CLKIN
PA3 / R E S ET
V
SS
PA0 (HS) / AIN0 / ATPWM / ICCDATA
PA 2 (HS) / LTIC / AIN2
PA1 (HS) / AIN1 / ICCCLK
PA4 (HS) / AIN3 / MCO
1
2
3
4
8
7
6
5
ei4
ei3
ei2
ei1
ei0
V
DD
PA5 (HS) / AIN4 / CLKIN
PA3 / RESET
V
SS
PA0 (HS) / AIN0 / ATPWM / ICCDATA
PA 2 (HS) / LTIC / AIN2
PA1 (HS) / AIN1 / ICCCLK
PA4 (HS) / AIN3 / MCO
1
2
3
4
8
7
6
5
ei4
ei3
ei2
ei1
ei0
2 Pin description
Figure 2.8-pin SO and DIP package pinout
1. HS : High sink capability
2. eix : associated external interrupt vector
Figure 3.8-pin DFN package pinout
1. HS : High sink capability
2. eix : associated external interrupt vector
13/139
Pin descriptionST7LITEU05 ST7LITEU09
Reserved
2)
V
DD
ICCCLK
NC
V
SS
PA1 (HS) / AIN1
PA0 (HS) / AIN0 / ATPWM
RESET
1
2
3
4
1
1
1
1
ei4
ei3
ei1
ei0
PA5 (HS) / AIN4 / CLKIN
PA4 (HS) / AIN3 / MCO
NC
NC
ICCDATA
NC
PA 2 (HS) / LTIC / AIN2
PA 3
5
7
6
8
12
11
10
9
ei2
Figure 4.16-pin package pinout
1. For development or tool prototyping purposes only.
Package not orderable in production quantities.
2. Must be tied to ground
1)
Note:The differences versus the 8-pin packages are listed below:
The ICC signals (ICCCLK and ICCDATA) are mapped on dedicated pins;
The RESET signal is mapped on a dedicated pin. It is not multiplexed with PA3.
PA3 pin is always configured as output. Any change on multiplexed IO reset control registers
(MUXCR1 and MUXCR2) will have no effect on PA3 functionality. Refer to “Register
description” on page 41.
14/139
ST7LITEU05 ST7LITEU09Pin description
Legend / Abbreviations for Tab le 2 :
Type: I = input, O = output, S = supply
In/Output level: C
= CMOS 0.3 V
T
/0.7 VDD with input trigger
DD
Output level: HS = High sink (on N-buffer only)
Port and control configuration:
●Input: float = floating, wpu = weak pull-up, int = interrupt, ana = analog
●Output: OD = open drain, PP = push-pull
The RESET configuration of each pin is shown in bold which is valid as long as the device is
in reset state.
Table 2.Device pin description
LevelPort / Control
InputOutput
int
float
wpu
ana
OD
Pin No.
1V
DD
Pin Name
(1)
Type
Input
Output
S Main power supply
2PA5/AIN4/CLKINI/O CTHSXei4XXXPort A5
3PA4/AIN3/MCOI/O C
(2)
4PA3/RESET
O XXXPort A3RESET
HSXei3XXXPort A4
T
5PA2/AIN2/LTICI/O CTHSXei2XXXPort A2
6PA1/AIN1/ICCCLKI/O C
HSXei1XXXPort A1
T
function
(after
reset)
PP
main
Alternate function
Analog input 4 or external clock
input
Analog input 3 or main clock
output
(2)
Analog input 2 or lite timer input
capture
Analog input 1 or In Circuit
Communication Clock
Caution: During normal
operation this pin must be pulledup, internally or externally
(external pull-up of 10k
mandatory in noisy
environment). This is to avoid
entering ICC mode unexpectedly
during a reset. In the application,
even if the pin is configured as
output, any reset will put it back
in pull-up
PA 0/ A IN 0 / ATP W M /
7
ICCDATA
8V
1. It is mandatory to connect all available VDD and V
2. After a reset, the multiplexed PA3/RESET pin will act as RESET
(1)
SS
MUXCR0 and AAh to MUXCR1. For further details, please refer to Section 7.5 on page 41.
I/O C
S Ground
HSXei0XXXPort A0
T
pins to the supply voltage and all VSS and V
DDA
. To configure this pin as output (Port A3), write 55h to
Analog input 0 or Auto-Reload
Timer PWM or In Circuit
Communication Data
pins to ground.
SSA
15/139
Register & memory mapST7LITEU05 ST7LITEU09
0000h
RAM
Flash memory
(2K)
Interrupt & reset vectors
HW registers
0080h
007Fh
(see Ta bl e )
FFE0h
FFFFh
(see Ta b le 10 )
0100h
00FFh
Short addressing
RAM (zero page)
64-Byte Stack
00FFh
0080h
00C0h
(128 Bytes)
F800h
F7FFh
Reserved
FFDFh
1 Kbyte
1 Kbyte
SECTOR 1
SECTOR 0
2K FLASH
FFFFh
FC00h
FBFFh
F800h
PROGRAM MEMORY
DEE0h
1)
RCCRH0
RCCRL0
DEE1h
RCCRH1
RCCRL1
DEE2h
DEE3h
Data
EEPROM
1080h
107Fh
1000h
0FFFh
Reserved
(128 Bytes)
3 Register & memory map
As shown in Figure 5, the MCU is capable of addressing 64 Kbytes of memories and I/O
registers.
The available memory locations consist of 128 bytes of register locations, 128 bytes of RAM
and 1 Kbyte of user program memory. The RAM space includesup to 64 bytes for the stack
from 00C0h to 00FFh.
The highest address bytes contain the user reset and interrupt vectors.
The Flash memory contains two sectors (see Figure 5) mapped in the upper part of the ST7
addressing space so the reset and interrupt vectors are located in Sector 0 (FC00-FFFFh).
The size of Flash Sector 0 and other device options are configurable by Option byte.
Important: Memory locations marked as “Reserved” must never be accessed. Accessing a
reseved area can have unpredictable effects on the device.
Figure 5.Memory map
Note:DEE0h, DEE1h, DEE2h and DEE3h addresses are located in a reserved area but are
1. see Section 7.2 on page 32.
special bytes containing also the RC calibration values which are read-accessible only in
user mode. If all the EEPROM data or Flash space (including the RC calibration values
16/139
locations) has been erased (after the readout protection removal), then the RC calibration
values can still be obtained through these addresses.
ST7LITEU05 ST7LITEU09Register & memory map
Table 3.Hardware register map
AddressBlockRegister labelRegister name
0000h
0001h
0002h
0003h to
000Ah
000Bh
000Ch
000Dh
000Eh
000Fh
0010h
0011h
0012h
0013h
0014h to
0016h
0017h
0018h
0019h to
002Eh
Por t A
Lite
timer
Auto-reload
timer
Auto-reload
timer
PA DR
PADDR
PA OR
LT CS R
LT IC R
AT CS R
CNTRH
CNTRL
AT RH
AT RL
PWMCR
PWM0CSR
DCR0H
DCR0L
Port A data register
Port A data direction register
Port A option register
Reserved area (8 bytes)
Lite timer control/status register
Lite timer input capture register
Timer control/status register
Counter register high
Counter register low
Auto-reload register high
Auto-reload register low
PWM output control register
PWM 0 control/status register
Mux IO-reset control register 0
Mux IO-reset control register 1
00h
00h
R/W
R/W
17/139
Register & memory mapST7LITEU05 ST7LITEU09
Table 3.Hardware register map (continued)
AddressBlockRegister labelRegister name
0049h
004Ah
AWU
004Bh
004Ch
004Dh
004Eh
DM
(4)
004Fh
0050h
0051h to
007Fh
1. Legend: x=undefined, R/W=read/write
2. The contents of the I/O port DR registers are readable only in output configuration. In input configuration, the values of the
I/O pins are returned instead of the DR register contents.
3. The bits associated with unavailable pins must always keep their reset value.
4. For a description of the DM registers, see the ST7 ICC Protocol Reference Manual.
DM control register
DM status register
DM breakpoint register 1 high
DM breakpoint register 1 low
DM breakpoint register 2 high
DM breakpoint register 2 low
Reserved area (47 bytes)
Reset
status
FFh
00h
00h
00h
00h
00h
00h
00h
(1)
Remarks
(1)
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
18/139
ST7LITEU05 ST7LITEU09Flash program memory
4 Flash program memory
4.1 Introduction
The ST7 single voltage extended Flash (XFlash) is a non-volatile memory that can be
electrically erased and programmed either on a byte-by-byte basis or up to 32 bytes in
parallel.
The XFlash devices can be programmed off-board (plugged in a programming tool) or onboard using In-Circuit Programming or In-Application Programming.
The array matrix organisation allows each sector to be erased and reprogrammed without
affecting other sectors.
4.2 Main features
●ICP (In-circuit programming)
●IAP (In-application programming)
●ICT (In-circuit testing) for downloading and executing user application test patterns in
RAM
●Sector 0 size configurable by option byte
●Readout and write protection
4.3 Programming modes
The ST7 can be programmed in three different ways:
●Insertion in a programming tool. In this mode, Flash sectors 0 and 1 and option byte
row can be programmed or erased.
●In-Circuit Programming. In this mode, Flash sectors 0 and 1 and option byte row can be
programmed or erased without removing the device from the application board.
●In-application programming. In this mode, sector 1 can be programmed or erased
without removing the device from the application board and while the application is
running.
4.3.1 In-circuit programming (ICP)
ICP uses a protocol called ICC (in-circuit communication) which allows an ST7 plugged on a
printed circuit board (PCB) to communicate with an external programming device connected
via cable. ICP is performed in three steps:
●Switch the ST7 to ICC mode (in-circuit communications). This is done by driving a
specific signal sequence on the ICCCLK/DATA pins while the RESET
When the ST7 enters ICC mode, it fetches a specific RESET vector which points to the
ST7 system memory containing the ICC protocol routine. This routine enables the ST7
to receive bytes from the ICC interface.
●Download ICP driver code in RAM from the ICCDATA pin
●Execute ICP driver code in RAM to program the Flash memory
pin is pulled low.
19/139
Flash program memoryST7LITEU05 ST7LITEU09
ICC CONNECTOR
ICCDATA
ICCCLK
RESET
V
DD
HE10 CONNECTOR TYPE
APPLICATION
POWER SUPPLY
1
246810
97 5 3
PROGRAMMING TOOL
ICC CONNECTOR
APPLICATION BOARD
ICC Cable
(See Note 3)
ST7
CLKIN
OPTIONAL
See Note 1
See Note 1 and Caution
See Note 2
APPLICATION
RESET SOURCE
APPLICATION
I/O
(See Note 4)
3.3kΩ
(See Note 5)
Depending on the ICP Driver code downloaded in RAM, Flash memory programming can
be fully customized (number of bytes to program, program locations, or selection of the
serial communication interface for downloading).
4.3.2 In Application Programming (IAP)
This mode uses an IAP driver program previously programmed in sector 0 by the user (in
ICP mode).
This mode is fully controlled by user software. This allows it to be adapted to the user
application, (user-defined strategy for entering programming mode, choice of
communications protocol used to fetch the data to be stored etc.)
IAP mode can be used to program any memory areas except sector 0, which is write/erase
protected to allow recovery in case errors occur during the programming operation.
4.4 ICC interface
ICP needs a minimum of 4 and up to 6 pins to be connected to the programming tool. These
pins are:
●RESET: device reset
●V
●ICCCLK: ICC output serial clock pin (see note 1)
●ICCDATA: ICC input serial data pin
●CLKIN: main clock input for external source
●V
: device power supply ground
SS
: application board power supply (see note 3)
DD
Figure 6.Typical ICC interface
1. If the ICCCLK or ICCDATA pins are only usedas outputs in the application, no signal isolation is necessary.
As soon as the programming tool isplugged to the board, even if an ICC session is not in progress, the
ICCCLK and ICCDATA pins arenot available for the application. If they are used as inputs by the
application, isolation such as a serial resistor has to be implemented in case another device forces the
signal. Refer to the programmingtool documentation for recommended resistor values.
2. During the ICP session, the programming tool must control the RESET
between the programming tool and the application reset circuit if it drives more than 5 mA at high level
(push pull output or pull-up resistor < 1K). A schottky diode can be used to isolate the application RESET
circuit in this case. When using a classical RC network with R>1K or a reset management IC with open
drain output and pull-up resistor >1 K, no additional components are needed. In all cases the user must
20/139
pin. This can lead to conflicts
ST7LITEU05 ST7LITEU09Flash program memory
ensure that no external reset is generated by the application during the ICC session.
3. The use of Pin 7 of the ICC connector depends on the programming tool architecture. This pin must be
connected when using most ST programming tools (it is used to monitor the application power supply).
Please refer to the programming tool manual.
4. Pin 9 has to be connected to the CLKIN pin of the ST7 when ICC mode is selected with option bytes
disabled (35-pulse ICC entry mode). When option bytes are enabled (38-pulse ICC entry mode), the
internal RC clock is forced, regardless of the selection in the option byte.
5. A serial resistor must be connected to ICC connector pin 6 in order to prevent contention on PA3/RESET
pin. Contention may occur if a tool forces a state on RESET pin while PA3 pin forces the opposite state in
output mode. The resistor value is defined to limit the current below 2 mA at 5 V. If PA3 is used as output
push-pull, then the application must be switched off to allow the tool to take control of the RESET pin
(PA3). To allow the programming tool to drive the RESET pin below V
when a pull-up is placed on PA3 for application reasons.
, special care must also be taken
IL
Caution:During normal operation, ICCCLK pin must be pulled- up, internally or externally (external
pull-up of 10k mandatory in noisy environment). This is to avoid entering ICC mode
unexpectedly during a reset. In the application, even if the pin is configured as output, any
reset will put it back in input pull-up.
4.5 Memory protection
There are two different types of memory protection: readout protection and write/erase
protection which can be applied individually.
4.5.1 Readout protection
Readout protection, when selected provides a protection against program memory content
extraction and against write access to Flash memory. Even if no protection can be
considered as totally unbreakable, the feature provides a very high level of protection for a
general purpose microcontroller. Program memory is protected.
In Flash devices, this protection is removed by reprogramming the option. In this case,
program memory is automatically erased, and the device can be reprogrammed.
Readout protection selection depends on the device type:
●In Flash devices it is enabled and removed through the FMP_R bit in the option byte.
●In ROM devices it is enabled by mask option specified in the option list.
4.5.2 Flash write/erase protection
Write/erase protection, when set, makes it impossible to both overwrite and erase program
memory. Its purpose is to provide advanced security to applications and prevent any change
being made to the memory content.
Warning:Once set, Write/erase protection can never be removed. A
write-protected flash device is no longer reprogrammable.
Write/erase protection is enabled through the FMP_W bit in the option byte.
21/139
Flash program memoryST7LITEU05 ST7LITEU09
4.6 Related documentation
For details on Flash programming and ICC protocol, refer to the ST7 Flash Programming
Reference Manual and to the ST7 ICC Protocol Reference Manual
.
4.7 Register description
4.7.1 Flash control/status register (FCSR)
This register controls the XFlash erasing and programming using ICP, IAP or other
programming methods.
1st RASS Key: 0101 0110 (56h)
2nd RASS Key: 1010 1110 (AEh)
When an EPB or another programming tool is used (in socket or ICP mode), the RASS keys
are sent automatically.
Reset value: 000 0000 (00h)
70
Address
(Hex.)
002Fh
00000OPTLATPGM
Read/write
Register
label
FCSR
Reset Value
76543210
-
0
-
0
-
0
-
0
-
0
OPT
0
LAT
0
PGM
0
22/139
ST7LITEU05 ST7LITEU09Data EEPROM
EECSR
HIGH VOLTAGE
PUMP
0 E2LAT00000E2PGM
EEPROM
MEMORY MATRIX
(1 ROW = 32 x 8 BITS)
ADDRESS
DECODER
DATA
MULTIPLEXER
32 x 8 BITS
DATA LATCHES
ROW
DECODER
DATA BUS
4
4
4
128128
ADDRESS BUS
5 Data EEPROM
5.1 Introduction
The electrically erasable programmable read only memory can be used as a non volatile
back-up for storing data. Using the EEPROM requires a basic access protocol described in
this chapter.
5.2 Main features
●Up to 32 bytes programmed in the same cycle
●EEPROM mono-voltage (charge pump)
●Chained erase and programming cycles
●Internal control of the global programming cycle duration
●Wait mode management
●Readout protection
Figure 7.EEPROM block diagram
5.3 Memory access
The data EEPROM memory read/write access modes are controlled by the E2LAT bit of the
EEPROM Control/Status register (EECSR). The flowchart in Figure 8 describes these
different memory access modes.
5.3.1 Read operation (E2LAT=0)
The EEPROM can be read as a normal ROM location when the E2LAT bit of the EECSR
register is cleared.
23/139
Data EEPROMST7LITEU05 ST7LITEU09
READ MODE
E2LAT=0
E2PGM=0
WRITE MODE
E2LAT=1
E2PGM=0
READ BYTES
IN EEPROM AREA
WRITE UP TO 32 BYTES
IN EEPROM AREA
(with the same 11 MSB of the address)
START PROGRAMMING CYCLE
E2LAT=1
E2PGM=1 (set by software)
E2LAT
01
CLEARED BY HARDWARE
On this device, data EEPROM can also be used to execute machine code. Take care not to
write to the data EEPROM while executing from it. This would result in an unexpected code
being executed.
5.3.2 Write operation (E2LAT=1)
To access the write mode, the E2LAT bit has to be set by software (the E2PGM bit remains
cleared). When a write access to the EEPROM area occurs, the value is latched inside the
32 data latches according to its address.
When PGM bit is set by the software, all the previous bytes written in the data latches (up to
32) are programmed in the EEPROM cells. The effective high address (row) is determined
by the last EEPROM write sequence. To avoid wrong programming, the user must take care
that all the bytes written between two programming sequences have the same high address:
only the five Least Significant Bits of the address can change.
At the end of the programming cycle, the PGM and LAT bits are cleared simultaneously.
Note:Care should be taken during the programming cycle. Writing to the same memory location
will over-program the memory (logical AND between the two write access data result)
because the data latches are only cleared at the end of the programming cycle and by the
falling edge of the E2LAT bit. It is not possible to read the latched data.
This note is ilustrated by the Figure 10.
Figure 8.Data EEPROM programming flowchart
24/139
ST7LITEU05 ST7LITEU09Data EEPROM
Byte 1 Byte 2Byte 32
PHASE 1
Programming cycle
Read operation impossible
PHASE 2
Read operation possible
E2LAT bit
E2PGM bit
Writing data latchesWaiting E2PGM and E2LAT to fall
Set by USER application
Cleared by hardware
⇓ Row / byte ⇒0123 ... 30 31 Physical address
000h...1Fh
120h...3Fh
...
NNx20h...Nx20h+1Fh
ROW
DEFINITION
Figure 9.Data EEPROM write operation
1. If a programming cycle is interrupted (by a reset action), the integrity of the data in memory is not
guaranteed.
5.4 Power saving modes
5.4.1 Wait mode
The data EEPROM can enter Wait mode on execution of the WFI instruction of the
microcontroller or when the microcontroller enters Active-Halt mode.The DATA EEPROM
will immediately enter this mode if there is no programming in progress, otherwise the data
EEPROM will finish the cycle and then enter Wait mode.
5.4.2 Active-halt mode
Refer to Wait mode.
5.4.3 Halt mode
The data EEPROM immediately enters Halt mode if the microcontroller executes the HALT
instruction. Therefore the EEPROM will stop the function in progress, and data may be
corrupted.
5.5 Access error handling
If a read access occurs while E2LAT=1, then the data bus will not be driven.
If a write access occurs while E2LAT=0, then the data on the bus will not be latched.
If a programming cycle is interrupted (by a Reset action), the integrity of the data in memory
will not be guaranteed.
25/139
Data EEPROMST7LITEU05 ST7LITEU09
LAT
ERASE CYCLEWRITE CYCLE
PGM
t
PROG
Read operation not possible
WRITE OF
DATA LATCHES
Read operation possible
Internal
programming
voltage
5.6 Data EEPROM readout protection
The readout protection is enabled through an option bit (see option byte section).
When this option is selected, the programs and data stored in the EEPROM memory are
protected against readout (including a re-write protection). In Flash devices, when this
protection is removed by reprogramming the option byte, the entire Program memory and
EEPROM is first automatically erased.
Note:Both program memory and data EEPROM are protected using the same option bit.
Figure 10. Data EEPROM programming cycle
5.7 Register description
5.7.1 EEPROM control/status register (EECSR)
Address: 0030h
Reset value: 0000 0000 (00h)
70
000000E2LATE2PGM
Read/write
Bits 7:2 = Reserved, forced by hardware to 0
Bit 1 = E2LAT Latch access transfer bit:
This bit is set by software. It is cleared by hardware at the end of the programming
cycle. It can only be cleared by software if the E2PGM bit is cleared
0: Read mode
1: Write mode
Bit 0 = E2PGM Programming control and status bit
This bit is set by software to begin the programming cycle. At the end of the
programming cycle, this bit is cleared by hardware.
0: Programming finished or not yet started
1: Programming cycle is in progress
Note:If the E2PGM bit is cleared during the programming cycle, the memory data is not
guaranteed.
26/139
ST7LITEU05 ST7LITEU09Data EEPROM
Table 4.Data EEPROM register map and reset values
Address
(Hex.)
0030h
Register
Label
EECSR
Reset Value
76543210
E2LAT0E2PGM
000000
0
27/139
Central processing unitST7LITEU05 ST7LITEU09
6 Central processing unit
6.1 Introduction
This CPU has a full 8-bit architecture and contains six internal registers allowing efficient 8bit data manipulation.
6.2 Main features
●63 basic instructions
●Fast 8-bit by 8-bit multiply
●17 main addressing modes
●Two 8-bit index registers
●16-bit stack pointer
●Low power modes
●Maskable hardware interrupts
●Non-maskable software interrupt
6.3 CPU registers
The six CPU registers shown in Figure 11 are not present in the memory mapping and are
accessed by specific instructions.
6.3.1 Accumulator (A)
The accumulator is an 8-bit general purpose register used to hold operands and the results
of the arithmetic and logic calculations and to manipulate data.
6.3.2 Index registers (X and Y)
In indexed addressing modes, these 8-bit registers are used to create either effective
addresses or temporary storage areas for data manipulation. (The cross-assembler
generates a precede instruction (PRE) to indicate that the following instruction refers to the
Y register.)
The Y register is not affected by the interrupt automatic procedures (not pushed to and
popped from the stack).
6.3.3 Program counter (PC)
The program counter is a 16-bit register containing the address of the next instruction to be
executed by the CPU. It is made of two 8-bit registers PCL (program counter low which is
the LSB) and PCH (Program Counter High which is the MSB).
28/139
ST7LITEU05 ST7LITEU09Central processing unit
ACCUMULATOR
X INDEX REGISTER
Y INDEX REGISTER
STACK POINTER
CONDITION CODE REGISTER
PROGRAM COUNTER
70
1C11HI NZ
RESET VALUE = RESET VECTOR @ FFFEh-FFFFh
70
70
70
0
7
158
PCH
PCL
15
8
70
RESET VALUE = STACK HIGHER ADDRESS
RESET VALUE =
1X1 1 X1 XX
RESET VALUE = XXh
RESET VALUE = XXh
RESET VALUE = XXh
Figure 11. CPU registers
1. X = undefined value
6.3.4 Condition code register (CC)
The 8-bit condition code register contains the interrupt mask and four flags representative of
the result of the instruction just executed. This register can also be handled by the PUSH
and POP instructions.
Reset value: 111x 1xxx
70
111H INZC
These bits can be individually tested and/or controlled by specific instructions.
Bit 4 = H Half carry bit
This bit is set by hardware when a carry occurs between bits 3 and 4 of the ALU during
an ADD or ADC instruction. It is reset by hardware during the same instructions.
0: No half carry has occurred.
1: A half carry has occurred.
This bit is tested using the JRH or JRNH instruction. The H bit is useful in BCD
arithmetic subroutines.
Bit 3 = I Interrupt mask
This bit is set by hardware when entering in interrupt or by software to disable all
interrupts except the TRAP software interrupt. This bit is cleared by software.
0: Interrupts are enabled.
1: Interrupts are disabled.
This bit is controlled by the RIM, SIM and IRET instructions and is tested by the JRM
and JRNM instructions.
bit
Read/write
29/139
Central processing unitST7LITEU05 ST7LITEU09
Note:Interrupts requested while I is set are latched and can be processed when I is cleared. By
default an interrupt routine is not interruptible because the I bit is set by hardware at the start
of the routine and reset by the IRET instruction at the end of the routine. If the I bit is cleared
by software in the interrupt routine, pending interrupts are serviced regardless of the priority
level of the current interrupt routine.
Bit 2 = N Negative bit
This bit is set and cleared by hardware. It is representative of the result sign of the last
arithmetic, logical or data manipulation. It is a copy of the 7
th
bit of the result.
0: The result of the last operation is positive or null.
1: The result of the last operation is negative (that is, the most significant bit is a logic
1).
This bit is accessed by the JRMI and JRPL instructions.
Bit 1 = ZZero bit
This bit is set and cleared by hardware. This bit indicates that the result of the last
arithmetic, logical or data manipulation is zero.
0: The result of the last operation is different from zero.
1: The result of the last operation is zero.
This bit is accessed by the JREQ and JRNE test instructions.
Bit 0 = C Carry/borrow
This bit is set and cleared by hardware and software. It indicates an overflow or an
underflow has occurred during the last arithmetic operation.
0: No overflow or underflow has occurred.
1: An overflow or underflow has occurred.
This bit is driven by the SCF and RCF instructions and tested by the JRC and JRNC
instructions. It is also affected by the “bit test and branch”, shift and rotate instructions.
6.3.5 Stack pointer (SP)
Reset Value: 00 FFh
158
00000000
70
11SP5SP4SP3SP2SP1SP0
The stack pointer is a 16-bit register which is always pointing to the next free location in the
stack. It is then decremented after data has been pushed onto the stack and incremented
before data is popped from the stack (see Figure 12).
bit
Read/write
Read/write
Since the stack is 64 bytes deep, the 10 most significant bits are forced by hardware.
Following an MCU Reset, or after a Reset Stack Pointer instruction (RSP), the Stack Pointer
contains its reset value (the SP5 to SP0 bits are set) which is the stack higher address.
30/139
Loading...
+ 109 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.