2.2.3Memories and memory interfaces..................................................................................................................37
2.2.5Security and integrity modules...................................................................................................................... 37
2.4Orderable part numbers.................................................................................................................................................41
3.2Reset and interrupt vector assignments.........................................................................................................................44
7.2Port control and interrupt module features................................................................................................................... 75
8.2Port data and data direction...........................................................................................................................................84
8.5Memory map and register definition.............................................................................................................................86
8.5.1Port A Data Register (PORT_PTAD)............................................................................................................ 86
8.5.2Port B Data Register (PORT_PTBD)............................................................................................................ 87
8.5.3Port C Data Register (PORT_PTCD)............................................................................................................ 87
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors5
Section numberTitlePage
8.5.4Port A Direction Register (PORT_PTADD)................................................................................................. 88
8.5.5Port B Direction Register (PORT_PTBDD).................................................................................................. 89
8.5.6Port C Direction Register (PORT_PTCDD).................................................................................................. 89
8.5.7Port A Pullup Enable Register (PORT_PTAPE)........................................................................................... 90
8.5.8Port B Pullup/Pulldown Enable Register (PORT_PTBPE)........................................................................... 91
8.5.9Port C Pullup Enable Register (PORT_PTCPE)............................................................................................91
8.5.10Port B High Drive Strength Selection Register (PORT_PTBHD)................................................................ 92
9.1Chip specific windowed COP.......................................................................................................................................97
9.4Reset and system initialization......................................................................................................................................98
9.7.2Module to module interconnects....................................................................................................................103
9.8Memory map and register definition.............................................................................................................................104
9.8.1System Reset Status Register (SIM_SRS)..................................................................................................... 105
9.8.2System Background Debug Force Reset Register (SIM_SBDFR)................................................................ 107
9.8.3System Device Identification Register: High (SIM_SDIDH)........................................................................107
10.2Programmer's Model and CPU Registers..................................................................................................................... 128
10.7Instruction Set Summary...............................................................................................................................................142
11.3.1Modes of operation........................................................................................................................................ 156
11.3.4Flash initialization after system reset.............................................................................................................157
11.3.10.12 Set user margin level command................................................................................................. 177
11.3.10.13 Set factory margin level command............................................................................................ 179
11.4Memory map and register definition.............................................................................................................................180
12.1.3Modes of operation........................................................................................................................................ 190
12.2External signal description............................................................................................................................................191
12.3.1ICS Control Register 1 (ICS_C1).................................................................................................................. 192
12.3.2ICS Control Register 2 (ICS_C2).................................................................................................................. 193
12.3.3ICS Control Register 3 (ICS_C3).................................................................................................................. 194
12.3.4ICS Control Register 4 (ICS_C4).................................................................................................................. 195
12.3.5ICS Status Register (ICS_S).......................................................................................................................... 196
12.4.3Bus frequency divider.................................................................................................................................... 200
12.4.4Low-power field usage...................................................................................................................................200
12.4.6Fixed frequency clock....................................................................................................................................201
12.4.7FLL lock and clock monitor...........................................................................................................................201
13.1Chip specific modulo timer...........................................................................................................................................205
13.3.2Modes of Operation ...................................................................................................................................... 207
13.3.2.1MTIM16 in Wait Mode .............................................................................................................207
13.3.2.2MTIM16 in Stop Modes............................................................................................................ 207
13.3.2.3MTIM16 in Active Background Mode ..................................................................................... 208
13.4External Signal Description .........................................................................................................................................208
13.4.1TCLK — External Clock Source Input into MTIM16 ................................................................................. 208
13.5Memory Map and Register Descriptions......................................................................................................................209
13.5.1MTIM16 status and control register (MTIM_SC)......................................................................................... 209
13.6.1MTIM16 Operation Example ........................................................................................................................216
Chapter 14
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
12NXP Semiconductors
Section numberTitlePage
Power Management Controller (PMC)
14.1Chip specific power management controller ............................................................................................................... 217
14.5Modes of operation.......................................................................................................................................................219
14.6External signal description............................................................................................................................................220
14.7Memory map and register definition.............................................................................................................................221
14.7.9VREFH Low Voltage Warning (LVW) Configuration Register (PMC_VREFHLVW)...............................228
14.7.10 Status Register (PMC_STAT)....................................................................................................................... 228
14.8.3Low voltage reset (LVR)............................................................................................................................... 230
14.8.3.1LVR in low power mode............................................................................................................231
14.8.4Low voltage warning (LVW).........................................................................................................................231
14.8.4.1LVW on VDDX/VDDA............................................................................................................ 231
14.8.4.2LVW on VREFH....................................................................................................................... 231
14.8.4.3LVW in low power mode...........................................................................................................231
15.1Chip specific KBI information......................................................................................................................................235
15.2.2Modes of Operation....................................................................................................................................... 235
15.2.2.1KBI in Wait mode......................................................................................................................236
15.2.2.2KBI in Stop modes.....................................................................................................................236
15.5Memory Map and Registers..........................................................................................................................................237
15.5.1KBI Status and Control Register (KBI_SC).................................................................................................. 238
15.6.2Edge and level sensitivity.............................................................................................................................. 240
16.2.3Modes of operation........................................................................................................................................ 244
16.2.3.2Low-power modes (Wait or Stop)............................................................................................. 245
16.3Memory map and register descriptions.........................................................................................................................245
16.3.1CRC Data register: High 1 (CRC_DH1)........................................................................................................245
16.3.2CRC Data register: High 0 (CRC_DH0)........................................................................................................246
16.3.3CRC Data register: Low 1 (CRC_DL1).........................................................................................................247
16.3.4CRC Data register: Low 0 (CRC_DL0).........................................................................................................247
16.3.5CRC Polynomial Register: High 1 (CRC_PH1)............................................................................................248
16.3.6CRC Polynomial Register: High 0 (CRC_PH0)............................................................................................249
16.4.3.1Types of transpose..................................................................................................................... 253
16.4.4CRC result complement.................................................................................................................................254
17.3External Signal Description..........................................................................................................................................260
17.3.1Analog Power (VDDA)................................................................................................................................. 261
17.3.3Voltage Reference High (VREFH)................................................................................................................261
17.4ADC Control Registers.................................................................................................................................................262
17.4.1
17.4.2
17.4.3
17.4.4
17.4.5
Status and Control Register 1 (ADCx_SC1)..................................................................................................262
Status and Control Register 2 (ADCx_SC2)..................................................................................................264
Status and Control Register 3 (ADCx_SC3)..................................................................................................265
Status and Control Register 4 (ADCx_SC4)..................................................................................................266
Conversion Result High Register (ADCx_RH)............................................................................................. 267
17.4.6
17.4.7
16NXP Semiconductors
Conversion Result Low Register (ADCx_RL).............................................................................................. 268
Compare Value High Register (ADCx_CVH)...............................................................................................269
17.5.1Clock select and divide control......................................................................................................................270
17.7.1External pins and routing............................................................................................................................... 283
17.7.2Sources of error..............................................................................................................................................285
18.2ACMP in stop mode..................................................................................................................................................... 290
18.8CMP, DAC, and ANMUX Diagram.............................................................................................................................292
18.11.2 Power Modes..................................................................................................................................................311
18.11.3 Startup and Operation.................................................................................................................................... 312
18.13 Digital to Analog Converter Block Diagram................................................................................................................315
18.14.1 Voltage Reference Source Select...................................................................................................................316
19.1Chip specific FlexTimer module.................................................................................................................................. 317
19.2.3Modes of operation........................................................................................................................................ 319
19.4Memory map and register definition.............................................................................................................................321
19.5.8Update of the registers with write buffers......................................................................................................338
20.2.2Modes of operation........................................................................................................................................ 344
20.3External signal description............................................................................................................................................345
20.3.3ALTCLK— alternative clock source for counter.......................................................................................... 346
20.4Memory Map and Register Descriptions......................................................................................................................346
20.5.1PWT counter and PWT clock pre-scaler........................................................................................................352
20.5.2Edge detection and capture control................................................................................................................352
20.6.1Description of reset operation........................................................................................................................356
20.7.1Description of interrupt operation..................................................................................................................357
21.1Chip specific inter-integrated circuit............................................................................................................................ 361
21.2.2Modes of operation........................................................................................................................................ 362
21.3I2C signal descriptions..................................................................................................................................................364
21.4.2I2C Frequency Divider register (I2C_F)........................................................................................................365
21.4.3I2C Control Register 1 (I2C_C1)...................................................................................................................366
21.4.4I2C Status register (I2C_S)............................................................................................................................368
21.4.5I2C Data I/O register (I2C_D)....................................................................................................................... 369
21.4.6I2C Control Register 2 (I2C_C2)...................................................................................................................370
21.4.7I2C Stop Control and Status Register (I2C_SCS)......................................................................................... 371
21.4.8I2C Range Address register (I2C_RA).......................................................................................................... 372
21.4.9I2C SMBus Control and Status register (I2C_SMB).....................................................................................373
21.5.4System management bus specification.......................................................................................................... 384
22.1Chip specific serial communications interface.............................................................................................................395
22.2.2Modes of operation........................................................................................................................................ 396
22.3SCI signal descriptions................................................................................................................................................. 399
22.3.1Detailed signal descriptions........................................................................................................................... 399
SCI Control Register 1 (SCIx_C1).................................................................................................................401
SCI Control Register 2 (SCIx_C2).................................................................................................................403
SCI Status Register 1 (SCIx_S1)................................................................................................................... 404
SCI Status Register 2 (SCIx_S2)................................................................................................................... 406
SCI Control Register 3 (SCIx_C3).................................................................................................................407
SCI Data Register (SCIx_D)..........................................................................................................................409
22.5.2.1Send break and queued idle....................................................................................................... 411
22.5.4Interrupts and status flags.............................................................................................................................. 415
23.5Mode of operation.........................................................................................................................................................423
23.6Memory Map and Register Descriptions......................................................................................................................425
23.6.1PDB Control Register 0 (PDB_CTRL0)........................................................................................................425
23.6.2PDB Control Register 1 (PDB_CTRL1)........................................................................................................426
24.4Memory Map and Register Descriptions......................................................................................................................432
25.1Chip specific GDU information....................................................................................................................................435
25.5Modes of operation.......................................................................................................................................................437
25.6Memory map and register definition.............................................................................................................................438
25.6.1PHCMP0 Control Register 0 (GDU_PHCMP0CR0).................................................................................... 439
25.6.2PHCMP0 Control Register 1 (GDU_PHCMP0CR1).................................................................................... 439
25.6.3PHCMP0 Filter Period Register (GDU_PHCMP0FPR)................................................................................441
25.6.4PHCMP0 Status and Control Register (GDU_PHCMP0SCR)......................................................................441
25.6.5PHCMP1 Control Register 0 (GDU_PHCMP1CR0).................................................................................... 442
25.6.6PHCMP1 Control Register 1 (GDU_PHCMP1CR1).................................................................................... 443
25.6.7PHCMP1 Filter Period Register (GDU_PHCMP1FPR)................................................................................444
25.6.8PHCMP1 Status and Control Register (GDU_PHCMP1SCR)......................................................................445
25.6.9PHCMP2 Control Register 0 (GDU_PHCMP2CR0).................................................................................... 446
25.6.10 PHCMP2 Control Register 1 (GDU_PHCMP2CR1).................................................................................... 446
25.6.11 PHCMP2 Filter Period Register (GDU_PHCMP2FPR)................................................................................448
25.6.12 PHCMP2 Status and Control Register (GDU_PHCMP2SCR)......................................................................448
25.6.13 Clamp Control Register (GDU_CLMPCTRL)..............................................................................................449
25.6.14 I/O Control Register (GDU_IOCTRL)..........................................................................................................450
25.6.15 Virtual Network Phase Detection Control (GDU_PHASECTRL)................................................................451
25.6.16 Current Sensor and Overcurrent Protection Control Register (GDU_CURCTRL).......................................452
25.6.17 LIMIT0 CMP Control Register 0 (GDU_LIMIT0CR0)................................................................................452
25.6.18 LIMIT0 CMP Control Register 1 (GDU_LIMIT0CR1)................................................................................453
25.6.19 LIMIT0 CMP Filter Period Register (GDU_LIMIT0FPR)........................................................................... 454
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
26NXP Semiconductors
Section numberTitlePage
25.6.20 LIMIT0 CMP Status and Control Register (GDU_LIMIT0SCR).................................................................455
25.6.21 LIMIT0 DAC Control Register (GDU_LIMIT0DACCR)............................................................................ 456
25.6.22 LIMIT1 CMP Control Register 0 (GDU_LIMIT1CR0)................................................................................456
25.6.23 LIMIT1 CMP Control Register 1 (GDU_LIMIT1CR1)................................................................................457
25.6.24 LIMIT1 CMP Filter Period Register (GDU_LIMIT1FPR)........................................................................... 458
25.6.25 LIMIT1 CMP Status and Control Register (GDU_LIMIT1SCR).................................................................459
25.6.26 LIMIT1 DAC Control Register (GDU_LIMIT1DACCR)............................................................................ 460
25.6.27 PDCS and Clamp Status Register (GDU_STATREG)..................................................................................460
25.7.1Phase detection function descriptions............................................................................................................462
25.7.2OpAMP function descriptions....................................................................................................................... 463
25.7.3Predrive function descriptions....................................................................................................................... 464
26.2.3Modes of operation........................................................................................................................................ 483
26.4Memory Map and Register Descriptions......................................................................................................................504
26.4.1PWM Control Register: Low (PWM_CTRLL)............................................................................................. 506
26.4.2PWM Control Register: High (PWM_CTRLH)............................................................................................ 507
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
28NXP Semiconductors
Section numberTitlePage
26.4.3PWM Fault Control Register: Low (PWM_FCTRLL)..................................................................................508
26.4.4PWM Fault Control Register: High (PWM_FCTRLH).................................................................................510
26.4.5PWM Fault Status Acknowledge Register: Low (PWM_FLTACKL)..........................................................510
26.4.6PWM Fault Status Acknowledge Register: High (PWM_FLTACKH).........................................................511
26.4.7PWM Output Control Register: Low (PWM_OUTL)................................................................................... 513
26.4.8PWM Output Control Register: High (PWM_OUTH)..................................................................................514
27.1.1Forcing active background.............................................................................................................................529
27.3On-chip debug system (DBG)...................................................................................................................................... 537
27.3.1Comparators A and B.....................................................................................................................................538
27.3.2Bus capture information and FIFO operation................................................................................................ 538
27.3.4Tag vs. force breakpoints and triggers...........................................................................................................540
28.1.2Modes of operation........................................................................................................................................ 550
28.3Memory map and registers............................................................................................................................................551
28.3.1Debug Comparator A High Register (DBG_CAH)....................................................................................... 552
28.3.2Debug Comparator A Low Register (DBG_CAL)........................................................................................ 553
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
30NXP Semiconductors
Section numberTitlePage
28.3.3Debug Comparator B High Register (DBG_CBH)........................................................................................554
28.3.4Debug Comparator B Low Register (DBG_CBL).........................................................................................554
28.3.5Debug Comparator C High Register (DBG_CCH)........................................................................................555
28.3.6Debug Comparator C Low Register (DBG_CCL).........................................................................................556
28.3.7Debug FIFO High Register (DBG_FH).........................................................................................................556
28.3.9Debug Comparator A Extension Register (DBG_CAX)............................................................................... 558
28.3.10 Debug Comparator B Extension Register (DBG_CBX)................................................................................559
28.3.11 Debug Comparator C Extension Register (DBG_CCX)................................................................................560
28.3.12 Debug FIFO Extended Information Register (DBG_FX)..............................................................................561
28.3.13 Debug Control Register (DBG_C).................................................................................................................561
28.3.15 Debug Status Register (DBG_S)....................................................................................................................564
28.3.16 Debug Count Status Register (DBG_CNT)...................................................................................................565
28.4.4Trigger break control (TBC)..........................................................................................................................568
28.4.4.1Begin- and end-trigger............................................................................................................... 569
28.4.4.2Arming the DBG module...........................................................................................................569
This document describes the features, architecture, and programming model of the NXP
microcontrollers.
1.1.2
Audience
A reference manual is primarily for system architects and software application developers
who are using or considering using an NXP product in a system.
1.2
Conventions
1.2.1Numbering systems
The following suffixes identify different numbering systems:
This suffixIdentifies a
bBinary number. For example, the binary equivalent of the
number 5 is written 101b. In some cases, binary numbers are
shown with the prefix 0b.
dDecimal number. Decimal numbers are followed by this suffix
only when the possibility of confusion exists. In general,
decimal numbers are shown without a suffix.
hHexadecimal number. For example, the hexadecimal
equivalent of the number 60 is written 3Ch. In some cases,
hexadecimal numbers are shown with the prefix 0x.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors33
Conventions
1.2.2Typographic notation
The following typographic notation is used throughout this document:
ExampleDescription
placeholder, xItems in italics are placeholders for information that you provide. Italicized text is also used for
the titles of publications and for emphasis. Plain lowercase letters are also used as
placeholders for single letters and numbers.
code
SR[SCM]A mnemonic in brackets represents a named field in a register. This example refers to the
REVNO[6:4], XAD[7:0]Numbers in brackets and separated by a colon represent either:
Fixed-width type indicates text that must be typed exactly as shown. It is used for instruction
mnemonics, directives, symbols, subcommands, parameters, and operators. Fixed-width type
is also used for example code. Instruction mnemonics and directives in text and tables are
shown in all caps; for example, BSR.
Scaling Mode (SCM) field in the Status Register (SR).
• A subset of a register's named field
For example, REVNO[6:4] refers to bits 6–4 that are part of the COREREV field that
occupies bits 6–0 of the REVNO register.
• A continuous range of individual signals of a bus
For example, XAD[7:0] refers to signals 7–0 of the XAD bus.
1.2.3Special terms
The following terms have special meanings:
TermMeaning
assertedRefers to the state of a signal as follows:
• An active-high signal is asserted when high (1).
• An active-low signal is asserted when low (0).
deassertedRefers to the state of a signal as follows:
• An active-high signal is deasserted when low (0).
• An active-low signal is deasserted when high (1).
In some cases, deasserted signals are described as negated.
reservedRefers to a memory space, register, or field that is either
reserved for future use or for which, when written to, the
module or chip behavior is unpredictable.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
34NXP Semiconductors
Chapter 2
Introduction
2.1Introduction
This device is a low-cost, high-performance UHV HCS08 8-bit microcontroller units
(MCUs). It uses the enhanced S08L central processor unit with MOSFET predrivers.
The features are as follows:
• Core platform clock up to 40 MHz, bus clock up to 20 MHz
• Memory option is up to 16 KB flash with 8 B flash line buffer, 768 B RAM (256 B is
unrestricted, 512 B is restricted during flash erasing and programming) and 8 B
register file
• Wide operating voltage ranges from 4.5–18 V
• 24-pin QFN package
• Ambient operating temperature ranges from –40 °C to 105 °C
2.2
Module functional categories
The modules on this device are grouped into functional categories. Information found
here describes the modules assigned to each category in more detail.
Table 2-1. Module functional categories
Module categoryDescription
HCS08 core• 8-bit MCU core, 40 MHz CPU frequency.
System• System integration module
• Power management and mode controllers
• Multiple power modes available based on run, wait, stop, and powerdown modes
• Interrupt priority controller (IPC)
• Inter-module crossbar
Memories• Up to 16 KB flash memory for SU16 and up to 8 KB flash memory for SU8
• Up to 768 bytes SRAM, including 256 B of which is unrestricted, and the rest
512 B is restricted during flash erasing and programming.
• Up to 8 bytes system register file
Clocks• Internal clock source
• 31.25 to 39.0625 kHz IRC
• 20 kHz oscillator with functional in all power modes
• Frequency-locked loop
• DC to 40 MHz
Security• Windowed COP watchdog
• One cyclic redundancy check (CRC)
Analog• Two 12-bit analog-to-digital converters (ADC)
• One high speed comparator (CMP) with internal 6-bit digital-to-analog
converter (DAC)
• One gate drive unit (GDU)
Timers• One 16-bit PWM
• One 16-bit FTM
• One 16-bit modulo timer (MTIM)
• Two pulse width timers (PWT)
• One programmable delay block (PDB)
Communications• One inter-integrated circuit (I2C) module
• One serial communications interface (SCI)
Human-Machine Interfaces (HMI)• Port control (PORT)
• One keyboard interrupt (KBI)
2.2.1S08L core modules
The following core modules are available on this device.
Table 2-2. Core modules
ModuleDescription
HCS08 V6 CPUThe 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.
Debug moduleThe DBG module implements an on-chip ICE (in-circuit emulation) system and
allows non-intrusive debug of application software by providing an on-chip trace
buffer with flexible triggering capability. The trigger can also provide extended
breakpoint capacity. The on-chip ICE system is optimized for the HCS08 8-bit
architecture and supports 64 KB of memory space.
2.2.2System modules
The following system modules are available on this device.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
36NXP Semiconductors
Chapter 2 Introduction
Table 2-3. System modules
ModuleDescription
System integration module (SIM)The SIM includes integration logic and several module configuration settings.
Power management controller (PMC)The PMC provides the user with multiple power options. Multiple modes are
supported that allow the user to optimize power consumption for the level of
functionality needed. Includes power-on-reset (POR) and integrated low voltage
detect (LVD) with reset (brownout) capability and selectable LVD trip points.
Development supportDevelopment supports single-wire background debug mode (BDM), which uses the
on-chip background debug controller (BDC) module, and the independent on-chip
realtime in-circuit emulation (ICE) system, which uses the on-chip debug (DBG)
module.
Debug module (DBG)The DBG module implements an on-chip ICE (in-circuit emulation) system and
allows non-intrusive debug of application software by providing an on-chip trace
buffer with flexible triggering capability.
2.2.3Memories and memory interfaces
The following memories and memory interfaces are available on this device.
Table 2-4. Memories and memory interfaces
ModuleDescription
Flash memoryProgram flash memory — up to 16 KB (SU16) or 8 KB (SU8) of the non-volatile
flash memory that can execute program code.
SRAMUp to 768 bytes internal system RAM, including 256 B of which is unrestricted, the
rest 512 B is restricted during flash erasing and programming.
System register fileUp to 8 bytes.
2.2.4Clocks
The following clock modules are available on this device.
Table 2-5. Clock modules
ModuleDescription
Internal Clock Source (ICS)ICS module containing an internal reference clock (ICSIRCLK) and a frequency
locked loop (FLL).
Low-Power Oscillator (LPO)The PMC module contains a 20 kHz low-power oscillator which acts as a
standalone low-frequency clock source in all modes.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors37
Module functional categories
2.2.5Security and integrity modules
The following security and integrity modules are available on this device:
Table 2-6. Security and integrity modules
ModuleDescription
Windowed COP watchdog (WCOP)The COP watchdog is used to force a system reset when the application software
The following analog modules are available on this device:
Table 2-7. Analog modules
ModuleDescription
Analog-to-digital converters (ADC)12-bit successive-approximation ADC module.
Comparator (CMP)One comparator that compares two analog input voltages across the full range of
the supply voltage and can trigger an ADC acquisition, TPM update, or CPU
interrupt.
6-bit digital-to-analog converters (DAC)64-tap resistor ladder network which provides a selectable voltage reference for
comparator.
Gate Drive Unit (GDU)• 5 V voltage regulator referenced to VDD for HS pre-drivers
• Supports wide operation voltages from 4.5 V to 18 V
• Overvoltage detection on the system supply VBUS pin
• 1/8 VDD drive to ADC
2.2.7Timer modules
The following timer modules are available on this device:
• 16-bit counter supporting free-running, and counting is up or up-down
• Input capture, output compare, and edge-aligned and center-aligned PWM
modes
• Operation of FTM channels as pairs with equal outputs or independent
channels with independent outputs
• Programmable interrupt on input capture, reference compare, overflowed
counter
Table continues on the next page...
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
38NXP Semiconductors
Chapter 2 Introduction
Table 2-8. Timer modules (continued)
ModuleDescription
Programmable Delay Block (PDB)• 16-bit resolution with a shared prescaler
• Support software and hardware trigger
• Support continuous count mode or single shot delay mode
• Supply on-fly delay value update
• Selective output mode: logic level or one-shot pulse
Pulse Width Timer (PWT)• Automatic measurement of pulse width with 16-bit resolution
• Separate positive and negative pulse width measurements
• Programmable triggering edge for starting measurement
• Programmable measuring time between successive alternating edges, rising
edges or falling edges
• Programmable pre-scaler from clock input as 16-bit counter time base
• Two selectable clock sources
• Four selectable pulse inputs
• Programmable interrupt generation upon pulse width value updated and
counter overflow
Pulse width modulator (PWM)• PWM operation clock runs at system clock
• Six PWM signals
• Complementary channel operation
• Edge- or center-aligned PWM signals
• 15 bits of resolution
• Half-cycle reload capability
• Integral reload rates from 1 to 16
• Individual software controlled PWM output
• Programmable fault protection
• PWM compare output polarity control
• PWM output polarity control
• Write-protected registers
16-bit modulo timer (MTIM)• 16-bit up-counter
• Four software selectable clock sources for input to prescaler
• Nine selectable clock prescale values
• Modulo compare matched can be an output
2.2.8Communication interfaces
The following communication interfaces are available on this device:
Table 2-9. Communication modules
ModuleDescription
Inter-integrated circuit (I2C)Allows communication between a number of devices. Also supports the System
Management Bus (SMBus) Specification, version 2.
Serial communications interface (SCI)SCI is used to connect to the RS232 serial input/output port of a personal computer
or workstation and communicate with other embedded controllers.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors39
S08L Core
S08L Bus
Flash
Line Buffer
User Flash
16 KB (SU16)
8 KB (SU8)
User RAM
768 Bytes
Interrupt Priority
Controller
IRQ
I2C
Modulo Timer
(MTIM)
PWM
ADC0
12-bit
ADC1
12-bit
CMP
+ 6-bit DAC
Windowed
Watchdog (WCOP)
Gate Pre-Driver Unit (GDU)
Predriver + 5 CMP + 2 OPAMP
Inter-Module
Crossbar
GPIO Port A&B&C and Peripheral MUX
Power Management
Controller (PMC)
System Integration
Module (SIM)
Package Pins
Peripheral Bus
BKGD
CPU
Interrupt
Unit
Memory
Map
Controller
Background
Debg
Controller
Peripheral
Bus Bridge
FTM
Ch0,1
PWT
0,1
PDB
Ch0,1
Analog Signals
Analog Inpus
Pre
Driver
Motor Drive
Package Pins
Cyclic Redundancy
Check (CRC)
Inter Module Crossbar Outputs
Inter Module Crossbar Inputs
SCI
Internal
32 kHz
Internal
20 kHz LPO
FLL
Internal Clock Source(ICS)
Low Power Osc (LPO)
Clock Generation
MCU block diagram
2.2.9Human-machine interfaces
The following human-machine interfaces (HMI) are available on this device:
Table 2-10. HMI modules
ModuleDescription
Port Control (PORT)Some general purpose input or output pins are capable of interrupt request
generation.
Keyboard Interrupts (KBI)• Up to eight keyboard interrupt pins with individual pin enable bits
• Each keyboard interrupt pin is programmable
• One software-enabled keyboard interrupt
• Exit from low-power modes
2.3MCU block diagram
The block diagram below shows the structure of the MCUs.
40NXP Semiconductors
Figure 2-1. Block diagram
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
Chapter 2 Introduction
2.4Orderable part numbers
The following table summarizes the part numbers of the devices covered by this
document.
Table 2-11. Orderable part numbers summary
Part numberCPU
frequency
MC9S08SU16VFK40 MHz24QFN16 KB768 bytes-40 to 105 °C
MC9S08SU8VFK40 MHz24QFN8 KB768 bytes-40 to 105 °C
Pin countPackageTotal flash
memory
RAMTemperature range
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors41
Orderable part numbers
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
42NXP Semiconductors
Chapter 3
Memory
3.1Memory map
In this device, the most frequently used registers are placed in the direct page, memory
0x0000 to 0x00FF. Also a portion of RAM is placed in the direct page to take advantage
of the direct addressing mode of the CPU. All other register locations in the extended
page are the same in terms of instruction cycle times.The placement of the other
peripheral modules is not critical because CPU instructions for all other extended
memory have the same timing requirements.
As shown below, on-chip memory in this device consists of RAM and flash program
memory for nonvolatile data storage, plus I/O and control/status registers. The registers
are divided into three groups: direct-page registers, high-page registers and nonvolatile
registers.
The entire memory space are partitioned to:
• Direct-page registers: 0x0000–0x007F
• Random access memory: 0x0080–0x037F
• Unimplemented: 0x0380–0x17FF
• High-page registers: 0x1800–0x18FF
• Unimplemented: 0x1900–0xBFFF (SU16) and 0x1900–0xDFFF (SU8)
• Flash memory (SU16): 0xC000–0xFFFF
• Flash array: 0xC000–0FFBF
• Vector table: 0xFFC0–0xFFFF
• Flash memory (SU8): 0xE000–0xFFFF
• Flash array: 0xE000–0FFBF
• Vector table: 0xFFC0–0xFFFF
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors43
HIGH PAGE REGISTERS
DIRECT PAGE REGISTERS
RAM 768 BYTES
8192 BYTES
0x0000
0x007F
0x0080
0x037F
UNIMPLEMENTED
0x0380
0x17FF
0x1800
0x18FF
0x1900
UNIMPLEMENTED
0xFFFF
0xDFFF
0xE000
HIGH PAGE REGISTERS
DIRECT PAGE REGISTERS
RAM 768 BYTES
16,384 BYTES
0x0000
0x007F
0x0080
0x037F
UNIMPLEMENTED
0x0380
0x17FF
0x1800
0x18FF
0x1900
UNIMPLEMENTED
0xFFFF
0xBFFF
0xC000
SU16
SU8
Reset and interrupt vector assignments
Figure 3-1. Memory map
3.2
The following table summarizes the reset and interrupt sources assignments for this
device. The high-order byte of the address for the interrupt service routine is located at
the first address in the vector address column, and the low-order byte of the address for
the interrupt service routine is located at the next higher address. Higher-priority sources
are located toward the bottom of the table. The Interrupt Priority Controller module is
integrated on this device and provides the ability to alter the default priority scheme.
The vector names shown in this table are the labels used in the NXP-provided header
files for the device.
Reset and interrupt vector assignments
Table 3-1. Reset and interrupt vectors
Vector number
310xFFC0:FFC1NVMVnvmNVMCCIF
300xFFC2:FFC3I2CViicI2COr'ed all flags
290xFFC4:FFC5KBIVkbiKBIKBF
44NXP Semiconductors
Address
(high/low)
VectorVector nameModuleSource
Table continues on the next page...
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
Table 3-1. Reset and interrupt vectors (continued)
Chapter 3 Memory
Vector number
280xFFC6:FFC7MTIM overflagVmtimMTIMTOF
270xFFC8:FFC9Lose of lockVicsICSLOLS
90xFFEC:FFEDPWT1 data readyVpwt1rdyPWT1PWTRDY
80xFFEE:FFEFPWT0 overflowVpwt0ovfPWT0PWTOV
70xFFF0:FFF1PWT0 data readyVpwt0rdyPWT0PWTRDY
60xFFF2:FFF3PWM reloadVmcpwmmcPWMPWMF
Address
(high/low)
VectorVector nameModuleSource
PDB successful
compare
GDU_ACMPU_PH
2
GDU_ACMPV_PH
1
GDU_ACMPW_PH
0
ADC1 conversion
complete
ADC0 conversion
complete
VpdbPDB
Vgducmp2GCMP2
Vgducmp1GCMP1
Vgducmp0GCMP0
Vadc1ADC1COCO
Vadc0ADC0COCO
TCF0
TCF1
TDRE
TC
RDRF
IDLE
LBKDIF
RXEDGIF
OR
NF
FE
PF
CFRU
CFFU
CFRV
CFFV
CFRW
CFFW
CFR
CFF
AMP_OC0
AMP_OC1
Table continues on the next page...
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors45
Register addresses assignments
Table 3-1. Reset and interrupt vectors (continued)
The register definitions vary in different memory sizes. The register addresses of unused
peripherals are reserved. The following table shows the register availability of the
devices.
The registers in the devices are divided into two groups:
• Direct-page registers are located in the first 128 locations in the memory map, so
they can be accessed with efficient direct addressing mode instructions.
• High-page registers are used much less often, so they are located above 0x1800 in
the memory map. This leaves room in the direct page for more frequently used
registers and variables.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
46NXP Semiconductors
Chapter 3 Memory
Direct-page registers can be accessed with efficient direct addressing mode instructions.
which requires only the lower byte of the address. Bit manipulation instructions can be
used to access any bit in a direct-page register.
Table 3-2. Peripheral registers availability
AddressBytesPeripheralPeripheral registersComment
Direct Page Registers
0x0000—0x00001PTAPORT_PTAD
Port data0x0001—0x00011PTBPORT_PTBD
0x0002—0x00021PTCPORT_PTCD
0x0003—0x00031PTAPORT_PTADD
Port data direction0x0004—0x00041PTBPORT_PTBDD
0x0005—0x00051PTCPORT_PTCDD
0x0006—0x00061XBARXBAR_EXTMUXPWM channel 2-to-1 Mux
0x0007—0x00071―Reserved―
0x18E0—0x18E01PTAPORT_PTAPE
0x18E1—0x18E11PTBPORT_PTBPE
0x18E2—0x18E21PTCPORT_PTCPE
0x18E3—0x18E53―Reserved―
0x18E6—0x18E61PTBPORT_PTBHDPort high drive enable
0x18E7—0x18EB5―Reserved―
0x18EC—0x18EF4PTx
0x18F0—0x18F78―Reserved―
0x18F8—0x18FF8SIMSIM_UUID0—SIM_UUID764-bit unique ID
PORT_FCLKDIV, PORT_IOFLT0,
PORT_IOFLT1, PORT_IOFLT2
Port pull-up enable
Port Filter for pins
Several reserved flash memory locations, shown in the following table, are used for
storing values used by several registers. These registers include an 8-byte backdoor key,
NV_BACKKEY, which can be used to gain access to secure memory resources. During
reset events, the contents of NVPROT and NVOPT in the reserved flash memory are
transferred into corresponding FPROT and FOPT registers in the high-page registers area
to control security and block protection options
The 8-byte comparison key can be used to temporarily disengage memory security
provided the key enable field, NV_FSEC[KEYEN], is 10b. This key mechanism can be
accessed only through user code running in secure memory. A security key cannot be
entered directly through background debug commands. This security key can be disabled
completely by programming the NV_FSEC[KEYEN] bit to 0b. If the security key is
disabled, the only way to disengage security is by mass erasing the flash if needed,
normally through the background debug interface and verifying that flash is blank. To
avoid returning to secure mode after the next reset, program the security bits,
NV_FSEC[SEC], to the unsecured state (10b).
3.4Random-access memory (RAM)
The locations in RAM below 0x0100 can be accessed using the more efficient direct
addressing mode. Any single bit in this area can be accessed with the bit manipulation
instructions (BCLR, BSET, BRCLR, and BRSET).
The RAM retains data when the MCU is in low-power wait, or stop mode. At power-on,
the contents of RAM are uninitialized. RAM data is unaffected by any reset provided that
the supply voltage does not drop below the minimum value for RAM retention.
For compatibility with older M68HC05 MCUs, the HCS08 resets the stack pointer to
0x00FF. In this series, re-initialize the stack pointer to the top of the RAM so that the
direct-page RAM can be used for frequently accessed RAM variables and bit-addressable
program variables. Include the following 2-instruction sequence in your reset
initialization routine (where RamLast is equated to the highest address of the RAM in the
NXP-provided equate file).
LDHX #RamLast+1 ;point one past RAM
TXS ;SP<-(H:X-1)
When security is enabled, the RAM is considered a secure memory resource and is not
accessible through BDM or code executing from non-secure memory.
3.5
Flash memory
This device includes flash memory. The flash memory is ideal for single-supply
applications that allow for field reprogramming without requiring external high voltage
sources for program or erase operations. The flash module includes a memory controller
that executes commands to modify flash memory contents. The user interface to the
memory controller consists of the indexed flash common command object (FCCOB)
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors51
System register file
register, which is written to with the command, global address, data, and any required
command parameters. The memory controller must complete the execution of a
command before the FCCOB register is written to with a new command.
CAUTION
A flash byte or longword must be in the erased state before
being programmed. Cumulative programming of bits within a
flash byte or longword is not allowed.
The flash memory is read as two bytes per read. Read access
time is one bus cycle for two bytes. For flash memory, an
erased bit reads 1 and a programmed bit reads 0.
3.6
System register file
This device includes a 8-byte register file that is powered in all power modes.
Also, it retains contents during low-voltage detect (LVD) events and is only reset during
a power-on reset.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
52NXP Semiconductors
Chapter 4
Interrupt
4.1Interrupts
Interrupts save the current CPU status and registers, execute an interrupt service routine
(ISR), and then restore the CPU status so that processing resumes where it left off before
the interrupt. Other than the software interrupt (SWI), which is a program instruction,
interrupts are caused by hardware events such as an edge on the IRQ pin or a timeroverflow event. The debug module can also generate an SWI under certain
circumstances.
If an event occurs in an enabled interrupt source, an associated read-only status flag will
be set. The CPU does not respond unless only the local interrupt enable is a logic 1. The
CCR [I] is 0 to allow interrupts. The CCR [I] is initially set after reset that masks
(prevents) all maskable interrupt sources. The user program initializes the stack pointer
and performs other system setups before clearing the CCR [I] to allow the CPU to
respond to interrupts.
When the CPU receives a qualified interrupt request, it completes the current instruction
before responding to the interrupt. The interrupt sequence obeys the same cycle-by-cycle
sequence as the SWI instruction and consists of:
• Saving the CPU registers on the stack.
• Setting the CCR [I] to mask further interrupts.
• Fetching the interrupt vector for the highest-priority interrupt that is currently
pending.
• Filling the instruction queue with the first three bytes of program information starting
from the address fetched from the interrupt vector locations.
While the CPU is responding to the interrupt, the CCR [I] is automatically set to prevent
another interrupt from interrupting the ISR itself, which is called nesting of interrupts.
Normally, the CCR [I] is restored to 0 when the CCR is restored from the value stacked
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors53
Interrupts
on entry to the ISR. In rare cases, the CCR [I] may be cleared inside an ISR, after
clearing the status flag that generated the interrupt, so that other interrupts can be
serviced without waiting for the first service routine to finish. This practice is
recommended only for the most experienced programmers because it can lead to subtle
program errors that are difficult to debug.
The interrupt service routine ends with a return-from-interrupt (RTI) instruction that
restores the CCR, A, X, and PC registers to their pre-interrupt values by reading the
previously saved information off the stack.
Note
For compatibility with the M68HC08, the H register is not
automatically saved and restored. Push H onto the stack at the
start of the interrupt service routine (ISR) and restore it
immediately before the RTI that is used to return from the ISR.
When two or more interrupts are pending when the CCR [I] is cleared, the highest
priority source is serviced first.
4.1.1
Interrupt stack frame
The following figure shows the contents and organization of a stack frame. Before the
interrupt, the stack pointer (SP) points at the next available byte location on the stack.
The current values of CPU registers are stored on the stack, starting with the low-order
byte of the program counter (PC) and ending with the CCR. After stacking, the SP points
at the next available location on the stack, which is the address that is one less than the
address where the CCR was saved. The PC value that is stacked is the address of the
instruction in the main program that would have executed next if the interrupt had not
occurred.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
54NXP Semiconductors
* High byte (H) of index register is not automatically stacked.
STACKING
ORDER
7
5
5
4
4
3
3
*
1
1
2
2
0
UNSTACKING
ORDER
PROGRAM COUNTER LOW
CONDITION CODE REGISTER
ACCUMULATOR
INDEX REGISTER (LOW BYTE X)
PROGRAM COUNTER HIGH
TOWARD LOWER ADDRESSES
TOWARD HIGHER ADDRESSES
SP BEFORE
SP AFTER
INTERRUPT STACKING
THE INTERRUPT
Chapter 4 Interrupt
Figure 4-1. Interrupt stack frame
When an RTI instruction executes, these values are recovered from the stack in reverse
order. As part of the RTI sequence, the CPU fills the instruction pipeline by reading three
bytes of program information, starting from the PC address recovered from the stack.
The status flag causing the interrupt must be acknowledged (cleared) before returning
from the ISR. Typically, the flag must be cleared at the beginning of the ISR because if
another interrupt is generated by this source it will be registered so that it can be serviced
after completion of the current ISR.
4.1.2
Hardware nested interrupt
This device has interrupt priority controller (IPC) module to provide up to four-level
nested interrupt capability. IPC includes the following features:
• Four-level programmable interrupt priority for each interrupt source.
• Support for prioritized preemptive interrupt service routines
• Low-priority interrupt requests are blocked when high-priority interrupt service
routines are being serviced.
• Higher or equal priority level interrupt requests can preempt lower priority
interrupts being serviced.
• Automatic update of interrupt priority mask with being serviced interrupt source
priority level when the interrupt vector is being fetched.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors55
DECODE
VFETCH
INTOUT0
INTIN0
ILR0[1:0]
ILR47
CPU
ILR0
ILR Register Content
IPM
ADDRESS[5:0]
IPMPS
[1 :0]
[1:0]
[1:0]
[1:0]
[1:0]
INTOUT1
INTIN1
ILR1[1:0]
v
v
v
INTOUT47
INTIN47
ILR47[1:0]
IPCE
x
x
x
x
x
x
xx
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
xx
x
x
x
x
Two bits are pushed during vector fetch
software (PULIPM = 1)
Two bits are pulled by
.
.
.
LOGIC
6
AND SHIFT
(Interrupt Priority Mask Pseudo Stack Register)
+
+
+
.
.
..
.
.
..
.
.
..
Inputs
Outputs
(IPC Enable)
00
1
0
Stop
Interrupts
• Interrupt priority mask can be modified during main flow or interrupt service
execution.
• Previous interrupt mask level is automatically stored when interrupt vector is fetched
(four levels of previous values accommodated)
The IPC works with the existing HCS08 interrupt mechanism to allow nested interrupts
with programmable priority levels. This module also allows implementation of
preemptive interrupt according to the programmed interrupt priority with minimal
software overhead. The IPC consists of three major functional blocks:
• The interrupt mask register update and restore mechanism
4.1.2.1Interrupt priority level register
This set of registers is associated with the interrupt sources to the HCS08 CPU. Each
interrupt priority level is a 2-bit value such that a user can program the interrupt priority
level of each source to priority 0, 1, 2, or 3. Level 3 has the highest priority while level 0
has the lowest. Software can read or write to these registers at any time. The interrupt
priority level comparator set, interrupt mask register update, and restore mechanism use
this information.
4.1.2.2Interrupt priority level comparator set
When the module is enabled, an active interrupt request forces a comparison between the
corresponding ILR and the 2-bit interrupt mask IPM[1:0]. In stop mode, the IPM[1:0] is
substituted by value 00b. If the ILR value is greater than or equal to the value of the
interrupt priority mask (IPM bits in IPCSC), the corresponding interrupt out (INTOUT)
signal will be asserted and signals an interrupt request to the HCS08 CPU.
When the module is disabled, the interrupt request signal from the source is directly
passed to the CPU.
The interrupt priority level programmed in the interrupt priority register will not affect
the inherent interrupt priority arbitration as defined by the HCS08 CPU because the IPC
is an external module. Therefore, if two (or more) interrupts are present in the HCS08
CPU at the same time, the inherent priority in HCS08 CPU will perform arbitration by
the inherent interrupt priority.
4.1.2.3
Interrupt priority mask update and restore mechanism
The interrupt priority mask (IPM) is two bits located in the least significant end of IPCSC
register. These two bits control which interrupt is allowed to be presented to the HCS08
CPU. During vector fetch, the interrupt priority mask is updated automatically with the
value of the ILR corresponding to that interrupt source. The original value of the IPM
will be saved onto IPMPS for restoration after the interrupt service routine completes
execution. When the interrupt service routine completes execution, the user restore the
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors57
Interrupts
original value of IPM by writing 1 to the IPCSC[PULIPM] bit. In both cases, the IPMPS
is a shift register functioning as a pseudo stack register for storing the IPM. When the
IPM is updated, the original value is shifted into IPMPS. The IPMPS can store four levels
of IPM. If the last position of IPMPS is written, the PSF flag indicates that the IPMPS is
full. If all the values in the IPMPS were read, the PSE flag indicates that the IPMPS is
empty.
4.1.2.4Integration and application of the IPC
All interrupt inputs that comes from peripheral modules are asynchronous signals. None
of the asynchronous signals of the interrupts are routed to IPC. The asynchronous signals
of the interrupts are routed directly to SIM module to wake system clocks in stop mode.
Additional care must be exercised when IRQ is reprioritized by IPC. CPU instructions
BIL and BIH need input from IRQ pin. If IRQ interrupt is masked, BIL and BIH still
work but the IRQ interrupt will not occur.
• The interrupt priority controller must be enabled to function. While inside an
interrupt service routine, some work has to be done to enable other higher priority
interrupts. The following is a pseudo code example written in assembly language:
INT_SER :
BCLR INTFLAG,INTFLAG_R ; clear flag that generate interrupt
. ; do the most critical part
. ; which it cannot be interrupted
.
.
.
CLI ; global interrupt enable and nested interrupt
enabled
. ; continue the less critical
.
.
.
BSET PULIPM, PULIPM_R ; restore the old IPM value before leaving
RTI ; then you can return
• A minimum overhead of six bus clock cycles is added inside an interrupt services
routine to enable preemptive interrupts.
• As an interrupt of the same priority level is allowed to pass through IPC to HCS08
CPU, the flag generating the interrupt must be cleared before doing CLI to enable
preemptive interrupts.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
58NXP Semiconductors
Chapter 4 Interrupt
• The IPM is automatically updated to the level the interrupt is servicing and the
original level is kept in IPMPS. Watch out for the full (PSF) bit if nesting for more
than four levels is expected.
• Before leaving the interrupt service routine, the previous levels must be restored
manually by setting PULIPM bit. Watch out for the full (PSF) bit and empty (PSE)
bit.
4.2
IPC memory map and register descriptions
IPC memory map
Absolute
address
(hex)
EIPC Status and Control Register (IPC_SC)8R/W20h4.2.1/59
FInterrupt Priority Mask Pseudo Stack Register (IPC_IPMPS)8R00h4.2.2/60
1860Interrupt Level Setting Registers n (IPC_ILRS0)8R/W00h4.2.3/61
1861Interrupt Level Setting Registers n (IPC_ILRS1)8R/W00h4.2.3/61
1862Interrupt Level Setting Registers n (IPC_ILRS2)8R/W00h4.2.3/61
1863Interrupt Level Setting Registers n (IPC_ILRS3)8R/W00h4.2.3/61
1864Interrupt Level Setting Registers n (IPC_ILRS4)8R/W00h4.2.3/61
1865Interrupt Level Setting Registers n (IPC_ILRS5)8R/W00h4.2.3/61
1866Interrupt Level Setting Registers n (IPC_ILRS6)8R/W00h4.2.3/61
1867Interrupt Level Setting Registers n (IPC_ILRS7)8R/W00h4.2.3/61
Register name
Width
(in bits)
Access Reset value
4.2.1IPC Status and Control Register (IPC_SC)
Section/
page
This register contains status and control bits for the IPC.
Address:
NXP Semiconductors59
Eh base + 0h offset = Eh
Bit76543210
Read
WritePULIPM
Reset
IPCE
00100000
0PSEPSF00
IPC_SC field descriptions
FieldDescription
7
IPCE
Interrupt Priority Controller Enable
This bit enables/disables the interrupt priority controller module.
Table continues on the next page...
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
IPM
IPC memory map and register descriptions
IPC_SC field descriptions (continued)
FieldDescription
0Disables IPCE. Interrupt generated from the interrupt source is passed directly to CPU without
processing (bypass mode). The IPMPS register is not updated when the module is disabled.
1Enables IPCE and interrupt generated from the interrupt source is processed by IPC before passing to
CPU.
6
Reserved
5
PSE
4
PSF
3
PULIPM
This field is reserved.
This read-only field is reserved and always has the value 0.
Pseudo Stack Empty
This bit indicates that the pseudo stack has no valid information. This bit is automatically updated after
each IPMPS register push or pull operation.
Pseudo Stack Full
This bit indicates that the pseudo stack register IPMPS register is full. It is automatically updated after
each IPMPS register push or pull operation. If additional interrupt is nested after this bit is set, the earliest
interrupt mask value(IPM0[1:0]) stacked in IPMPS will be lost.
0IPMPS register is not full.
1IPMPS register is full.
Pull IPM from IPMPS
This bit pulls stacked IPM value from IPMPS register to IPM bits of IPCSC. Zeros are shifted into bit
positions 1 and 0 of IPMPS.
0No operation.
1Writing 1 to this bit causes a 2-bit value from the interrupt priority mask pseudo stack register to be
pulled to the IPM bits of IPCSC to restore the previous IPM value.
2
Reserved
IPMInterrupt Priority Mask
This field is reserved.
This read-only field is reserved and always has the value 0.
This field sets the mask for the interrupt priority control. If the interrupt priority controller is enabled, the
interrupt source with an interrupt level (ILRxx) value that is greater than or equal to the value of IPM will be
presented to the CPU. Writes to this field are allowed, but doing this will not push information to the
IPMPS register. Writing IPM with PULIPM setting when IPCE is already set, the IPM will restore the value
pulled from the IPMPS register, not the value written to the IPM register.
This register is used to store the previous interrupt priority mask level temporarily when
the currently active interrupt is executed.
Address:
Eh base + 1h offset = Fh
Bit76543210
ReadIPM3IPM2IPM1IPM0
Write
Reset
00000000
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
60NXP Semiconductors
Chapter 4 Interrupt
IPC_IPMPS field descriptions
FieldDescription
7–6
IPM3
5–4
IPM2
3–2
IPM1
IPM0Interrupt Priority Mask pseudo stack position 0
Interrupt Priority Mask pseudo stack position 3
This field is the pseudo stack register for IPM3. The most recent information is stored in IPM3.
Interrupt Priority Mask pseudo stack position 2
This field is the pseudo stack register for IPM2. The most recent information is stored in IPM2.
Interrupt Priority Mask pseudo stack position 1
This field is the pseudo stack register for IPM1. The most recent information is stored in IPM1.
This field is the pseudo stack register for IPM0. The most recent information is stored in IPM0.
4.2.3Interrupt Level Setting Registers n (IPC_ILRSn)
This set of registers (ILRS0-ILRS7) contains the user specified interrupt level for each
interrupt source, and indicates the number of the register (ILRSn is ILRS0 through
ILRS7).
Address:
Eh base + 1852h offset + (1d × i), where i=0d to 7d
Bit76543210
Read
Write
Reset
ILRn3ILRn2ILRn1ILRn0
00000000
IPC_ILRSn field descriptions
FieldDescription
7–6
ILRn3
5–4
ILRn2
3–2
ILRn1
ILRn0Interrupt Level Register for Source n*4+0
Interrupt Level Register for Source n*4+3
This field sets the interrupt level for interrupt source n*4+3.
Interrupt Level Register for Source n*4+2
This field sets the interrupt level for interrupt source n*4+2.
Interrupt Level Register for Source n*4+1
This field sets the interrupt level for interrupt source n*4+1.
This field sets the interrupt level for interrupt source n*4+0.
4.3IRQ
The IRQ (interrupt request) module provides a maskable interrupt input.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors61
IRQIE
D
Q
CK
CLR
IRQ
INTERRUPT
REQUEST
V
DD
IRQMOD
IRQF
TO CPU FOR
INSTRUCTIONS
RESET
BYPASS
STOP
STOP
BUSCLK
IRQPE
IRQ
1
0
S
IRQEDG
SYNCHRO-
SYNCHRO-
NIZER
NIZER
IRQPDD
WAKE-UP
INPUTS
MODULES
TO INTERNAL
IRQACK
BIL/BIH
To pullup enable logic for IRQ
IRQ
4.3.1Features
Features of the IRQ module include:
• IRQ signal is from Intermodule crossbar Output, XBAR_OUT15
• IRQ Interrupt Control Bits
• Programmable Edge-only or Edge and Level Interrupt Sensitivity
• Automatic Interrupt Acknowledge
A low level applied to the interrupt request (IRQ) can latch a CPU interrupt request. The
following figure shows the structure of the IRQ module:
IRQ is managed by the IRQSC status and control register. When the IRQ function is
enabled, synchronous logic monitors the Xbar_OUT15 for edge-only or edge-and-level
events. When the MCU is in stop mode and system clocks are shut down, a separate
asynchronous path is used so that the IRQ, if enabled, can wake the MCU.
62NXP Semiconductors
Figure 4-3. IRQ module block diagram
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
Chapter 4 Interrupt
4.3.1.1Configuration options
The IRQ input enable control bit (IRQSC[IRQPE]) must be 1 for the IRQ signal to act as
the IRQ input. The user can choose the polarity of edges or levels detected (IRQEDG),
whether the pin detects edges-only or edges and levels (IRQMOD), or whether an event
causes an interrupt or only sets the IRQF flag, which can be polled by software.
Since IRQ signal is from XBAR_OUT15, it is recommend XBAR_OUT15 is set to logic
high after reset.
BIH and BIL instructions may be used to detect the level on the IRQ signal when IRQ is
enabled.
4.3.1.2Edge and level sensitivity
The IRQSC[IRQMOD] control bit reconfigures the detection logic so that it can detect
edge events and levels. In this detection mode, the IRQF status flag is set when an edge is
detected, if the IRQ signal changes from the de-asserted to the asserted level, but the flag
is continuously set and cannot be cleared as long as the IRQ signal remains at the asserted
level.
4.4
IRQ Memory Map and Register Descriptions
IRQ memory map
Absolute
address
(hex)
7FInterrupt Pin Request Status and Control Register (IRQ_SC)8R/W00h4.4.1/63
Register name
Width
(in bits)
Access Reset value
Section/
page
4.4.1Interrupt Pin Request Status and Control Register (IRQ_SC)
This direct page register includes status and control bits, which are used to configure the
IRQ function, report status, and acknowledge IRQ events.
Address:
7Fh base + 0h offset = 7Fh
Bit76543210
Read0
WriteIRQACK
Reset
00000000
IRQPDDIRQEDGIRQPE
IRQF0
IRQIEIRQMOD
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors63
IRQ Memory Map and Register Descriptions
IRQ_SC field descriptions
FieldDescription
7
Reserved
6
IRQPDD
5
IRQEDG
4
IRQPE
This field is reserved.
This read-only field is reserved and always has the value 0.
Interrupt Request (IRQ) Pull Device Disable
This read/write control bit is used to disable the internal pullup device when the IRQ pin is enabled (IRQPE
= 1) allowing for an external device to be used.
0IRQ pull device enabled if IRQPE = 1.
1IRQ pull device disabled if IRQPE = 1.
Interrupt Request (IRQ) Edge Select
This read/write control bit is used to select the polarity of edges or levels on the IRQ pin that cause IRQF
to be set. The IRQMOD control bit determines whether the IRQ pin is sensitive to both edges and levels or
only edges. When the IRQ pin is enabled as the IRQ input and is configured to detect rising edges, the
optional pullup resistor is disabled.
0IRQ is falling edge or falling edge/low-level sensitive.
1IRQ is rising edge or rising edge/high-level sensitive.
IRQ Pin Enable
This read/write control bit enables the IRQ pin function. When this bit is set the IRQ pin can be used as an
interrupt request.
3
IRQF
2
IRQACK
1
IRQIE
0
IRQMOD
0IRQ pin function is disabled.
1IRQ pin function is enabled.
IRQ Flag
This read-only status bit indicates when an interrupt request event has occurred.
0No IRQ request.
1IRQ event detected.
IRQ Acknowledge
This write-only bit is used to acknowledge interrupt request events (write 1 to clear IRQF). Writing 0 has
no meaning or effect. Reads always return 0. If edge-and-level detection is selected (IRQMOD = 1), IRQF
cannot be cleared while the IRQ pin remains at its asserted level.
IRQ Interrupt Enable
This read/write control bit determines whether IRQ events generate an interrupt request.
0Interrupt request when IRQF set is disabled (use polling).
1Interrupt requested whenever IRQF = 1.
IRQ Detection Mode
This read/write control bit selects either edge-only detection or edge-and-level detection.
0IRQ event on falling/rising edges only.
1IRQ event on falling/rising edges and low/high levels.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
64NXP Semiconductors
Chapter 5
Clock management
5.1Clock module
This device has ICS and LPO clock modules.
The internal clock source (ICS) module provides several clock source options for this
device. The module contains a frequency-locked loop (FLL) that is controllable by either
an internal or external reference clock. The module can select clock from the FLL or
bypass the FLL as a source of the MCU system clock. The selected clock source is
passed through a reduced bus divider, which allows a lower output clock frequency to be
derived.
An internal trimmed 32 kHz is the main clock source for ICS. It also can be used as
reference for windowed COP watchdog (WCOP)
An external clock input is available in this device which can be used as the reference of
ICS to generate system bus clock and analog-to-digital (ADC) modules.
The low-power oscillator (LPO) module is an on-chip low-power oscillator providing
around 20 kHz reference clock to windowed COP watchdog (WCOP).
5.2
These series contain two on-chip clock sources:
NXP Semiconductors65
System clock distribution
• Internal clock source (ICS) module — The main clock source generator providing
bus clock and other reference clocks to core, memory and peripherals
• Low-power oscillator (LPO) module — The on-chip low-power oscillator in PMC
module providing 20 kHz reference clock to windowed COP watchdog (WCOP) to
meet IEC60730 safety standard.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
MTIMFTM
I2C
CPU
BDC
KBI
FLASH
ACMP
ICS
32 kHz
IRC
ICSIRCLK
IPCDBG
2
N
CLKOUT
System Control
WDOG
BUSREF
1/2
1
ICSBDCCLK
ADC0
ADC1
GDU
~
ICSFFCLK
LP
OC
LK
RAM
TCLK
DIV3
ICSOUTCLK
DIV2
MSTRCLK
BUSCLK
LPO
CRC
HSCLK
CLKIN
CLKIN
PWT0
PWT1
PDB
20 MHz after reset
DIV1
PMC
SCI
20 kHz
PWM
System clock distribution
NOTE
The system clock is bus clock.
NOTE
For this device, the master clock and system/bus clock are the
same clock.
The following figure shows a simplified clock connection diagram.
Figure 5-1. System clock distribution diagram
The clock system supplies:
• ICSOUTCLK — This up to 40 MHz clock source is used as the master clock and bus
clock and high speed clock that is the reference to CPU and all peripherals. Control
bits in the ICS control registers determine which of two clock sources is connected:
• 32 kHz Internal reference clock
• Frequency-locked loop (FLL) output
There are three clocks that are derived from this clock source:
• MSTRCLK — Master clock is the clock source for CPU and RAM and DBG
and system/ bus clock
66NXP Semiconductors
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
Chapter 5 Clock management
• BUSCLK — Bus clock is the clock source for all peripherals and flash module
• HSCLK — High speed clock is up to 40 MHz. It can be set to 1:1 bus clock or
2:1 bus clock. It does not support other clock ratio. it can be selected as the clock
source to the PWM and PDB
After reset, ICSOUTCLK clock is around 20 MHz.
• ICSLCLK — This clock source is derived from the digitally controlled oscillator
(DCO) of the ICS when the ICS is configured to run off of the internal or external
reference clock. Development tools can select this internal self-clocked source (20
MHz) to speed up BDC communications in systems where the bus clock is slow.
• ICSIRCLK — This is the internal reference clock and can be selected as the clock
source to the WCOP module.
• ICSFFCLK — This generates the fixed frequency clock (FFCLK) after being
synchronized to the bus clock. It can be selected as clock source, after being divided
by 2, to the FTM and MTIM modules. The frequency of the ICSFFCLK is
determined by the setting of the ICS.
• LPOCLK — This clock is generated from an internal low power oscillator (≈20 kHz)
that is completely independent of the ICS module. The LPOCLK can be selected as
the clock source to the WCOP module.
• TCLK — This is an optional external clock source for the FTM and MTIM and
PWT0 and PWT1 modules. The TCLK must be limited to 1/4th frequency of the bus
clock for synchronization.
• CLKOUT — This clock is a buffered bus clock to a package pin.
• CLKIN — This is an external clock input from package pins. This clock input cannot
be dynamically switched between its inputs (DC - 40 MHz).
5.3
Internal clock source (ICS)
The internal clock source (ICS) module provides clock source options for the MCU. The
module contains a frequency-locked loop (FLL) as a clock source that is controllable by
an internal or external reference clock. The module can provide this FLL clock or the
internal reference clock as a source for the MCU system clock, ICSCLK.
Whichever clock source is chosen, ICSCLK is the output from a bus clock divider
(BDIV), which allows a lower clock frequency to be derived.
Key features of the ICS module are:
• Frequency-locked loop (FLL) is trimmable for accuracy
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors67
20 kHz low-power oscillator (LPO)
• Internal or external reference clocks can be used to control the FLL
• Reference divider is provided for external clock
• Internal reference clock has nine trim bits available
• Internal or external reference clocks can be selected as the clock source for the MCU
• Whichever clock is selected as the source can be divided down by 1, 2, 4, 8, 16, 32,
64 or 128
• FLL Engaged Internal mode is automatically selected out of reset
• A constant divide by 2 of the DCO output that can be select as BDC clock.
• Digitally-controlled oscillator (DCO) optimized for 32 MHz to 40 MHz frequency
range
• FLL lock detector and external clock monitor
• FLL lock detector with interrupt capability
• External reference clock monitor with reset capability
5.4
20 kHz low-power oscillator (LPO)
The 20 kHz low-power oscillator acts as a standalone low-frequency clock source in all
run, wait, and stop modes.
5.5
Peripheral clock gating
This device includes a clock gating system to manage the bus clock sources to the
individual peripherals. Using this system, the user can enable or disable the bus clock to
each of the peripherals at the clock source, eliminating unnecessary clocks to peripherals
that are not in use, thereby reducing the overall run and wait mode currents.
For lowest possible run wait currents, user software must disable the clock source to any
peripheral not in use. The actual clock will be enabled or disabled immediately following
the write to the System Clock Gating Control registers (SIM_SCGCx, x=1, 2, 3). Any
peripheral with a gated clock cannot be used unless its clock is enabled. Writing to the
registers of a peripheral with a disabled clock has no effect.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
68NXP Semiconductors
Chapter 5 Clock management
Note
User software must disable the peripheral before disabling the
clocks to the peripheral. When clocks to a peripheral are reenabled, the peripheral registers need to be re-initialized by user
software.
In stop modes, the bus clock is disabled for all gated peripherals, regardless of the setting
in SIM_SCGCx (x=1,2,3) registers.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors69
Peripheral clock gating
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
70NXP Semiconductors
Chapter 6
Power Management
6.1Introduction
The operating modes of the device are described in this chapter. Entry into each mode,
exit from each mode, and functionality while in each of the modes are described.
6.2
These MCUs feature the following power modes:
6.2.1
Features
• Run mode
• Wait mode
• CPU shuts down to conserve power
• Bus clocks are running
• Full voltage regulation is maintained
• Stop modes
• System clocks stopped; PMC is powered with voltage regulator in standby
• all internal circuits powered for fast recovery
Run mode
This is the normal operating mode. In this mode, the CPU executes code from internal
memory with execution beginning at the address fetched from memory at 0xFFFE:
0xFFFF after reset. The power supply is fully regulating and all peripherals can be active
in run mode.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors71
Features
6.2.2Wait mode
Wait mode is entered by executing a WAIT instruction. Upon execution of the WAIT
instruction, the CPU enters a low-power state in which it is not clocked. The CCR [I] is
cleared when the CPU enters the wait mode, enabling interrupts. When an interrupt
request occurs, the CPU exits the wait mode and resumes processing, beginning with the
stacking operations leading to the interrupt service routine.
While the MCU is in wait mode, there are some restrictions on which background debug
commands can be used. Only the BACKGROUND command and memory-access-withstatus commands are available when the MCU is in wait mode. The memory-access-withstatus commands do not allow memory access, but they report an error indicating that the
MCU is in either stop or wait mode. The BACKGROUND command can be used to
wake the MCU from wait mode and enter active background mode.
6.2.3
Stop mode
To enter stop, the user must execute a STOP instruction with stop mode enabled
(SIM_SOPT1[STOPE] = 1). The ICS enters its standby state, as does the voltage
regulator and the ADC. The states of all of the internal registers and logic, as well as the
RAM content, are maintained. The I/O pin states are not latched at the pin. Instead they
are maintained by virtue of the states of the internal logic driving the pins being
maintained.
Exit from stop is done by asserting reset or through an interrupt. The interrupt include the
asynchronous interrupt from the IRQ or KBI pins or ADC, CMP, I2C, SCI.
If stop is exited by means of the
RESET pin, then the MCU will be reset and operation
will resume after taking the reset vector. Exit by means of an asynchronous interrupt or
the real-time interrupt will result in the MCU taking the appropriate interrupt vector.
Both low voltage detection and low reset are disabled in stop mode.
6.2.4
Active BDM enabled in stop mode
Entry into the active background mode from run mode is enabled if the
BDC_SCR[ENBDM] bit is set. This register is described in the development support. If
BDC_SCR[ENBDM] is set when the CPU executes a STOP instruction, the system
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
72NXP Semiconductors
Chapter 6 Power Management
clocks to the background debug logic remain active when the MCU enters stop mode, so
background debug communication is still possible. In addition, the voltage regulator does
not enter its low-power standby state but maintains full internal regulation.
Most background commands are not available in stop mode. The memory-access-withstatus commands do not allow memory access, but they report an error indicating that the
MCU is in either stop or wait mode. The BACKGROUND command can be used to
wake the MCU from stop and enter active background mode if the BDC_SCR[ENBDM]
bit is set. After entering background debug mode, all background commands are
available.
6.2.5
Power modes behaviors
Executing the WAIT or STOP command puts the MCU in a low power consumption
mode for standby situations. The system integration module (SIM) holds the CPU in a
non-clocked state. The operation of each of these modes is described in the following
subsections. Both STOP and WAIT clear the CCR [I], allowing interrupt to occur. The
following table shows the low power mode behaviors.
Table 6-1. Low power mode behavior
ModeRunWaitStop
PMCFull regulationFull regulationLoose regulation
ICSOnOnStandby
LPOOnOnOptional On
CPUOnStandbyStandby
FlashOnOnStandby
RAMOnStandbyStandby
ADCOnOnOptional on
CMPOnOnOptional on
I/OOnOnStates held
SCI / I2COnOnStandby
FTM / PWT / PWM / MTIMOnOnStandby
WCOPOnOnOptional on
DBGOnOnStandby
IPCOnOnStandby
LVDOnOnStandby
GDUOnOnStandby
PDBOnOnStandby
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors73
Bandgap reference
6.3Bandgap reference
This device includes an on-chip bandgap reference (≈1.2 V) connected to ADC channels.
The bandgap reference voltage does not drop under the full operating voltage even when
the operating voltage is falling. This reference voltage acts as an ideal reference voltage
for accurate measurements.
This device also includes a high accuracy voltage reference VREFH (~4.2 V). This
reference provides high accuracy reference to ADC and 6-bit DAC inside CMP.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
74NXP Semiconductors
Chapter 7
Signal multiplexing and signal descriptions
7.1Introduction
To optimize functionality in small packages, pins have several functions available via
signal multiplexing. Information found here illustrates which of this device's signals are
multiplexed on which external pin.
The Port Control block controls which signal is present on the external pin. Refer to that
chapter to find which register controls the operation of a specific pin.
7.2
The reset state and read/write characteristics of the fields within the PORTx_PCRn
registers is summarized in the table below.
7.3
1. A given peripheral function must be assigned to a maximum of one package pin. Do
2. To ensure the best signal timing for a given peripheral's interface, choose the pins in
Port control and interrupt module features
• 32-pin ports
NOTE
Not all pins are available on the device. See the following
section for details.
Signal multiplexing constraints
not program the same function to more than one pin.
closest proximity to each other.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors75
Pinout
7.4
Pinout
7.4.1Signal multiplexing and pin assignments
The following table shows the signals available on each pin and the locations of these
pins on the devices supported by this document. The Port Control Module is responsible
for selecting which ALT functionality is available on each pin.
individually programmed as an
input or output pin.
PWM output 0 for driving PMOSFET
PWM output 2 for driving PMOSFET
PWM output 2 for driving PMOSFET
Floating 5 V regulator for
PMOS Vgs clamp. It outputs 5
V below VDD. Recommend to
connect 1 µF low ESR ceramic
capacitor, such as X7R
capacitor between VDD and
this pin to stabilize the voltage
regulator output required for
proper device operation.
Connect a 4.7 µF or greater
bypass capacitor between this
pin and VSS to stabilize the
voltage regulator output
required for proper device
operation.
A direct hardware reset on the
processor. When RESET is
12PWT1PWTPWT1IN00–5DefaultITri-StateInput 0 of PWT1
Chip
signal
name
TCLKMTIMTCLKALT2IAn optional external clock
PTB6PORTPTB6ALT3I/OThis GPIO pin can be
VREFH
PWM_FAU
LT0
CLK_INALT2IAn optional external clock
PTC0PORTPTC0ALT3I/OThis GPIO pin can be
CLKOUTSIMCLKOUTALT2OA buffered bus clock output
PTB7PORTPTB7ALT3OThis GPIO pin is an output pin
TXSCITxDALT1I/OSCI transmit data output
XB_OUT1XBARXBAR_OUT1ALT2OCrossbar module output 1
PTA7/ KBI7 PORT/KBIPTA7/KBIP7ALT3I/OThis GPIO pin can be
ModuleModule
signal name
PWMFAULT0ALT1IPWM fault input is used for
Operating
voltage
range (V)
0–5DefaultSInputCMP_REF: Common input of
Alt
function
Type1State
during
reset
pullup
enabled
Signal description
asserted low, the device is
initialized and placed in the
reset state. A Schmitt-trigger
input is used for noise
immunity.
source for the FTM, MTIM,
PWT0 and PWT1 modules.
The TCLK must be limited to
1/4th frequency of the bus
clock for synchronization.
individually programmed as an
input or output pin.
GDU Phase comparator A, B
and C; VREFH: On-chip 4.2V
Voltage reference output.
When this pin is configured as
VREFH, Connect a 2.2 µF
bypass capacitor between this
pin and VSS to stabilize the
voltage reference output
required for proper device
operation.
disabling selected PWM
outputs in case where fault
conditions originate off-chip
source. This clock input cannot
be dynamically switched
between its inputs (DC - 40
MHz)
individually programmed as an
input or output pin.
only.
individually programmed as an
input or output pin with KBI
functionality
Table continues on the next page...
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
78NXP Semiconductors
Chapter 7 Signal multiplexing and signal descriptions
Table 7-1. Pin signal description (continued)
24
QFN
Chip
signal
name
ModuleModule
signal name
Operating
voltage
range (V)
Alt
function
Type1State
during
reset
Signal description
13PWT0PWTPWT0IN00–5DefaultInputTri-StateInput 0 of PWT0
2. When used as an analog input, the signal goes to all analog modules, but the glitch during ADC sampling on this pin may
interfere with other analog inputs shared on this pin.
7.4.3Pinout
The following figures show the pinout diagrams for the devices supported by this
document. Many signals may be multiplexed onto a single pin. To determine what signals
can be used on which pin, see Signal multiplexing and pin assignments.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors81
24
23
22
PTB4
PTB3
PTB2
PTB0
PTA0
21
20
19
PTB1
PTA3
PTA4
16
15
PTA1
PTA2
18
17
PTA5
PTA6
14
13
PTA7
PTB7/BKGD
PTC0
PTB6/RESET_b
12
11
10
9
VSS
8
VDDX
7
VDD
VCLAMP
PWM_WH
PWM_VH
PWM_UH
PTB5
6
5
4
3
2
1
Pinout
Figure 7-1. 24-pin QFN pinout diagram
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
82NXP Semiconductors
Chapter 8
MUXPTA0
PTADD0=0
ALT0 out en
ALT1 out en
ALT2 out en
PTADD0=1
ALT0 out data
ALT0 in en
ALT1 in en
ALT2 in en
ALT1 out data
ALT2 out data
PTAD0
Synchronizer &
Glitch filter
BUS clock
FLTDIV1
FLTDIV2
FLTDIV3
Digital peripheral
or CPU read
0
1
0/1/PTAD0
Analog peripheral
PTAPE0
(is ‘0’ when analog or output,
‘1’ when BKGD/RESET)
PTA0
Port Control (PORT)
8.1Introduction
This device has three sets of I/O ports, which include up to 17 general-purpose I/O pins.
To enable the GPIO function, SIM_MUXPTxL/SIM_MUXPTxH (x=A, B, or C)
registers need be adjusted to select ALT3.
The pin control register configures the following functions for each pin within the 8-bit
port.
• Out data on selected pins
• In/out direction on selected pins
• Pullup/pulldown enable on selected pins
KBI shares with PTA on ALT3, so PTA function works only when KBI_PE is disabled;
The following figure show the structure of normal I/O pin(PTA0 as example).
NXP Semiconductors83
Figure 8-1. Normal I/O structure
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
Port data and data direction
NOTE
For PTB6/RESET_b pin, output is true open-drain drive.
8.2Port data and data direction
Reading and writing of parallel I/O is accomplished through the port data registers
(PORT_PTxD, x=A, B, or C). The input or output is controlled by the direction registers.
Each port pin has an input enable bit and an output enable bit. When PORT_PTxDD[n] =
0 (x=A, B, or C; n=0–7), a read from PORT_PTxD[n] returns the input value of the
associated pin; when PORT_PTxDD[n] = 1, a read from PORT_PTxD[n] returns the last
value written to the port data register.
NOTE
When a digital peripheral module or system function is selected
and enabled on a pin, reads of the port data register still returns
the pin value of the associated pin if PORT_PTxDD[n] = 0.
When a shared analog function is selected for a pin, all digital
pin functions are disabled. A read of the port data register
returns a value of 0 for any bits that have shared analog
functions enabled.
A write of valid data to a port data register must occur before
setting the direction control bit of an associated port pin. This
ensures that the pin will not be driven with an incorrect data
value.
8.3
Internal pullup/pulldown enable
An internal pullup or pulldown device can be enabled for each port pin by setting the
corresponding bit in one of the pullup enable registers (PORT_PTxPE[n], x=A, B, or C,
n=0–7). The internal pullup device is disabled if the pin is configured as an output
direction, or by selecting any output peripheral functions, or input peripheral function like
PWT, regardless of the state of the corresponding pullup enable register bit. The internal
pullup device is also disabled if the pin is controlled by an analog function.
If an SDA, SCL, RX, TX, KBI, or TCLK function is selected and enabled on a pin, the
pullup configuration for that pin still works. The internal pullup device is enabled when
pin select as BKGD/
RESET function.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
84NXP Semiconductors
1(FLTxxx period)2(FLTxxx period)
Input high/low width
Pass to
100%
0
Note: FLTxxx is contents in register PORT_IOFLTn (n=0-2).
Chapter 8 Port Control (PORT)
NOTE
When configuring I2C to use "SDA(PTA5) and SCL(PTA4)"
pins, and if an application uses internal pullups instead of
external pullups, the internal pullups remain present setting
when the pins are configured as outputs, but they are
automatically disabled to save power when the output values
are low.
8.4Input glitch filter
A filter is implemented for each port pin that is configured as a digital input. It can be
used as a simple low-pass filter to filter any glitch that is introduced from the pins of PTx
(x=A,B, or C), I2C, PWT, XBI, RESET, and KBI. The glitch width threshold can be
adjusted easily by setting registers PORT_IOFLTn (n=0–2) and PORT_FCLKDIV
between 1–4096 BUSCLKs (or 1–128 LPOCLKs). This configurable glitch filter can
take the place of an on board external analog filter, and greatly improve the EMC
performance because any glitch will not be wrongly sampled or ignored.
Setting register PORT_IOFLTn (n=0–2) can configure the filter of the whole port. For
example, setting PORT_IOFLT0[FLTA] affects all PTA pins.
Glitches that are shorter than the selected clock period are filtered out; Glitches that are
twice more than the selected clock period are filtered out. It passes to internal circuitry.
Figure 8-2. Input glitch filter
NXP Semiconductors85
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
Memory map and register definition
8.5Memory map and register definition
PORT memory map
Absolute
address
(hex)
0Port A Data Register (PORT_PTAD)8R/W00h8.5.1/86
1Port B Data Register (PORT_PTBD)8R/W00h8.5.2/87
2Port C Data Register (PORT_PTCD)8R/W00h8.5.3/87
3Port A Direction Register (PORT_PTADD)8R/W00h8.5.4/88
4Port B Direction Register (PORT_PTBDD)8R/W00h8.5.5/89
5Port C Direction Register (PORT_PTCDD)8R/W00h8.5.6/89
18E0Port A Pullup Enable Register (PORT_PTAPE)8R/W00h8.5.7/90
18E1Port B Pullup/Pulldown Enable Register (PORT_PTBPE)8R/W00h8.5.8/91
18E2Port C Pullup Enable Register (PORT_PTCPE)8R/W00h8.5.9/91
Port B High Drive Strength Selection Register
(PORT_PTBHD)
Register name
Width
(in bits)
Access Reset value
8R/W00h8.5.10/92
Section/
page
8.5.1Port A Data Register (PORT_PTAD)
Reading and writing of parallel I/O is accomplished through this register.
When a digital peripheral module or system function is selected and enabled on a pin,
reads of this register still returns the pin value of the associated pin if PORT_PTADD[n]
= 0. (n=0-7) When a shared analog function is selected for a pin, all digital pin functions
are disabled. A read of this register returns a value of 0 for any bits that have shared
analog functions enabled.
A write of valid data to this register must occur before setting the direction control bit of
an associated port pin. This ensures that the pin will not be driven with an incorrect data
value.
Address:
0h base + 0h offset = 0h
Bit76543210
Read
Write
Reset
00000000
PTAD
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
86NXP Semiconductors
Chapter 8 Port Control (PORT)
PORT_PTAD field descriptions
FieldDescription
PTADPort A Data Register Bits
For port A pins that are configured as inputs, a read returns the logic level on the pin.
For port A pins that are configured as outputs, a read returns the last value that was written to this register.
Writes are latched into all bits of this register. For port A pins that are configured as outputs, the logic level
is driven out of the corresponding MCU pin.
8.5.2Port B Data Register (PORT_PTBD)
Reading and writing of parallel I/O is accomplished through this register.
When a digital peripheral module or system function is selected and enabled on a pin,
reads of this register still returns the pin value of the associated pin if PORT_PTBDD[n]
= 0 (n=1-7). When a shared analog function is selected for a pin, all digital pin functions
are disabled. A read of this register returns a value of 0 for any bits that have shared
analog functions enabled.
A write of valid data to this register must occur before setting the direction control bit of
an associated port pin. This ensures that the pin will not be driven with an incorrect data
value.
Address:
0h base + 1h offset = 1h
Bit76543210
Read
Write
Reset
00000000
PTBD
PORT_PTBD field descriptions
FieldDescription
PTBDPort B Data Register Bits
For port B pins that are configured as inputs, a read returns the logic level on the pin.
For port B pins that are configured as outputs, a read returns the last value that was written to this register.
Writes are latched into all bits of this register. For port B pins that are configured as outputs, the logic level
is driven out of the corresponding MCU pin.
8.5.3Port C Data Register (PORT_PTCD)
Reading and writing of parallel I/O is accomplished through this register.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors87
Memory map and register definition
When a digital peripheral module or system function is selected and enabled on a pin,
reads of this register still returns the pin value of the associated pin if PTCDD[0] = 0.
When a shared analog function is selected for a pin, all digital pin functions are disabled.
A read of this register returns a value of 0 for any bits that have shared analog functions
enabled.
A write of valid data to this register must occur before setting the direction control bit of
an associated port pin. This ensures that the pin will not be driven with an incorrect data
value.
Address: 0h base + 2h offset = 2h
Bit76543210
Read0
Write
Reset
00000000
PORT_PTCD field descriptions
FieldDescription
7–1
Reserved
0
PTCD
This field is reserved.
This read-only field is reserved and always has the value 0.
Port C Data Register Bits
For port C pins that are configured as inputs, a read returns the logic level on the pin.
For port C pins that are configured as outputs, a read returns the last value that was written to this
register.
Writes are latched into all bits of this register. For port C pins that are configured as outputs, the logic level
is driven out of the corresponding MCU pin.
PTCD
8.5.4Port A Direction Register (PORT_PTADD)
Address: 0h base + 3h offset = 3h
Bit76543210
Read
Write
Reset
00000000
PORT_PTADD field descriptions
FieldDescription
PTADDPort A Direction Register Bits
These bits control the direction of port A pins and what is read for PTAD reads.
0Pin is configured as general-purpose input, for the GPIO function.
1Pin is configured as general-purpose output, for the GPIO function.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
88NXP Semiconductors
PTADD
8.5.5Port B Direction Register (PORT_PTBDD)
Address: 0h base + 4h offset = 4h
Bit76543210
Read
Write
Reset
00000000
PORT_PTBDD field descriptions
FieldDescription
PTBDDPort B Direction Register Bits
These bits control the direction of port B pins and what is read for PTBD reads.
PTBDD
Chapter 8 Port Control (PORT)
NOTE:
0Pin is configured as general-purpose input, for the GPIO function.
1Pin is configured as general-purpose output, for the GPIO function.
PTB7 pin is output only.
8.5.6Port C Direction Register (PORT_PTCDD)
Address: 0h base + 5h offset = 5h
Bit76543210
Read0
Write
Reset
FieldDescription
7–1
Reserved
0
PTCDD
00000000
PORT_PTCDD field descriptions
This field is reserved.
This read-only field is reserved and always has the value 0.
Port C Direction Register Bits
These bits control the direction of port C pins and what is read for PTCD reads.
PTCDD
0Pin is configured as general-purpose input, for the GPIO function.
1Pin is configured as general-purpose output, for the GPIO function.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors89
Memory map and register definition
8.5.7Port A Pullup Enable Register (PORT_PTAPE)
An internal pullup device can be enabled for each port pin by setting the corresponding
bit in one of the pullup enable registers (PTAPE[n], n=0-7). The internal pullup device is
disabled regardless of the state of the corresponding pullup enable register bit if:
• the pin is configured as an output direction
• by selecting any output peripheral functions
• input peripheral function like PWT
The internal pullup device is also disabled if the pin is controlled by an analog function.
If an SDA, SCL, RX, TX, KBI, or TCLK function is selected and enabled on a pin, the
pullup configuration for that pin still works. The internal pullup device is enabled when
pin select as BKGD/RESET function.
NOTE
When configuring I2C to use "SDA(PTA5) and SCL(PTA4)"
pins, and if an application uses internal pullups instead of
external pullups, the internal pullups remain present setting
when the pins are configured as outputs, but they are
automatically disabled to save power when the output values
are low.
Address:
0h base + 18E0h offset = 18E0h
Bit76543210
Read
Write
Reset
00000000
PORT_PTAPE field descriptions
FieldDescription
PTAPEPull Enable for Port A Bit
These bits determines if the internal pullup device is enabled for the associated PTA pin. For port A pins
that are configured as outputs, these bits have no effect and the internal pullup devices are disabled.
0Internal pullup device disabled for port A bit n.
1Internal pullup device enabled for port A bit n.
PTAPE
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
90NXP Semiconductors
Chapter 8 Port Control (PORT)
8.5.8Port B Pullup/Pulldown Enable Register (PORT_PTBPE)
Address: 0h base + 18E1h offset = 18E1h
Bit76543210
Read
Write
Reset
00000000
PORT_PTBPE field descriptions
FieldDescription
PTBPEPull Enable for Port B Bit
These bits determines if the internal pullup/pulldown device is enabled for the associated PTB pin. For port
B pins that are configured as outputs, these bits have no effect and the internal pullup/pulldown devices
are disabled.
PTBPE
NOTE:
0Internal pullup//pulldown device disabled for port B bit n.
1Internal pullup/pulldown device enabled for port B bit n.
PTB0-PTB2 is default pulldown, can not be pullup enabled. PTB3-PTB5 can be pulldown
enabled.
8.5.9Port C Pullup Enable Register (PORT_PTCPE)
Address: 0h base + 18E2h offset = 18E2h
Bit76543210
Read0
Write
Reset
FieldDescription
7–1
Reserved
0
PTCPE
00000000
PORT_PTCPE field descriptions
This field is reserved.
This read-only field is reserved and always has the value 0.
Pull Enable for Port C Bit
These bits determines if the internal pullup device is enabled for the associated PTC pin. For port C pins
that are configured as outputs, these bits have no effect and the internal pullup devices are disabled.
PTCPE
0Internal pullup device disabled for port C bit n.
1Internal pullup device enabled for port C bit n.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors91
Memory map and register definition
8.5.10Port B High Drive Strength Selection Register (PORT_PTBHD)
Output extreme high drive strength sink/source current can be enabled by setting the
corresponding bit in the PORT_PTBHD register for PTB7. Output extremely high sink/
source current is enabled when they are operated as output. Extreme high drive function
is disabled if the pin is configured as an input by the parallel I/O control logic. When
configured as any shared peripheral function, extreme high drive function still works on
these pins, but only when they are configured as outputs.
Address:
0h base + 18E6h offset = 18E6h
Bit76543210
Read
Write
Reset
HD7
00000000
0
PORT_PTBHD field descriptions
FieldDescription
7
HD7
ReservedThis field is reserved.
Output High Drive Strength Selection for Port B Bit 7
This bit enables the extreme high drive capability of associated PTB pin.
0Low output drive enabled for port B bit 7.
1High output drive enabled for port B bit 7.
This read-only field is reserved and always has the value 0.
8.5.11Port Clock Division Register (PORT_FCLKDIV)
Configure the high/low level glitch width threshold. Glitches that are shorter than the
selected clock width will be filtered out; glitches that are more than twice the selected
clock width will not be filtered out (they will pass to the internal circuitry).
This register sets the filters for input from PTA to PTC.
Address:
0h base + 18EDh offset = 18EDh
Bit76543210
Read0
Write
Reset
00000000
FLTCFLTBFLTA
PORT_IOFLT0 field descriptions
FieldDescription
7–6
Reserved
This field is reserved.
This read-only field is reserved and always has the value 0.
Table continues on the next page...
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors93
Memory map and register definition
PORT_IOFLT0 field descriptions (continued)
FieldDescription
5–4
FLTC
3–2
FLTB
FLTAFilter selection for input from PTA
Filter selection for input from PTC
00BUSCLK
01FLTDIV1
10FLTDIV2
11FLTDIV3
Filter selection for input from PTB
00BUSCLK
01FLTDIV1
10FLTDIV2
11FLTDIV3
00BUSCLK
01FLTDIV1
10FLTDIV2
11FLTDIV3
8.5.13Port Filter Register 1 (PORT_IOFLT1)
This register sets the filters for input.
Address:
0h base + 18EEh offset = 18EEh
Bit76543210
Read
Write
Reset
FLTKBIFLTRST
00000000
PORT_IOFLT1 field descriptions
FieldDescription
7–6
FLTKBI
5–4
FLTRST
ReservedThis field is reserved.
Filter selection for input from KBI
00No filter
01Select FLTDIV1, and will switch to FLTDIV3 in stop mode automatically.
10Select FLTDIV2, and will switch to FLTDIV3 in stop mode automatically.
11FLTDIV3
Filter selection for input from RESET
00No filter.
01Select FLTDIV1, and will switch to FLTDIV3 in stop mode automatically.
10Select FLTDIV2, and will switch to FLTDIV3 in stop mode automatically.
11FLTDIV3
This read-only field is reserved and always has the value 0.
0
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
94NXP Semiconductors
8.5.14Port Filter Register 2 (PORT_IOFLT2)
This register sets the filters for input from PWT, I2C and XB.
Address: 0h base + 18EFh offset = 18EFh
Bit76543210
Read
Write
Reset
FieldDescription
7–6
FLTPWT1
5–4
FLTPWT0
3–2
FLTI2C
FLTXBIFilter Selection For Input from XB_IN0 and XB_IN1
FLTPWT1FLTPWT0FLTI2CFLTXBI
00000000
PORT_IOFLT2 field descriptions
Filter Selection For Input from PWT1
00No filter
01FLTDIV1
10FLTDIV2
11BUSCLK
Filter Selection For Input from PWT0
00No filter
01FLTDIV1
10FLTDIV2
11BUSCLK
Filter Selection For Input from SDA and SCL.
00No filter
01FLTDIV1
10FLTDIV2
11BUSCLK
Chapter 8 Port Control (PORT)
00No filter
01FLTDIV1
10FLTDIV2
11FLTDIV3
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors95
Memory map and register definition
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
96NXP Semiconductors
Chapter 9
System Integration Module (SIM)
9.1Chip specific windowed COP
The windowed COP (WCOP) module triggers a system reset if it is allowed to time out.
The program is expected to periodically reload the COP timer, thereby preventing it from
timing out. However, if a fault occurs that causes the program to stop working, the timer
will not be reloaded and it will time out. The resulting trigger of a system reset brings the
system back from an unresponsive state into a normal state.
After any reset, the WCOP is enabled. If the WCOP is not used in an application, it can
be disabled by clearing SIM_SOPT1[COPT].
The WCOP counter is reset by writing 0x55 and 0xAA (in that order) to the address of
the SIM_SRS during the selected timeout period. Writes do not affect the data in that
field. As soon as the write sequence is complete, the WCOP timeout period is restarted. If
the program fails to perform this restart during the timeout period, the microcontroller
resets. Also, if any value other than 0x55 or 0xAA is written to the SIM_SRS register, the
microcontroller immediately resets.
Windowed watchdog operation is available by setting SIM_SOPT1[COPW], In this
mode, writes to service watchdog register SIM_SRS to clear WCOP counter must be in a
selected timeout period. A premature write immediately resets the chip.
WCOP has four clock selections: BUSCLK (20 MHz), ICSIRCLK (up to the 32 kHz)
and an independent clock source LPOCLK (up to the 20 kHz), CLKIN
Customization:
• Primary clock: BUSCLK (20 MHz)
• Input clock option: BUSCLK (20 MHz); ICSIRCLK (up to the 32 kHz), LPOCLK
(up to the 20 kHz), CLKIN (40 MHz)
• WCOP is a part of SIM. Its register set is a subset of SIM registers.
Module Instances:
• One
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors97
System device identification (SDID)
9.2System device identification (SDID)
This device is hard coded to the value 0x45 in the SIM_SDID registers.
9.3Universally unique identification (UUID)
This device contains up to 64-bit UUID to identify each device in this family. The intent
of UUID is to enable distributed systems to uniquely identify information without
significant central coordination.
9.4
Reset and system initialization
Resetting the MCU provides a way to start processing from a set of known initial
conditions. During reset, most control and status registers are forced to initial values and
the program counter is loaded from the reset vector (0xFFFE:0xFFFF). On-chip
peripheral modules are disabled and I/O pins are initially configured as default functions
on ALT0. The CCR [I] bit is set to block maskable interrupts so that the user program has
a chance to initialize the stack pointer (SP) and system control settings. SP is forced to
0x00FF at reset.
This device has the following sources for reset:
• Power-on reset (POR)
• Low-voltage detect (LVD)
• Windowed COP (COP) timer
• Illegal opcode detect (ILOP)
• Illegal address detect (ILAD)
• Background debug forced reset
• External reset pin (RESET)
• Loss of clock reset (LOC)
• Flash illegal access detect (FILA)
Each of these sources, with the exception of the background debug forced reset, has an
associated bit in the system reset status (SRS) register.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
98NXP Semiconductors
Chapter 9 System Integration Module (SIM)
When the MCU is reset by SIM_SRS[ILAD], the address of illegal address is captured in
illegal address register, which is a 16-bit register consisting of SIM_ILLAL and
SIM_ILLAH that contains the LSB and MSB 8-bit of the address, respectively.
9.5Computer operating properly (COP) watchdog
The COP watchdog is used to force a system reset when the application software fails to
execute as expected. To prevent a system reset from the COP timer (when it is enabled),
application software must reset the COP counter periodically. If the application program
gets lost and fails to reset the COP counter before it times out, a system reset is generated
to force the system back to an known starting point. After any reset, the COP watchdog is
enabled (see System Options Register 1 (SIM_SOPT1) for additional information). If the
COP watchdog is not used in an application, it can be disabled by clearing
SOPT1[COPT].
The COP counter is reset by writing 0x55 and 0xAA (in this order) to the address of SRS
during the selected timeout period. Writes do not affect the data in the read-only SRS. As
soon as the write sequence is done, the COP timeout period is restarted. If the program
fails to do this during the time-out period, the MCU will reset. Also, if any value other
than 0x55 or 0xAA is written to SRS, the MCU is immediately reset. The
SOPT1[COPCLKS] selects the clock source used for the COP timer. The clock source
options are
• bus clock;
• internal 20 kHz LPO clock source
• 32 kHz ICSIRCLK
• CLK_IN from external pin
With each clock source, there are three associated time-outs controlled by
SOPT1[COPT]. The following table summaries the control functions of the
SOPT1[COPCLKS] and SOPT1[COPT] bits. The COP watchdog defaults to operation
from the 20 kHz LPO clock source and the longest time-out (210 cycles).
When the bus clock source is selected, windowed COP operation is available by setting
SOPT1[COPW]. In this mode, writes to the SRS register to clear the COP timer must
occur in the last 25% of the selected timeout period. A premature write immediately
resets the MCU. When the LPO, ICSIRCLK, or CLK_IN clock source is selected,
windowed COP operation is not available. The COP counter is initialized by the first
writes to the SOPT1 registers and after any system reset. Subsequent writes to SOPT1
have no effect on COP operation. Even if the application will use the reset default
settings of SOPT1[COPT], SOPT1[COPCLKS], and SOPT1[COPW] bits, the user must
write to the write-once SOPT1 register during reset initialization to lock in the settings.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
NXP Semiconductors99
System options
This will prevent accidental changes if the application program gets lost. The write to
SRS that services (clears) the COP counter must not be placed in an interrupt service
routine (ISR) because the ISR could continue to be executed periodically even if the main
application program fails.
If the bus clock source is selected, the COP counter does not increment while the MCU is
in background debug mode or while the system is in stop mode. The COP counter
resumes when the MCU exits background debug mode or stop mode.
If the 20 kHz LPO, ICSIRCLK, or CLK_IN clock source is selected, the COP counter is
re-initialized to zero upon entry to either background debug mode or stop mode and
begins from zero upon exit from background debug mode or stop mode.
Table 9-1. Configuration option
Control bitsClock sourceCOP window opens1COP overflow count
1. Windowed COP operation requires the user to clear the COP timer in the last 25% of the selected timeout period. This
column displays the minimum number of clock counts required before the COP timer can be reset when in windowed COP
mode (SOPT1[COPW] = 1).
9.6
9.6.1
System options
BKGD pin
After POR, PTB7/CLKOUT/BKGD/MS pin functions as BKGD output. Other functions
are selected by SIM_MUXPTBH[MUXPTB7]. This pin is an output only when
configured as PTB7.
MC9S08SU16 Reference Manual, Rev. 5, 4/2017
100NXP Semiconductors
Loading...
+ 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.