• Section 10.12.1, revised as follows:
– Moved the figure titled "KBI block diagram" to Section 10.12.2.1 prior to Table 36.
– Moved the figure titled "External interrupt logic" to Section 10.12.2.4 prior to Table 42.
– Figure 14, revised image.
– Table 23, in the "Pull enable" row, revised the "x" in the "KBI pin enable" column to "0".
• Section 10.12.1.1, revised as follows:
– Removed second paragraph starting with "PTA[4:0] pins are shared with on-chip
• Section 4.2, replaced table titled "CodeH - hardware configuration encoding" with a
paragraph and bullets.
• Section 4.3: revised as follows:
– Table 2, bits 7 through 0, removed table 2 reference for CODEF, removed table 3
reference for CODEH and replaced references with "Consult the appropriate NTM88
product data sheet for a description."
– Revised "ID27 — 0 to identify NTM88 family" to "ID27 — 1 to identify NTM88 family."
• Section 5.1, Table 3: Revised footnote 5.
• Section 6: revised the first paragraph.
• Section 6, Figure 2, revised the figure caption.
• Section 7, added introductory paragraph.
• Section 7.1: Revised the image in Figure 3.
• Section 7.2, Table 5: Revised the symbols for pins 1 through 6 from "NC" to "n.c." to
support changes made to the image in Figure 3.
• Section 10.1.1, Table 15, revised as follows
– Address $0008, revised all entries to "reserved."
– Address $1809, revised Bit1 to "reserved."
– Address $180C, revised Bit3, Bit2, and Bit0 to "reserved."
– Address $FDFF, revised Bit7 to "ID31," Bit6 to "ID30," Bit5 to "ID29," and Bit4 to "ID28."
• Removed the section titled "Port input filter enable register (PORTIFE)" that followed
Section 10.12.1.7.
• Section 10.16.9, Figure 38: revised the figure.
• Section 10.16.11.12, revised as follows:
– Table 128, revised "Reset ($00)" to "Reset ($40) and the "TIMEOUT0" bit from "0" to "1".
– Table 129, revised the description for 7:6.
• Section 10.19, Figure 44: revised the figure.
• Section 10.19.1: revised as follows:
– Revised the last sentence before Table 145.
– Table 145: Added "Stop4 entry not recommended." to the "Comments" for "Direct"
This user manual describes the features, architecture, and programming model of the
NTM88 family of devices.
1.2 Audience
This document is primarily for system architects and software application developers who
are using or considering the use of the NTM88 in a system.
2General description
The NTM88 is a small (4 mm x 4 mm x 1.98 mm), fully integrated tire pressure monitoring
sensor (TPMS). It also provides low transmitting power consumption, large customer
memory size, and a choice of either dual- or single-axis accelerometer architecture.
The NTM88 TPMS solution integrates an 8-bit microcontroller (MCU), pressure sensor,
accelerometer, and RF transmitter.
UM11227
NTM88 family of tire pressure monitor sensors
3Features and benefits
• Optional pressure ranges
• Optional single- or dual-axis accelerometer ranges
• Transducer measurement interfaces with low-power AFE:
– 10-bit compensated pressure sense element
– 10-bit compensated accelerometers
– 8-bit compensated internal device temperature measurement
– 8-bit compensated internal device voltage measurement
– Two I/O pins can be used for external signals
• 8-bit S08 compact instruction set controller:
– 64 bytes low-power “always on“ NVM parameter registers
– 512 bytes SRAM
– 16 kB flash memory (512 bytes reserved for NXP coefficients)
– Family of NXP firmware libraries available via royalty-free license
• Programmable RF transmitter
– Characterized for RF carrier typical of 315 MHz or 434 MHz
– Characterized for FSK in ~3 kHz increments or OOK modulation
– Characterized for baud rate examples of 9.6 kbp/s, 19.2 kbp/s, and 38.4 kbp/s
• Flexible 125 kHz LF receiver:
– Capability for ASK or OOK demodulation
– Automated Manchester decoding
• Two channel timer / pulse-width module
• Client SPI to support host access to internal peripherals, registers, and memory
• Seven GPIOs with programmable multiplexing to support software development,
external ADC input, timer, SPI, and wake-up
• Qualified in compliance with AEC-Q100, Rev. H
1
1
1 Consult NXP sales for details or specific requests.
• Internal oscillators
– MCU bus clock of 0.5, 1, 2, and 4 MHz (1, 2, 4, and 8 MHz HFO)
– Low frequency, low-power time clock (LFO) with 1 ms period
– Medium frequency, controller clock (MFO) of 8 μs period
flank; 24 terminals; 0.5 mm pitch, 4 mm x 4 mm x 1.98 mm body
4.1 Electronic encoding - "CodeF"
Consult the appropriate NTM88 product data sheet for a description of the CodeF
traceability which allows the user to extract:
• For devices programmed by NXP with an embedded firmware, configuration values
holding the firmware library used for final test
• Accelerometer variant type
Prototype samples may be configured and delivered with the firmware remaining in
the flash memory upon special request. The series production process will erase the
firmware from flash memory to facilitate customers choice of the firmware routines, while
excluding specific firmware routines the application software does not require. Consult
the appropriate NTM88 firmware user guide for a description of the available firmware
routines, either as firmware in flash, or as library releases.
Consult the appropriate NTM88 product data sheet for a description of the CodeH
traceability which allows users to extract:
• configuration values holding the assembly revision
• final test pressure
• accelerometer calibrations
4.3 Device identification
The bytes assigned to identify the device and its options are described below. This data
can be read using the TPMS_READ_ID routine.
Table 2. Device ID coding summary
ID Address
00CODEFConsult the appropriate NTM88 product data sheet for a description.
01CODEHConsult the appropriate NTM88 product data sheet for a description.
02CODE2ID7ID6ID5ID4ID3ID2ID1ID0
03CODE3ID15ID14ID13ID12ID11ID10ID9ID8
04CODE4ID23ID22ID21ID20ID19ID18ID17ID16
05CODE5ID31ID30ID29ID28ID27ID26ID25ID24
Register
Name
76543210
BIT
ID13:0 — Device ID within each assembly lot - 16k devices in each lot
ID26:14 — Lower 13 bits of assembly lot ID - 32k lots
ID27 — 1 to identify NTM88 family
ID28:29 — Upper 2 bits of assembly lot ID
ID30 — 0x1 to identify sub-con B, 0x0 to identify sub-con A
ID31 — 0x1 to identify NXP as device supplier
Note: Prior to erasing the flash memory, users are advised to first copy the contents of
the CODEF through CODE5 data into a secure and retrievable database when using, for
example, a custom gang programmer in lieu of the CodeWarrior IDE tool. The contents
of CODEF through CODE5 are unique to each part number, configuration of pressure
and accelerometer ranges, and serial numbers, and must be replaced as part of the user
flash programming processes.
4.4 Definition of signal ranges
Each measured parameter (pressure, voltage, temperature, acceleration) results from
an ADC10 conversion of an analog signal. This ADC10 result may then be passed
by the firmware to the application software as either the raw ADC10 result or further
compensated and scaled for an output between one and the maximum digital value
minus one. The minimum digital value of zero and the maximum digital value are
reserved as error codes.
The signal ranges and their significant data points are shown in Figure 1. In this
definition, the signal source would normally output a signal between S
to process, temperature, and voltage variations, this signal may increase its range to
S
INMIN
the signal is between the supply rails, so that the ADC10 converts it to a range of digital
numbers between 0 and 1023. These digital numbers have corresponding D
D
INHI
and scaled to give the required output code range.
to S
, D
UM11227
NTM88 family of tire pressure monitor sensors
. In the example case of 10-bit raw conversions and 9-bit compensation,
INMAX
INMIN
values. The ADC10 digital value is taken by the firmware and compensated
INMAX
, D
INLO
,
Figure 1. Measurement signal range definitions
Digital input values below D
and above D
INMIN
are immediately flagged as being out
INMAX
of range and generate error bits and the output is forced to the 0 value.
and D
) or above D
INMIN
will normally produce an output between 1 to
INHI
(but not D
INHI
INMAX
) will most
Digital values below D
likely cause an output that would be less than 1 or greater than 510, respectively. These
cases are considered underflow or overflow, respectively. Underflow results will be forced
to a value of 1. Overflow results will be forced to a value of 510.
Digital values between D
510 (for a 9-bit result). In some isolated cases due to compensation calculations and
rounding, the result may be less than 1 or greater than 510, in which case the underflow
At address $FC00, 512 bytes are protected from erasure, containing the sensitivity and
offset coefficients for the transducers and clocks.
The firmware uses no specific bytes of the RAM but will cause additional stacking of
temporary values.
8 / 207
NXP Semiconductors
The firmware uses 2 bytes ($008E and $008F) of the Parameter Registers for global
flags for all routines.
5Marking
5.1 Exterior markings
The marking2 on the NTM88 family contain three lines of text, described as follows:
1. Line 1 identifies the location of pin 1 and, when appropriate, shows the corporate logo
2. Line 2 identifies part marking information, see Table 3 for details on the NTM88
3. Line 3 is the trace code. See Table 4 for trace code definitions.
Table 3. Example Exterior Marking
Part NumberCompany
NTM88xxxxT1N8yaax
markings.
[1]
Family
UM11227
NTM88 family of tire pressure monitor sensors
Marking
[2]
Pressure
[3]
Accelerometer
[4]
Mechanical
[5]
[1] Company column: N = qualified.
[2] Family column: Always "8".
[3] Pressure column: Where "y" is a letter representing the pressure configuration.
[4] Accelerometer columns: Where "a a" are two letters representing the accelerometer configuration.
[5] Mechanical column: Where "x" is a letter representing the mechanical configuration.
Table 4. Trace code definitions
Trace codeDefinition
AAssembly site
[1]
LWafer lot
YWYear and work week
ZAssembly lot split
[1] "X" for site #1; additional letters for other assembly sites as needed.
[2] “Z” can be up to two characters "ZZ" when the number of subassembly lots > 26
This section describes the pin layout and general function of each pin.
7.1 Pinout
UM11227
NTM88 family of tire pressure monitor sensors
Figure 3. NTM88 QFN package pinout
7.2 Pin description
Table 5. Pin description
SymbolPinFunctionDescription
n.c.1—Do not connect electrical signals to this pin; solder joint only.
n.c.2—Do not connect electrical signals to this pin; solder joint only.
n.c.3—Do not connect electrical signals to this pin; solder joint only.
n.c.4—Do not connect electrical signals to this pin; solder joint only.
n.c.5—Do not connect electrical signals to this pin; solder joint only.
n.c.6—Do not connect electrical signals to this pin; solder joint only.
PTA47PTA4 / BKGDPTA4 Pin - The PTA4 pin places the device in the BACKGROUND DEBUG
mode (BDM) to evaluate MCU code and transfer data to/from the internal
memory. If the BKGD/PTA4 pin is held low when the device comes out of a
power-on-reset (POR), the device switches into the ACTIVE BACKGROUND
DEBUG mode (BDM).
The BKGD/PTA4 pin has an internal pullup device or can be connected to
VDD in the application, unless there is a need to enter BDM operation after
the device as been soldered into the PWB. If in-circuit BDM is desired, the
BKGD/PTA4 pin should be connected to VDD through a resistor (~10 kΩ
or greater) which can be over-driven by an external signal. This resistor
reduces the possibility of inadvertently activating the debug mode in the
application due to an EMC event.
When the application programs port A to GPIOs, PTA4 becomes output-only.
11 / 207
NXP Semiconductors
UM11227
NTM88 family of tire pressure monitor sensors
Table 5. Pin description...continued
SymbolPinFunctionDescription
RST_B8Reset / V
programming voltage
VDDA9Analog supplyThe analog circuits operate from a single power supply connected to the unit
GND10Digital and analog
ground
VDD11Digital supplyThe digital circuits operate from a single power supply connected to the unit
VREG121.8 V regulationThe internal regulator for the RF analog circuits requires an external
PTB013PTB0 / TPMCH0 /
AD3
PTA314PTA3 / KBI3 / MOSIThe PTA[3] pin is a general-purpose I/O pin. The pulldown devices can only
PTA215PTA2 / KBI2 / MISOThe PTA[2] pin is a general-purpose I/O pin. The pulldown devices can only
PP
The RST_B pin is used for test and establishing the BDM condition and
providing the programming voltage source to the internal FLASH memory.
This pin can also be used to direct to the MCU to the reset vector.
The RST_B pin has an internal pullup device and can be connected to VDD
in the application unless there is a need to enter BDM operation after the
device as been soldered to the PWB. If in-circuit BDM is desired, the RST_B
pin can be left unconnected; but should be connected to VDD through a low
impedance resistor (<10 kΩ) which can be over-driven by an external signal.
This low impedance resistor reduces the possibility of getting into the debug
mode in the application due to an EMC event.
Activation of the external reset function occurs when the voltage on the
RST_B pin goes below 0.3 × VDD for at least 100 ns before rising above
0.7 × VDD.
through the VDDA pin. VDDA is the positive supply and GND is the ground.
The conductors to the power supply should be connected to the VDDA and
GND pins and locally decoupled.
Care should be taken to reduce measurement signal noise by separating
the VDD, GND, VDDA, and RFGND pins using a “star” connection such
that each metal trace does not share any load currents with other external
devices.
The digital circuits operate from a single power supply connected to the unit
through the VDD and GND pins. GND is the ground. Care should be taken to
reduce measurement signal noise by separating the GND and RFGND pins
using a “star” connection such that each metal trace does not share any load
currents with other external devices.
through the VDD and GND pins. VDD is the positive supply. The conductors
to the power supply should be connected to the VDD and GND pins and
locally decoupled.
stabilization capacitor to GND.
The PTB[0] pin is a general-purpose I/O pin. This pin can be configured
as a nominal bidirectional I/O pin with programmable pullup devices. User
software must configure the general-purpose I/O pin (PTB[1:0]) so that they
do not result in “floating” inputs. PTB0 can be mapped to TPM channel 0, or
to ADC channel 3.
be activated if the wake-up interrupt capability is enabled. User software
must configure the general-purpose I/O pins so that they do not result in
“floating” inputs. PTA[3] maps to keyboard interrupt function bit [3]. When SPI
is enabled, PTA[3] serves as MOSI.
be activated if the wake-up interrupt capability is enabled. User software
must configure the general-purpose I/O pins so that they do not result in
“floating” inputs. PTA[2] maps to keyboard interrupt function bit [2]. When SPI
is enabled, PTA[2] serves as MISO.
PTA116PTA1 / KBI1 / SCLKThe PTA[1] pin is a general-purpose I/O pin. The pulldown devices can only
be activated if the wake-up interrupt capability is enabled. User software
must configure the general-purpose I/O pins so that they do not result in
“floating” inputs. PTA[1] maps to keyboard interrupt function bit [1]. When SPI
is enabled, PTA[1] serves as SCLK
RFGND17RF groundPower in the RF output amplifier is returned to the supply through the
RFGND pin. This conductor should be connected to the power supply using
a “star” connection such that each metal trace does not share any load
currents with other supply pins.
RFOUT18RF outputThe RFOUT pin is the RF energy data supplied by the unit to an external
antenna.
PTA019PTA0 / KBI0 / SS_B /
IRQ
X120RF crystal inputThe X1 pin is for an external 26 MHz crystal to be used by the internal PLL
X021RF crystal outputThe X0 pin is for an external 26 MHz crystal to be used by the internal PLL
PTB122PTB1 / TPMCH1 /
AD4
LFB23LF input '-'The LF[A:B] pins can be used by the LF receiver (LFR) as one differential
LFA24LF input '+'The LF[A:B] pins can be used by the LF receiver (LFR) as one differential
The PTA[0] pin is a general-purpose I/O pin. PTA[0] can be configured as a
normal bidirectional I/O pin with programmable pullup or pulldown devices
and/or wake-up interrupt capability. PTA[0] can be configured for external
interrupt (IRQ). The pulldown devices can only be activated if the wake-up
interrupt capability is enabled. User software must configure the generalpurpose I/O pins so that they do not result in “floating” inputs. PTA[0] maps
to keyboard interrupt function bit [0]. When SPI is enabled, PTA0 serves as
SS_B.
for creating the carrier frequencies and data rates for the RF pin.
for creating the carrier frequencies and data rates for the RF pin.
The PTB[1] pin is a general-purpose I/O pin. This pin can be configured
as a nominal bidirectional I/O pin with programmable pullup devices. User
software must configure the general-purpose I/O pins (PTB[1:0]) so that they
do not result in “floating” inputs. PTB1 can be mapped to TPM channel 1, or
to ADC channel 4.
input channel for sensing low-level signals from an external low frequency
(LF) coil. The external LF coil should be connected between the LF[A] and
the LF[B] pins.
Signaling into the LFR pins can place the unit into various diagnostic or
operational modes. The LFR is comprised of the detector and the decoder.
Each LF[A:B] pin always has an impedance of approximately 500 kΩ to GND
due to the LFR input circuitry.
The LFA/LFB pins are used by the LFR when the LFEN control bit is set and
are not functional when the LFEN control bit is clear.
input channel for sensing low-level signals from an external low frequency
(LF) coil. The external LF coil should be connected between the LF[A] and
the LF[B] pins.
Signaling into the LFR pins can place the unit into various diagnostic or
operational modes. The LFR is comprised of the detector and the decoder.
Each LF[A:B] pin always has an impedance of approximately 500 kΩ to GND
due to the LFR input circuitry.
The LFA/LFB pins are used by the LFR when the LFEN control bit is set and
are not functional when the LFEN control bit is clear.
This section provides summary information about the registers, addressing modes, and
instruction set of the CPU of the HCS08 Family. For a more detailed discussion, refer to
the HCS08 Family Reference Manual, volume 1, NXP Semiconductor document order
number HCS08RMV1/D.
The HCS08 CPU is fully source- and object-code-compatible with the M68HC08 CPU.
Several instructions and enhanced addressing modes were added to improve C compiler
efficiency and to support a new BACKGROUND DEBUG system which replaces the
monitor mode of earlier M68HC08 microcontrollers (MCU).
8.2 Features
Features of the HCS08 CPU include:
• Object code fully upward compatible with M68HC05 and M68HC08 Families
• All registers and memory are mapped to a single 64 kB address space
• Seven addressing modes:
– Inherent — Operands in internal registers
– Relative — 8-bit signed offset to branch destination
– Immediate — Operand in next object code byte(s)
– Direct — Operand in memory at 0x0000–0x00FF
– Extended — Operand anywhere in 64 kB address space
– Indexed relative to H:X — Five submodes including auto-increment
– Indexed relative to SP — Improves C efficiency dramatically
• Memory-to-memory data move instructions with four address mode combinations
• Overflow, half-carry, negative, zero, and carry condition codes support conditional
branching on the results of signed, unsigned, and binary-coded decimal (BCD)
operations
• Efficient bit manipulation instructions
• Fast 8-bit by 8-bit multiply and 16-bit by 8-bit divide instructions
• STOP and WAIT instructions to invoke low-power operating modes
8.3 Programmer’s model and CPU registers
UM11227
NTM88 family of tire pressure monitor sensors
Figure 5 shows the five CPU registers. CPU registers are not part of the memory map.
Figure 5. CPU registers
8.3.1 Accumulator (A)
The A accumulator is a general-purpose 8-bit register. One operand input to the
arithmetic logic unit (ALU) is connected to the accumulator and the ALU results are often
stored into the A accumulator after arithmetic and logical operations. The accumulator
can be loaded from memory using various addressing modes to specify the address
where the loaded data comes from, or the contents of A can be stored to memory using
various addressing modes to specify the address where data from A will be stored.
Reset has no effect on the contents of the A accumulator.
8.3.2 Index register (H:X)
This 16-bit register is actually two separate 8-bit registers (H and X), which often work
together as a 16-bit address pointer where H holds the upper byte of an address and X
holds the lower byte of the address. All indexed addressing mode instructions use the
full 16-bit value in H:X as an index reference pointer; however, for compatibility with the
earlier M68HC05 Family, some instructions operate only on the low-order 8-bit half (X).
Many instructions treat X as a second general-purpose 8-bit register that can be used
to hold 8-bit data values. X can be cleared, incremented, decremented, complemented,
negated, shifted, or rotated. Transfer instructions allow data to be transferred from A or
transferred to A where arithmetic and logical operations can then be performed.
For compatibility with the earlier M68HC05 Family, H is forced to 0x00 during reset.
Reset has no effect on the contents of X.
UM11227
NTM88 family of tire pressure monitor sensors
8.3.3 Stack pointer (SP)
This 16-bit address pointer register points at the next available location on the automatic
last-in-first-out (LIFO) stack. The stack may be located anywhere in the 64 kB address
space that has RAM and can be any size up to the amount of available RAM. The stack
is used to automatically save the return address for subroutine calls, the return address
and CPU registers during interrupts, and for local variables. The AIS (add immediate to
stack pointer) instruction adds an 8-bit signed immediate value to SP. This is most often
used to allocate or deallocate space for local variables on the stack.
SP is forced to 0x00FF at reset for compatibility with the earlier M68HC05 Family. HCS08
programs normally change the value in SP to the address of the last location (highest
address) in on-chip RAM during reset initialization to free up direct page RAM (from the
end of the on-chip registers to 0x00FF).
The RSP (reset stack pointer) instruction was included for compatibility with the
M68HC05 Family and is seldom used in new HCS08 programs because it only affects
the low-order half of the stack pointer.
8.3.4 Program counter (PC)
The program counter is a 16-bit register that contains the address of the next instruction
or operand to be fetched.
During normal program execution, the program counter automatically increments to the
next sequential memory location every time an instruction or operand is fetched. Jump,
branch, interrupt, and return operations load the program counter with an address other
than that of the next sequential location. This is called a change-of-flow.
During reset, the program counter is loaded with the reset vector that is located at
0xFFFE and 0xFFFF. The vector stored there is the address of the first instruction that
will be executed after exiting the reset state.
The 8-bit condition code register contains the interrupt mask (I) and five flags that
indicate the results of the instruction just executed. Bits 6 and 5 are set permanently to
1. The following paragraphs describe the functions of the condition code bits in general
terms. For a more detailed explanation of how each instruction sets the CCR bits, refer to
the HCS08 Family Reference Manual, volume 1, NXP Semiconductors document order
number HCS08RMv1.
Figure 6. Condition code register
UM11227
NTM88 family of tire pressure monitor sensors
Table 6. CCR register field descriptions
FieldDescription
Two’s Complement Overflow Flag — The CPU sets the overflow flag when a two’s
7
V
complement overflow occurs. The signed branch instructions BGT, BGE, BLE, and
BLT use the overflow flag.
0 No overflow
1 Overflow
Half-Carry Flag — The CPU sets the half-carry flag when a carry occurs between
accumulator bits 3 and 4 during an add-without-carry (ADD) or add-with-carry
(ADC) operation. The half-carry flag is required for binary-coded decimal (BCD)
4
H
arithmetic operations. The DAA instruction uses the states of the H and C
condition code bits to automatically add a correction value to the result from a
previous ADD or ADC on BCD operands to correct the result to a valid BCD value.
0 No carry between bits 3 and 4
1 Carry between bits 3 and 4
Interrupt Mask Bit — When the interrupt mask is set, all maskable CPU interrupts
are disabled. CPU interrupts are enabled when the interrupt mask is cleared.
When a CPU interrupt occurs, the interrupt mask is set automatically after the CPU
registers are saved on the stack, but before the first instruction of the interrupt
3
I
service routine is executed.
Interrupts are not recognized at the instruction boundary after any instruction that
clears I (CLI or TAP). This ensures that the next instruction after a CLI or TAP will
always be executed without the possibility of an intervening interrupt, provided I
was set.
0 Interrupts enabled
1 Interrupts disabled
Negative Flag — The CPU sets the negative flag when an arithmetic operation,
logic operation, or data manipulation produces a negative result, setting bit 7 of the
2
N
result. Simply loading or storing an 8-bit, or 16-bit value causes N to be set if the
most significant bit of the loaded or stored value was 1.
Table 6. CCR register field descriptions...continued
8.4 Addressing modes
Addressing modes define the way the CPU accesses operands and data. In the HCS08,
all memory, status and control registers, and input/output (I/O) ports share a single 64
kB linear address space so a 16-bit binary address can uniquely identify any memory
location. This arrangement means that the same instructions that access variables in
RAM can also be used to access I/O and control registers or nonvolatile program space.
FieldDescription
Zero Flag — The CPU sets the zero flag when an arithmetic operation, logic
operation, or data manipulation produces a result of 0x00 or 0x0000. Simply
1
Z
0
C
loading or storing an 8-bit, or 16-bit value causes Z to be set if the loaded or stored
value was all 0s.
0 Non-zero result
1 Zero result
Carry/Borrow Flag — The CPU sets the carry/borrow flag when an addition
operation produces a carry out of bit 7 of the accumulator or when a subtraction
operation requires a borrow. Some instructions — such as bit test and branch,
shift, and rotate — also clear or set the carry/borrow flag.
0 No carry out of bit 7
1 Carry out of bit 7
UM11227
NTM88 family of tire pressure monitor sensors
Some instructions use more than one addressing mode. For instance, move instructions
use one addressing mode to specify the source operand and a second addressing mode
to specify the destination address. Instructions such as BRCLR, BRSET, CBEQ, and
DBNZ use one addressing mode to specify the location of an operand for a test and then
use relative addressing mode to specify the branch destination address when the tested
condition is true. For BRCLR, BRSET, CBEQ, and DBNZ, the addressing mode listed in
the instruction set tables is the addressing mode needed to access the operand to be
tested, and relative addressing mode is implied for the branch destination.
8.4.1 Inherent addressing mode (INH)
In this addressing mode, operands needed to complete the instruction (if any) are located
within CPU registers so the CPU does not need to access memory to get any operands.
8.4.2 Relative addressing mode (REL)
Relative addressing mode is used to specify the destination location for branch
instructions. A signed 8-bit offset value is located in the memory location immediately
following the opcode. During execution, if the branch condition is true, the signed offset
is sign-extended to a 16-bit value and is added to the current contents of the program
counter, which causes program execution to continue at the branch destination address.
8.4.3 Immediate addressing mode (IMM)
In immediate addressing mode, the operand needed to complete the instruction is
included in the object code immediately following the instruction opcode in memory.
In the case of a 16-bit immediate operand, the high-order byte is located in the next
memory location after the opcode, and the low-order byte is located in the next memory
location after that.
In direct addressing mode, the instruction includes the low-order 8 bits of an address
in the direct page (0x0000–0x00FF). During execution, a 16-bit address is formed by
concatenating an implied 0x00 for the high-order half of the address and the direct
address from the instruction to get the 16-bit address where the desired operand is
located. DIR is faster and more memory efficient than specifying a complete 16-bit
address for the operand.
8.4.5 Extended addressing mode (EXT)
In extended addressing mode, the full 16-bit address of the operand is located in the next
2 bytes of program memory after the opcode (high byte first).
8.4.6 Indexed addressing mode
Indexed addressing mode has seven variations including five that use the 16-bit H:X
index register pair and two that use the stack pointer as the base reference.
8.4.6.1 Indexed, no offset (IX)
UM11227
NTM88 family of tire pressure monitor sensors
This variation of indexed addressing uses the 16-bit value in the H:X index register pair
as the address of the operand needed to complete the instruction.
8.4.6.2 Indexed, no offset with post increment (IX+)
This variation of indexed addressing uses the 16-bit value in the H:X index register pair
as the address of the operand needed to complete the instruction. The index register
pair is then incremented (H:X = H:X + 0x0001) after the operand has been fetched. This
addressing mode is only used for MOV and CBEQ instructions.
8.4.6.3 Indexed, 8-bit offset (IX1)
This variation of indexed addressing uses the 16-bit value in the H:X index register pair
plus an unsigned 8-bit offset included in the instruction as the address of the operand
needed to complete the instruction.
8.4.6.4 Indexed, 8-bit offset with post increment (IX1+)
This variation of indexed addressing uses the 16-bit value in the H:X index register pair
plus an unsigned 8-bit offset included in the instruction as the address of the operand
needed to complete the instruction. The index register pair is then incremented (H:X =
H:X + 0x0001) after the operand has been fetched. This addressing mode is used only
for the CBEQ instruction.
8.4.6.5 Indexed, 16-bit offset (IX2)
This variation of indexed addressing uses the 16-bit value in the H:X index register pair
plus a 16-bit offset included in the instruction as the address of the operand needed to
complete the instruction.
This variation of indexed addressing uses the 16-bit value in the stack pointer (SP) plus
an unsigned 8-bit offset included in the instruction as the address of the operand needed
to complete the instruction.
8.4.6.7 SP-Relative, 16-bit offset (SP2)
This variation of indexed addressing uses the 16-bit value in the stack pointer (SP) plus a
16-bit offset included in the instruction as the address of the operand needed to complete
the instruction.
8.5 Special operations
The CPU performs a few special operations that are similar to instructions but do not
have opcodes like other CPU instructions. In addition, a few instructions such as STOP
and WAIT directly affect other MCU circuitry. This section provides additional information
about these operations.
8.5.1 Reset sequence
UM11227
NTM88 family of tire pressure monitor sensors
Reset can be caused by a power-on-reset (POR) event, internal conditions such as the
COP (computer operating properly) watchdog, or by assertion of an external active-low
reset pin. When a reset event occurs, the CPU immediately stops whatever it is doing
(the MCU does not wait for an instruction boundary before responding to a reset event).
For a more detailed discussion about how the MCU recognizes resets and determines
the source, see Section 10.11 "Reset, interrupts and system configuration".
The reset event is considered concluded when the sequence to determine whether the
reset came from an internal source is done and when the reset pin is no longer asserted.
At the conclusion of a reset event, the CPU performs a 6-cycle sequence to fetch the
reset vector from 0xFFFE and 0xFFFF and to fill the instruction queue in preparation for
execution of the first program instruction.
8.5.2 Interrupt sequence
When an interrupt is requested, the CPU completes the current instruction before
responding to the interrupt. At this point, the program counter is pointing at the start of
the next instruction, which is where the CPU should return after servicing the interrupt.
The CPU responds to an interrupt by performing the same sequence of operations as
for a software interrupt (SWI) instruction, except the address used for the vector fetch is
determined by the highest priority interrupt that is pending when the interrupt sequence
started.
The CPU sequence for an interrupt is:
1. Store the contents of PCL, PCH, X, A, and CCR on the stack, in that order.
2. Set the I bit in the CCR.
3. Fetch the high-order half of the interrupt vector.
4. Fetch the low-order half of the interrupt vector.
5. Delay for one free bus cycle.
6. Fetch 3 bytes of program information, starting at the address indicated by the interrupt
vector, to fill the instruction queue in preparation for execution of the first instruction in
the interrupt service routine.
After the CCR contents are pushed onto the stack, the I bit in the CCR is set to prevent
other interrupts while in the interrupt service routine. Although it is possible to clear the I
bit with an instruction in the interrupt service routine, this would allow nesting of interrupts
(which is not recommended because it leads to programs that are difficult to debug and
maintain).
For compatibility with the earlier M68HC05 MCUs, the high-order half of the H:X index
register pair (H) is not saved on the stack as part of the interrupt sequence. The user
must use a PSHH instruction at the beginning of the service routine to save H and then
use a PULH instruction just before the RTI that ends the interrupt service routine. It is not
necessary to save H if you are certain that the interrupt service routine does not use any
instructions or auto-increment addressing modes that might change the value of H.
The software interrupt (SWI) instruction is like a hardware interrupt except that it is not
masked by the global I bit in the CCR and it is associated with an instruction opcode
within the program so it is not asynchronous to program execution.
8.5.3 WAIT mode operation
The WAIT instruction enables interrupts by clearing the I bit in the CCR. It then halts
the clocks to the CPU to reduce overall power consumption while the CPU is waiting for
the interrupt or reset event that will wake the CPU from WAIT mode. When an interrupt
or reset event occurs, the CPU clocks resume and the interrupt or reset event are
processed normally.
UM11227
NTM88 family of tire pressure monitor sensors
If a serial BACKGROUND command is issued to the MCU through the BACKGROUND
DEBUG interface while the CPU is in WAIT mode, CPU clocks resume and the CPU
enters ACTIVE BACKGROUND mode where other serial BACKGROUND commands
can be processed. This ensures that a host development system can still gain access to
a target MCU even if it is in WAIT mode.
8.5.4 STOP mode operation
Usually, all system clocks, including the crystal oscillator (when used), are halted during
STOP mode to minimize power consumption. In such systems, external circuitry is
needed to control the time spent in STOP mode and to issue a signal to wake up the
target MCU when it is time to resume processing. Unlike the earlier M68HC05 and
M68HC08 MCUs, the HCS08 can be configured to keep a minimum set of clocks running
in STOP mode. This optionally allows an internal periodic signal to wake the target MCU
from STOP mode.
When a host debug system is connected to the BACKGROUND DEBUG pin (BKGD) and
the ENBDM control bit has been set by a serial command through the BACKGROUND
interface (or because the MCU was reset into ACTIVE BACKGROUND mode), the
oscillator is forced to remain active when the MCU enters STOP mode. In this case, if
a serial BACKGROUND command is issued to the MCU through the BACKGROUND
DEBUG interface while the CPU is in STOP mode, CPU clocks resume and the CPU
enters ACTIVE BACKGROUND mode where other serial BACKGROUND commands
can be processed. This ensures that a host development system can still gain access to
a target MCU even if it is in STOP mode.
Recovery from STOP mode depends on the particular HCS08 and whether the oscillator
was stopped in STOP mode. See Section 10.8 "Modes of operation" for more details.
The BGND instruction is new to the HCS08 compared to the M68HC08. BGND would
not be used in normal user programs because it forces the CPU to stop processing
user instructions and enter the ACTIVE BACKGROUND mode. The only way to resume
execution of the user program is through reset or by a host debug system issuing a GO,
TRACE1, or TAGGO serial command through the BACKGROUND DEBUG interface.
Software-based breakpoints can be set by replacing an opcode at the desired breakpoint
address with the BGND opcode. When the program reaches this breakpoint address, the
CPU is forced to ACTIVE BACKGROUND mode rather than continuing the user program.
8.6 HCS08 instruction set summary
8.6.1 Instruction set summary nomenclature
The nomenclature listed here is used in the instruction descriptions in Table 7.
8.6.2 Operators
UM11227
NTM88 family of tire pressure monitor sensors
( ) = Contents of register or memory location shown inside parentheses
← = Is loaded with (read: "gets")
& = Boolean AND
| = Boolean OR
= Boolean exclusive-OR
⊕
× = Multiply
÷ = Divide
: = Concatenate
+ = Add
– = Negate (two’s complement)
8.6.3 CPU registers
A= Accumulator
CCR = Condition code register
H= Index register, higher order (most significant) 8 bits
X= Index register, lower order (least significant) 8 bits
PC= Program counter
PCH = Program counter, higher order (most significant) 8 bits
PCL = Program counter, lower order (least significant) 8 bits
SP= Stack pointer
8.6.4 Memory and addressing
M = A memory location or absolute data, depending on addressing mode
M:M + 0x0001 = A 16-bit value in two consecutive memory locations. The higher order
(most significant) 8 bits are located at the address of M, and the lower order (least
significant) 8 bits are located at the next higher sequential address.
8.6.5 Condition code register (CCR) bits
V = Two’s complement overflow indicator, bit 7
H = Half carry, bit 4
I = Interrupt mask, bit 3
N = Negative indicator, bit 2
Z = Zero indicator, bit 1
C = Carry/borrow, bit 0 (carry out of bit 7)
8.6.6 CCR activity notation
– = Bit not affected
0 = Bit forced to 0
1 = Bit forced to 1
Þ = Bit set or cleared according to results of operation
U = Undefined after the operation
UM11227
NTM88 family of tire pressure monitor sensors
8.6.7 Machine coding notation
dd = Low-order 8 bits of a direct address 0x0000–0x00FF (high byte assumed to be 0x00)
ee = Upper 8 bits of 16-bit offset
ff = Lower 8 bits of 16-bit offset or 8-bit offset
ii= One byte of immediate data
jj= High-order byte of a 16-bit immediate data value
kk = Low-order byte of a 16-bit immediate data value
hh = High-order byte of 16-bit extended address
ll= Low-order byte of 16-bit extended address
rr = Relative offset
8.6.8 Source form
Everything in the source forms columns, except expressions in italic characters, is literal
information that must appear in the assembly source file exactly as shown. The initial
3- to 5-letter mnemonic is always a literal expression. All commas, pound signs (#),
parentheses, and plus signs (+) are literal characters.
n — Any label or expression that evaluates to a single integer in the range 0–7
opr8i — Any label or expression that evaluates to an 8-bit immediate value
opr16i — Any label or expression that evaluates to a 16-bit immediate value
opr8a — Any label or expression that evaluates to an 8-bit value. The instruction treats
this 8-bit value as the low order 8 bits of an address in the direct page of the 64 kB
address space (0x00xx).
opr16a — Any label or expression that evaluates to a 16-bit value. The instruction treats
this value as an address in the 64 kB address space.
oprx8 — Any label or expression that evaluates to an unsigned 8-bit value, used for
indexed addressing
oprx16 — Any label or expression that evaluates to a 16-bit value. Because the HCS08
has a 16-bit address bus, this can be either a signed or an unsigned value.
rel — Any label or expression that refers to an address that is within –128 to +127
locations from the next address after the last byte of object code for the current
instruction. The assembler calculates the 8-bit signed offset and include it in the object
code for this instruction.
8.6.9 Address modes
INH = Inherent (no operands)
IMM = 8-bit or 16-bit immediate
DIR = 8-bit direct
EXT = 16-bit extended
IX= 16-bit indexed no offset
IX+= 16-bit indexed no offset, post increment (CBEQ and MOV only)
IX1= 16-bit indexed with 8-bit offset from H:X
IX1+ = 16-bit indexed with 8-bit offset, post increment (CBEQ only)