NXP S08SF Reference guide

Type
Reference guide
HCS08
Microcontrollers
freescale.com
MC9S08SF4
Reference Manual
MC9S08SF4
Rev. 3
9/2011
8-Bit S08 Central Processor Unit (CPU)
Up to 40 MHz CPU at 2.7 V to 5.5 V across temperature
range of –40 C to 125 C
HC08 instruction set with added BGND instruction
Support for up to 32 interrupt/reset sources
•On-Chip Memory
4 KB flash read/program/erase over full operating
voltage and temperature
128-byte random-access memory (RAM)
Security circuitry to prevent unauthorized access to
RAM and flash contents
Power-Saving Modes
Two low power stop modes; reduced power wait mode
Allows clocks to remain enabled to specific peripherals
in stop3 mode
Clock Source Options
Internal Clock Source (ICS) — Internal clock source
module containing a frequency-locked-loop (FLL)
controlled by internal or external reference; precision
trimming of internal reference allows 0.2% resolution
and 1% deviation over 0–70 C and voltage, 2%
deviation over –40–85 C and voltage, or 3% deviation
over –40–125 C and voltage; supporting bus
frequencies up to 20 MHz
System Protection
Watchdog computer operating properly (COP) reset
with option to run from dedicated 1 kHz internal clock
source or bus clock
Low-voltage detection with reset or interrupt; selectable
trip points
Illegal opcode detection with reset
Illegal address detection with reset
Flash block protection
Development Support
Single-wire background debug interface
Breakpoint capability to allow single breakpoint setting
during in-circuit debugging (plus two more
breakpoints)
On-chip in-circuit emulator (ICE) debug module
containing two comparators and nine trigger modes
Peripherals
IPC — Prioritize interrupt sources besides inherent
CPU interrupt table; support up to 32 interrupt sources
and up to 4-level preemptive interrupt nesting
ADC — 8-channel, 10-bit resolution; 2.5 s conversion
time; automatic compare function; temperature sensor;
internal bandgap reference channel; operation in stop;
fully functional from 2.7 V to 5.5 V
TPM — One 40 MHz 6-channel and one 40 MHz
1-channel timer/pulse-width modulators (TPM)
modules; selectable input capture, output compare, or
buffered edge- or center-aligned PWM on each channel
MTIM16 — Two 16-bit modulo timers
PWT — Two 16-bit pulse width timers (PWT);
selectable driving clock, positive/negative/period
capture
PRACMP — Two programmable reference analog
comparators with eight optional inputs for both positive
and negative inputs; 32-level internal reference voltages
scaled by selectable reference inputs
IIC — Inter-integrated circuit bus module capable of
operation up to 100 kbps with maximum bus loading;
multi-master operation; programmable slave address;
interrupt-driven byte-by-byte data transfer; broadcast
mode; 10-bit addressing
KBI — 4-pin keyboard interrupt module with software
selectable polarity on edge or edge/level modes
FDS — Shut down output pin upon fault detection; the
fault sources can be optional enabled separately; the
output pin can be configured as output 1,0 and high
impedance when a fault occurs based on module
configuration
Input/Output
18 GPIOs including one input-only pin and one
output-only pin
Hysteresis and configurable pullup device on all input
pins; schmitt trigger on PWT input pins; configurable
slew rate and drive strength on all output pins.
Package Options
16-pin TSSOP
20-pin TSSOP
MC9S08SF4 Features
MC9S08SF4
Reference Manual
MC9S08SF4
Rev. 3
9/2011
Freescale‚ and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
Freescale Semiconductor, Inc., 2009-2011. All rights reserved.
MC9S08SF4 Series MCU Reference Manual, Rev. 3
6 Freescale Semiconductor
Revision History
To provide the most up-to-date information, the revision of our documents on the World Wide Web will
be the most current. Your printed copy may be an earlier revision. To verify you have the latest information
available, refer to:
http://freescale.com
The following revision history table summarizes changes contained in this document.
Revision
Number
Revision
Date
Description of Changes
2 4/24/2009 Initial public release.
3 9/21/2011
Added a note and descriptions on V
DD50
and V
DD25
in the Section 11.1,
“Introduction”.
MC9S08SF4 Series MCU Reference Manual, Rev. 3
Freescale Semiconductor 7
List of Chapters
Chapter Number Title Page
Chapter 1 Device Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Chapter 2 Pins and Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
Chapter 3 Modes of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Chapter 4 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Chapter 5 Resets, Interrupts, and System Configuration . . . . . . . . . . . . . . . 59
Chapter 6 Parallel Input/Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Chapter 7 Keyboard Interrupt (S08KBIV2) . . . . . . . . . . . . . . . . . . . . . . . . . . .87
Chapter 8 Central Processor Unit (S08CPUV2) . . . . . . . . . . . . . . . . . . . . . . . 95
Chapter 9 Internal Clock Source (S08ICSV3) . . . . . . . . . . . . . . . . . . . . . . . . 115
Chapter 10 16-Bit Modulo Timer (S08MTIM16V1) . . . . . . . . . . . . . . . . . . . . . 129
Chapter 11 Programmable Reference Analog
Comparator (S08PRACMPV1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Chapter 12 10-Bit Analog-to-Digital Converter (S08ADC10V1) . . . . . . . . . . 153
Chapter 13 16-Bit Timer/PWM (S08TPMV3). . . . . . . . . . . . . . . . . . . . . . . . . .181
Chapter 14 Fault Detection and Shutdown(S08FDSV1). . . . . . . . . . . . . . . .205
Chapter 15 Pulse Width Timer(S08PWTV1) . . . . . . . . . . . . . . . . . . . . . . . . .219
Chapter 16 Inter-Integrated Circuit (S08IICV2) . . . . . . . . . . . . . . . . . . . . . . .235
Chapter 17 Interrupt Priority Controller (S08IPCV1) . . . . . . . . . . . . . . . . . . 253
Chapter 18 Development Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
MC9S08SF4 Series MCU Reference Manual, Rev. 3
Freescale Semiconductor 9
Contents
Section Number Title Page
Chapter 1
Device Overview
1.1 Introduction .....................................................................................................................................19
1.2 MCU Block Diagram ......................................................................................................................20
1.3 System Clock Distribution ..............................................................................................................21
Chapter 2
Pins and Connections
2.1 Introduction .....................................................................................................................................23
2.2 Device Pin Assignment ...................................................................................................................23
2.3 Recommended System Connections ...............................................................................................24
2.3.1 Power (V
DD
, V
SS
) .............................................................................................................24
2.3.2 RESET Pin ........................................................................................................................25
2.3.3 Background/Mode Select (BKGD/MS) ............................................................................25
2.3.4 External Interrupt Pin (IRQ) .............................................................................................26
2.3.5 General-Purpose I/O and Peripheral Ports ........................................................................26
Chapter 3
Modes of Operation
3.1 Introduction .....................................................................................................................................29
3.2 Features ...........................................................................................................................................29
3.3 Run Mode ........................................................................................................................................29
3.4 Active Background Mode ...............................................................................................................29
3.5 Wait Mode .......................................................................................................................................30
3.6 Stop Modes ......................................................................................................................................31
3.6.1 Stop3 Mode .......................................................................................................................31
3.6.2 Stop2 Mode .......................................................................................................................32
3.6.3 On-Chip Peripheral Modules in Stop Modes ....................................................................33
Chapter 4
Memory
4.1 MC9S08SF4 Series Memory Map ..................................................................................................35
4.1.1 Reset and Interrupt Vector Assignments ...........................................................................37
4.2 Register Addresses and Bit Assignments ........................................................................................38
4.3 RAM (System RAM) ......................................................................................................................44
4.4 Flash ................................................................................................................................................44
4.4.1 Features .............................................................................................................................45
4.4.2 Program and Erase Times .................................................................................................45
4.4.3 Program and Erase Command Execution .........................................................................46
MC9S08SF4 Series MCU Reference Manual, Rev. 3
10 Freescale Semiconductor
4.4.4 Burst Program Execution ..................................................................................................47
4.4.5 Access Errors ....................................................................................................................49
4.4.6 Flash Block Protection ......................................................................................................49
4.4.7 Vector Redirection ............................................................................................................50
4.5 Security ............................................................................................................................................50
4.6 Flash Registers and Control Bits .....................................................................................................51
4.6.1 Flash Clock Divider Register (FCDIV) ............................................................................52
4.6.2 Flash Options Register (FOPT and NVOPT) ....................................................................53
4.6.3 Flash Configuration Register (FCNFG) ...........................................................................54
4.6.4 Flash Protection Register (FPROT and NVPROT) ..........................................................55
4.6.5 Flash Status Register (FSTAT) ..........................................................................................55
4.6.6 Flash Command Register (FCMD) ...................................................................................57
Chapter 5
Resets, Interrupts, and System Configuration
5.1 Introduction .....................................................................................................................................59
5.2 Features ...........................................................................................................................................59
5.3 MCU Reset ......................................................................................................................................59
5.4 Computer Operating Properly (COP) Watchdog .............................................................................60
5.5 Interrupts .........................................................................................................................................61
5.5.1 Interrupt Stack Frame .......................................................................................................61
5.5.2 External Interrupt Request (IRQ) Pin ...............................................................................62
5.5.3 Interrupt Vectors, Sources, and Local Masks ...................................................................63
5.6 Low-Voltage Detect (LVD) System ................................................................................................64
5.6.1 Power-On Reset Operation ...............................................................................................64
5.6.2 LVD Reset Operation ........................................................................................................65
5.6.3 Low-Voltage Warning (LVW) Interrupt Operation ...........................................................65
5.7 Reset, Interrupt, and System Control Registers and Control Bits ...................................................65
5.7.1 Interrupt Pin Request Status and Control Register (IRQSC) ............................................65
5.7.2 System Reset Status Register (SRS) .................................................................................67
5.7.3 System Background Debug Force Reset Register (SBDFR) ............................................68
5.7.4 System Options Register 1 (SOPT1) ................................................................................68
5.7.5 System Options Register 2 (SOPT2) ................................................................................70
5.7.6 System Device Identification Register (SDIDH, SDIDL) ................................................71
5.7.7 System Power Management Status and Control 1 Register (SPMSC1) ...........................72
5.7.8 System Power Management Status and Control 2 Register (SPMSC2) ...........................73
Chapter 6
Parallel Input/Output
6.1 Introduction .....................................................................................................................................75
6.2 Port Data and Data Direction ..........................................................................................................75
6.3 Pin Control ......................................................................................................................................76
6.3.1 Internal Pullup Enable ......................................................................................................77
6.3.2 Output Slew Rate Control Enable .....................................................................................77
6.3.3 Output Drive Strength Select ............................................................................................77
MC9S08SF4 Series MCU Reference Manual, Rev. 3
Freescale Semiconductor 11
6.4 Pin Behavior in Stop Modes ............................................................................................................78
6.5 Parallel I/O and Pin Control Registers ............................................................................................78
6.5.1 Port A I/O Registers (PTAD and PTADD) ........................................................................78
6.5.2 Port A Pin Control Registers (PTAPE, PTASE, PTADS) .................................................79
6.5.3 Port B I/O Registers (PTBD and PTBDD) ........................................................................80
6.5.4 Port B Pin Control Registers (PTBPE, PTBSE, PTBDS) .................................................81
6.5.5 Port C I/O Registers (PTCD and PTCDD) ........................................................................83
6.5.6 Port C Pin Control Registers (PTCPE, PTCSE, PTCDS) .................................................84
Chapter 7
Keyboard Interrupt (S08KBIV2)
7.1 Introduction .....................................................................................................................................87
7.1.1 Features .............................................................................................................................89
7.1.2 Modes of Operation ..........................................................................................................89
7.1.3 Block Diagram ..................................................................................................................89
7.2 External Signal Description ............................................................................................................90
7.3 Register Definition ..........................................................................................................................90
7.3.1 KBI Status and Control Register (KBISC) .......................................................................90
7.3.2 KBI Pin Enable Register (KBIPE) ....................................................................................91
7.3.3 KBI Edge Select Register (KBIES) ..................................................................................91
7.4 Functional Description ....................................................................................................................92
7.4.1 Edge Only Sensitivity .......................................................................................................92
7.4.2 Edge and Level Sensitivity ...............................................................................................92
7.4.3 KBI Pullup/Pulldown Resistors ........................................................................................93
7.4.4 KBI Initialization ..............................................................................................................93
Chapter 8
Central Processor Unit (S08CPUV2)
8.1 Introduction .....................................................................................................................................95
8.1.1 Features .............................................................................................................................95
8.2 Programmers Model and CPU Registers .......................................................................................96
8.2.1 Accumulator (A) ...............................................................................................................96
8.2.2 Index Register (H:X) ........................................................................................................96
8.2.3 Stack Pointer (SP) .............................................................................................................97
8.2.4 Program Counter (PC) ......................................................................................................97
8.2.5 Condition Code Register (CCR) .......................................................................................97
8.3 Addressing Modes ...........................................................................................................................99
8.3.1 Inherent Addressing Mode (INH) .....................................................................................99
8.3.2 Relative Addressing Mode (REL) ....................................................................................99
8.3.3 Immediate Addressing Mode (IMM) ................................................................................99
8.3.4 Direct Addressing Mode (DIR) ........................................................................................99
8.3.5 Extended Addressing Mode (EXT) ................................................................................100
8.3.6 Indexed Addressing Mode ..............................................................................................100
8.4 Special Operations .........................................................................................................................101
8.4.1 Reset Sequence ...............................................................................................................101
MC9S08SF4 Series MCU Reference Manual, Rev. 3
12 Freescale Semiconductor
8.4.2 Interrupt Sequence ..........................................................................................................101
8.4.3 Wait Mode Operation ......................................................................................................102
8.4.4 Stop Mode Operation ......................................................................................................102
8.4.5 BGND Instruction ...........................................................................................................103
8.5 HCS08 Instruction Set Summary ..................................................................................................104
Chapter 9
Internal Clock Source (S08ICSV3)
9.1 Introduction ...................................................................................................................................115
9.1.1 Features ...........................................................................................................................117
9.1.2 Block Diagram ................................................................................................................117
9.1.3 Modes of Operation ........................................................................................................118
9.2 External Signal Description ..........................................................................................................119
9.3 Register Definition ........................................................................................................................119
9.3.1 ICS Control Register 1 (ICSC1) .....................................................................................120
9.3.2 ICS Control Register 2 (ICSC2) .....................................................................................121
9.3.3 ICS Trim Register (ICSTRM) .........................................................................................122
9.3.4 ICS Status and Control (ICSSC) .....................................................................................122
9.4 Functional Description ..................................................................................................................124
9.4.1 Operational Modes ..........................................................................................................124
9.4.2 Mode Switching ..............................................................................................................126
9.4.3 Bus Frequency Divider ...................................................................................................127
9.4.4 Low Power Bit Usage .....................................................................................................127
9.4.5 DCO Maximum Frequency with 32.768 kHz Oscillator ................................................127
9.4.6 Internal Reference Clock ................................................................................................127
9.4.7 External Reference Clock ...............................................................................................128
9.4.8 Fixed Frequency Clock ...................................................................................................128
9.4.9 Local Clock .....................................................................................................................128
Chapter 10
16-Bit Modulo Timer (S08MTIM16V1)
10.1 Introduction ...................................................................................................................................129
10.2 Features .........................................................................................................................................131
10.2.1 Block Diagram ................................................................................................................131
10.2.2 Modes of Operation ........................................................................................................131
10.3 External Signal Description ..........................................................................................................132
10.3.1 TCLK — External Clock Source Input into MTIM16 ...................................................132
10.4 Register Definition ........................................................................................................................132
10.4.1 MTIM16 Status and Control Register (MTIMxSC) .......................................................133
10.4.2 MTIM16 Clock Configuration Register (MTIMxCLK) .................................................134
10.4.3 MTIM16 Counter Register High/Low (MTIMxCNTH:L) .............................................135
10.4.4 MTIM16 Modulo Register High/Low (MTIMxMODH/MTIMxMODL) ......................136
10.5 Functional Description ..................................................................................................................137
10.5.1 MTIM16 Operation Example .........................................................................................139
MC9S08SF4 Series MCU Reference Manual, Rev. 3
Freescale Semiconductor 13
Chapter 11
Programmable Reference Analog Comparator (S08PRACMPV1)
11.1 Introduction ...................................................................................................................................141
11.1.1 Features ...........................................................................................................................144
11.1.2 Modes of Operation ........................................................................................................144
11.1.3 Block Diagram ...............................................................................................................144
11.2 External Signal Description ..........................................................................................................145
11.3 Register Definition ........................................................................................................................146
11.3.1 PRACMP Control and Status Register (PRACMPxCS) ................................................146
11.3.2 PRACMP Control Register 0 (PRACMPxC0) ...............................................................147
11.3.3 PRACMP Control Register 1 (PRACMPxC1) ...............................148
11.3.4 PRACMP Control Register 2 (PRACMPxC2) ...............................................................149
11.4 Functional Description ..................................................................................................................150
11.5 Setup and Operation of PRACMP ...............................................................................................150
11.6 Resets ............................................................................................................................................151
11.7 Interrupts .......................................................................................................................................151
Chapter 12
10-Bit Analog-to-Digital Converter (S08ADC10V1)
12.1 Introduction ...................................................................................................................................153
12.1.1 Module Configurations ...................................................................................................154
12.1.2 Features ...........................................................................................................................157
12.1.3 Block Diagram ................................................................................................................157
12.2 External Signal Description ..........................................................................................................158
12.2.1 Analog Power (V
DDAD
) ..................................................................................................159
12.2.2 Analog Ground (V
SSAD
) .................................................................................................159
12.2.3 Voltage Reference High (V
REFH
) ...................................................................................159
12.2.4 Voltage Reference Low (V
REFL
) ....................................................................................159
12.2.5 Analog Channel Inputs (ADx) ........................................................................................159
12.3 Register Definition ........................................................................................................................159
12.3.1 Status and Control Register 1 (ADCSC1) ......................................................................159
12.3.2 Status and Control Register 2 (ADCSC2) ......................................................................161
12.3.3 Data Result High Register (ADCRH) .............................................................................162
12.3.4 Data Result Low Register (ADCRL) ..............................................................................162
12.3.5 Compare Value High Register (ADCCVH) ....................................................................163
12.3.6 Compare Value Low Register (ADCCVL) .....................................................................163
12.3.7 Configuration Register (ADCCFG) ................................................................................163
12.3.8 Pin Control 1 Register (APCTL1) ..................................................................................165
12.3.9 Pin Control 2 Register (APCTL2) ..................................................................................166
12.3.10Pin Control 3 Register (APCTL3) ..................................................................................167
12.4 Functional Description ..................................................................................................................168
12.4.1 Clock Select and Divide Control ....................................................................................168
12.4.2 Input Select and Pin Control ...........................................................................................169
12.4.3 Hardware Trigger ............................................................................................................169
12.4.4 Conversion Control .........................................................................................................169
MC9S08SF4 Series MCU Reference Manual, Rev. 3
14 Freescale Semiconductor
12.4.5 Automatic Compare Function .........................................................................................172
12.4.6 MCU Wait Mode Operation ............................................................................................172
12.4.7 MCU Stop3 Mode Operation ..........................................................................................172
12.4.8 MCU Stop1 and Stop2 Mode Operation .........................................................................173
12.5 Initialization Information ..............................................................................................................173
12.5.1 ADC Module Initialization Example .............................................................................173
12.6 Application Information ................................................................................................................175
12.6.1 External Pins and Routing ..............................................................................................175
12.6.2 Sources of Error ..............................................................................................................177
Chapter 13
16-Bit Timer/PWM (S08TPMV3)
13.1 Introduction ...................................................................................................................................181
13.1.1 TPMV3 Differences from Previous Versions .................................................................182
13.1.2 Migrating from TPMV1 ..................................................................................................184
13.1.3 Features ...........................................................................................................................186
13.1.4 Modes of Operation ........................................................................................................186
13.1.5 Block Diagram ................................................................................................................187
13.2 Signal Description .........................................................................................................................189
13.2.1 Detailed Signal Descriptions ..........................................................................................189
13.3 Register Definition ........................................................................................................................192
13.3.1 TPM Status and Control Register (TPMxSC) ................................................................192
13.3.2 TPM-Counter Registers (TPMxCNTH:TPMxCNTL) ....................................................193
13.3.3 TPM Counter Modulo Registers (TPMxMODH:TPMxMODL) ....................................194
13.3.4 TPM Channel n Status and Control Register (TPMxCnSC) ..........................................195
13.3.5 TPM Channel Value Registers (TPMxCnVH:TPMxCnVL) ..........................................196
13.4 Functional Description ..................................................................................................................198
13.4.1 Counter ............................................................................................................................198
13.4.2 Channel Mode Selection .................................................................................................199
13.5 Reset Overview .............................................................................................................................202
13.5.1 General ............................................................................................................................202
13.5.2 Description of Reset Operation .......................................................................................203
13.6 Interrupts .......................................................................................................................................203
13.6.1 General ............................................................................................................................203
13.6.2 Description of Interrupt Operation .................................................................................203
Chapter 14
Fault Detection and Shutdown(S08FDSV1)
14.1 Introduction ...................................................................................................................................205
14.1.1 Features ...........................................................................................................................208
14.1.2 Modes of Operation ........................................................................................................208
14.1.3 Block Diagram ................................................................................................................209
14.2 Register Definition ........................................................................................................................209
14.2.1 FDS Control and Status Register (FDSCS) ....................................................................211
14.2.2 FDS Input Enable Register (FDSINE) ............................................................................212
MC9S08SF4 Series MCU Reference Manual, Rev. 3
Freescale Semiconductor 15
14.2.3 FDS Pin Configuration Enable Register (FDSPCE) .......................................................212
14.2.4 FDS Pin Configuration Direction Register (FDSPCD) ..................................................212
14.2.5 FDS Pin Configuration Value Register (FDSPCV) ........................................................213
14.2.6 FDS Input Latched Register (FDSINL) ..........................................................................213
14.3 Functional Description ..................................................................................................................214
14.3.1 Input Enable Configuration ............................................................................................214
14.3.2 Action Taken upon Fault .................................................................................................214
14.3.3 Output Control ................................................................................................................214
14.4 FDS Interrupt Operation ................................................................................................................215
14.5 FDS Operation Example ...............................................................................................................215
14.5.1 Example System Configuration ......................................................................................215
14.5.2 Example Fault Detection and Shutdown Cases ..............................................................216
Chapter 15
Pulse Width Timer(S08PWTV1)
15.1 Introduction ...................................................................................................................................219
15.1.1 Features ...........................................................................................................................221
15.1.2 Modes of Operation ........................................................................................................221
15.1.3 Block Diagram ................................................................................................................221
15.2 External Signal Description ..........................................................................................................223
15.2.1 Overview .........................................................................................................................223
15.2.2 Detailed Signal Descriptions ..........................................................................................223
15.3 Memory Map/Register Definition .................................................................................................223
15.3.1 Register Descriptions ......................................................................................................224
15.4 Functional Description ..................................................................................................................228
15.4.1 PWT Counter and PWT Clock Pre-scaler ......................................................................228
15.4.2 Edge Detection and Capture Control .............................................................................228
15.5 Reset Overview .............................................................................................................................231
15.5.1 General ............................................................................................................................231
15.5.2 Description of Reset Operation .......................................................................................231
15.6 Interrupts .......................................................................................................................................231
15.6.1 Description of Interrupt Operation .................................................................................231
15.6.2 Application Examples .....................................................................................................232
15.7 Initialization/Application Information ..........................................................................................233
Chapter 16
Inter-Integrated Circuit (S08IICV2)
16.1 Introduction ...................................................................................................................................235
16.1.1 Features ...........................................................................................................................237
16.1.2 Modes of Operation ........................................................................................................237
16.1.3 Block Diagram ................................................................................................................237
16.2 External Signal Description ..........................................................................................................238
16.2.1 SCL — Serial Clock Line ...............................................................................................238
16.2.2 SDA — Serial Data Line ................................................................................................238
16.3 Register Definition ........................................................................................................................238
MC9S08SF4 Series MCU Reference Manual, Rev. 3
16 Freescale Semiconductor
16.3.1 IIC Address Register (IICA) ...........................................................................................239
16.3.2 IIC Frequency Divider Register (IICF) ..........................................................................239
16.3.3 IIC Control Register (IICC1) ..........................................................................................242
16.3.4 IIC Status Register (IICS) ...............................................................................................242
16.3.5 IIC Data I/O Register (IICD) ..........................................................................................243
16.3.6 IIC Control Register 2 (IICC2) .......................................................................................244
16.4 Functional Description ..................................................................................................................245
16.4.1 IIC Protocol .....................................................................................................................245
16.4.2 10-bit Address .................................................................................................................248
16.4.3 General Call Address ......................................................................................................249
16.5 Resets ............................................................................................................................................249
16.6 Interrupts .......................................................................................................................................249
16.6.1 Byte Transfer Interrupt ....................................................................................................249
16.6.2 Address Detect Interrupt .................................................................................................250
16.6.3 Arbitration Lost Interrupt ................................................................................................250
16.7 Initialization/Application Information ..........................................................................................251
Chapter 17
Interrupt Priority Controller (S08IPCV1)
17.1 Introduction ...................................................................................................................................253
17.1.1 Features ...........................................................................................................................256
17.1.2 Modes of Operation .......................................................................................................256
17.1.3 Block Diagram ................................................................................................................256
17.2 External Signal Description ..........................................................................................................257
17.2.1 INTIN[47:0] — Interrupt Source Interrupt Request Input .............................................258
17.2.2 VFETCH — Vector Fetch Indicator from HCS08 CPU .................................................258
17.2.3 IADB[5:0] — Address Bus Input from HCS08 CPU .....................................................258
17.2.4 INTOUT[47:0] — Interrupt Request to HCS08 CPU ....................................................258
17.3 Register Definition ........................................................................................................................258
17.3.1 IPC Status and Control Register (IPCSC) ......................................................................258
17.3.2 Interrupt Priority Mask Pseudo Stack Register (IPMPS) ...............................................259
17.3.3 Interrupt Level Setting Registers (ILRS0–ILRS11) .......................................................260
17.4 Functional Description ..................................................................................................................261
17.4.1 Interrupt Priority Level Register ....................................................................................261
17.4.2 Interrupt Priority Level Comparator Set .........................................................................261
17.4.3 Interrupt Priority Mask Update and Restore Mechanism ...............................................261
17.4.4 The Integration and Application of the IPC ....................................................................262
17.5 Application Examples ...................................................................................................................262
17.6 Initialization/Application Information ..........................................................................................263
Chapter 18
Development Support
18.1 Introduction ...................................................................................................................................265
18.1.1 Features ...........................................................................................................................266
18.2 Background Debug Controller (BDC) ..........................................................................................266
MC9S08SF4 Series MCU Reference Manual, Rev. 3
Freescale Semiconductor 17
18.2.1 BKGD Pin Description ...................................................................................................267
18.2.2 Communication Details ..................................................................................................268
18.2.3 BDC Commands .............................................................................................................271
18.2.4 BDC Hardware Breakpoint .............................................................................................274
18.3 On-Chip Debug System (DBG) ....................................................................................................275
18.3.1 Comparators A and B .....................................................................................................275
18.3.2 Bus Capture Information and FIFO Operation ...............................................................275
18.3.3 Change-of-Flow Information ..........................................................................................276
18.3.4 Tag vs. Force Breakpoints and Triggers .........................................................................276
18.3.5 Trigger Modes .................................................................................................................277
18.3.6 Hardware Breakpoints ....................................................................................................279
18.4 Register Definition ........................................................................................................................279
18.4.1 BDC Registers and Control Bits .....................................................................................279
18.4.2 System Background Debug Force Reset Register (SBDFR) ..........................................281
18.4.3 DBG Registers and Control Bits .....................................................................................282
MC9S08SF4 Series MCU Reference Manual, Rev. 3
18 Freescale Semiconductor
MC9S08SF4 Series MCU Reference Manual, Rev. 3
Freescale Semiconductor 19
Chapter 1
Device Overview
1.1 Introduction
MC9S08SF4 series MCUs are members of the low-cost, high-performance HCS08 family of 8-bit
microcontroller units (MCUs). All MCUs in the family use the enhanced HCS08 core and are available
with a variety of modules and package types.
Table 1-1 summarizes the peripheral availability per package type for the devices available in the
MC9S08SF4 series.
Table 1-1. Devices in the MC9S08SF4 Series
Feature
Device
MC9S08SF4
Package 20-pin 16-pin
Flash 4,096 bytes
RAM 128 bytes
PRACMP 4-ch
ADC 8-ch 6-ch
KBI 4-ch
PWT 2 × 2-ch
IRQ Yes
IIC yes no
TPM1 6-ch 4-ch
TPM2 1-ch
MTIM16 2
I/O pins 18 14
Package types 20-pin TSSOP 16-pin TSSOP
Chapter 1 Device Overview
MC9S08SF4 Series MCU Reference Manual, Rev. 3
20 Freescale Semiconductor
1.2 MCU Block Diagram
The block diagram in Figure 1-1 shows the structure of the MC9S08SF4 series MCU.
Figure 1-1. MC9S08SF4 Series Block Diagram
Table 1-2 lists the functional versions of the on-chip modules.
Table 1-2. Versions of On-Chip Modules
Module Version
Programmable Analog Comparator (PRACMP) 1
USER Flash
USER RAM
HCS08 CORE
CPU
BDC
6-CH TIMER/PWM
MODULE (TPM1)
HCS08 SYSTEM CONTROL
RESETS AND INTERRUPTS
MODES OF OPERATION
POWER MANAGEMENT
VOLTAGE REGULATOR
PORT A
40-MHz INTERNAL CLOCK
SOURCE (ICS)
ANALOG-TO-DIGITAL
CONVERTER(ADC)
8-CH 10-BIT
COP
WAKEUP LVD
1-CH TIMER/PWM
MODULE (TPM2)
ADP[5:0]
V
DD
V
SS
128 BYTES
4096 BYTES
RESET
IRQ
16-bit Modulo Timer
(MTIM16-2)
16-bit Modulo Timer
(MTIM16-1)
Pulse Width Timer
(PWT1)
Pulse Width Timer
(PWT2)
ADP[6:7]
PWTI1
PWTI2
PTA0/KBI0/TCLK/IRQ
PTA1/KBI1/RESET
PTA2/KBI2/TPM1C0/FDSOUT0
PTA3/KBI3/TPM1C1/FDSOUT1
PTA4/TPM1C2/FDSOUT2
PTA5/TPM1C3/FDSOUT3
PTA6/TPM1C4/FDSOUT4
PTA7/TPM1C5/FDSOUT5
TPM1C[5:0]
IRQ
PORT B
PTB0/TPM2C0/FDSOUT6
PTB1/PWTI1/ADC0
PTB2/PWTI2/ADC1
PTB3/ACMP3/ADC2
PTB4/ACMP2/ADC3
PTB5/ACMP1/ADC4
PTB6/ACMP0/ADC5
PTB7/BKGD/MS
TPM2C0
ANALOG COMPARATOR
(PRACMP2)
ANALOG COMPARATOR
(PRACMP1)
SCL
SDA
PORT C
4-pin keyboard interrupt
(KBI)
KBI[3:0]
PTC0/ADC6/SCL
PTC1/ADC7/SDA
Inter-Integrated Circuit
(IIC)
Interrupt Priority Controller
(IPC)
Fault Detection & Shutdown
(FDS)
= Not Available in 16-pin TSSOP package
Debug Module
(DBG)
ACMP3
ACMP2
ACMP1
ACMP0
FDSOUT[6:0]
TCLK
TCLK
TCLK
TCLK
TCLK
TCLK
ACMP3
ACMP2
ACMP1
ACMP0
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203
  • Page 204 204
  • Page 205 205
  • Page 206 206
  • Page 207 207
  • Page 208 208
  • Page 209 209
  • Page 210 210
  • Page 211 211
  • Page 212 212
  • Page 213 213
  • Page 214 214
  • Page 215 215
  • Page 216 216
  • Page 217 217
  • Page 218 218
  • Page 219 219
  • Page 220 220
  • Page 221 221
  • Page 222 222
  • Page 223 223
  • Page 224 224
  • Page 225 225
  • Page 226 226
  • Page 227 227
  • Page 228 228
  • Page 229 229
  • Page 230 230
  • Page 231 231
  • Page 232 232
  • Page 233 233
  • Page 234 234
  • Page 235 235
  • Page 236 236
  • Page 237 237
  • Page 238 238
  • Page 239 239
  • Page 240 240
  • Page 241 241
  • Page 242 242
  • Page 243 243
  • Page 244 244
  • Page 245 245
  • Page 246 246
  • Page 247 247
  • Page 248 248
  • Page 249 249
  • Page 250 250
  • Page 251 251
  • Page 252 252
  • Page 253 253
  • Page 254 254
  • Page 255 255
  • Page 256 256
  • Page 257 257
  • Page 258 258
  • Page 259 259
  • Page 260 260
  • Page 261 261
  • Page 262 262
  • Page 263 263
  • Page 264 264
  • Page 265 265
  • Page 266 266
  • Page 267 267
  • Page 268 268
  • Page 269 269
  • Page 270 270
  • Page 271 271
  • Page 272 272
  • Page 273 273
  • Page 274 274
  • Page 275 275
  • Page 276 276
  • Page 277 277
  • Page 278 278
  • Page 279 279
  • Page 280 280
  • Page 281 281
  • Page 282 282
  • Page 283 283
  • Page 284 284
  • Page 285 285
  • Page 286 286
  • Page 287 287
  • Page 288 288

NXP S08SF Reference guide

Type
Reference guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI