NXP S08PLS Reference guide

Type
Reference guide
MC9S08PL16S Reference Manual
Supports: MC9S08PL16SCTJ MC9S08PL16SCTG
MC9S08PL16SCSC MC9S08PL8SCTJ MC9S08PL8SCTG
MC9S08PL8SCSC
Document Number: MC9S08PL16SRM
Rev. 2, 10/2019
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
2 NXP Semiconductors
Contents
Section number Title Page
Chapter 1
About This Document
1.1 Overview.........................................................................................................................................................................25
1.1.1 Purpose.............................................................................................................................................................25
1.1.2 Audience.......................................................................................................................................................... 25
1.2 Conventions.................................................................................................................................................................... 25
1.2.1 Numbering systems..........................................................................................................................................25
1.2.2 Typographic notation....................................................................................................................................... 26
1.2.3 Special terms....................................................................................................................................................26
Chapter 2
Introduction
2.1 Introduction.....................................................................................................................................................................27
2.2 Module functional categories..........................................................................................................................................27
2.2.1 S08L core modules...........................................................................................................................................28
2.2.2 System modules............................................................................................................................................... 28
2.2.3 Memories and memory interfaces....................................................................................................................29
2.2.4 Clocks...............................................................................................................................................................29
2.2.5 Security and integrity modules........................................................................................................................ 29
2.2.6 Analog modules............................................................................................................................................... 30
2.2.7 Timer modules................................................................................................................................................. 30
2.2.8 Communication interfaces............................................................................................................................... 31
2.2.9 Human-machine interfaces.............................................................................................................................. 31
2.3 MCU block diagram....................................................................................................................................................... 31
2.4 Orderable part numbers...................................................................................................................................................32
Chapter 3
Pins and connections
3.1 Device pin assignment.................................................................................................................................................... 35
3.2 Pin functions................................................................................................................................................................... 36
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 3
Section number Title Page
3.2.1 Power (VDD, VSS)..........................................................................................................................................36
3.2.2 Analog power supply and reference pins (VDDA/VREFH and VSSA/VREFL)............................................36
3.2.3 Oscillator (XTAL, EXTAL)............................................................................................................................ 37
3.2.4 External reset pin (RESET) and interrupt pin (IRQ)....................................................................................... 38
3.2.5 Background/mode select (BKGD/MS)............................................................................................................ 39
3.2.6 Port A input/output (I/O) pins (PTA5-PTA0)..................................................................................................40
3.2.7 Port B input/output (I/O) pins (PTB7–PTB0)..................................................................................................40
3.2.8 Port C input/output (I/O) pins (PTC7–PTC0)..................................................................................................40
3.3 Peripheral pinouts........................................................................................................................................................... 41
Chapter 4
Power management
4.1 Introduction.....................................................................................................................................................................43
4.2 Features...........................................................................................................................................................................43
4.2.1 Run mode......................................................................................................................................................... 43
4.2.2 Wait mode........................................................................................................................................................44
4.2.3 Stop3 mode...................................................................................................................................................... 44
4.2.4 Active BDM enabled in stop3 mode................................................................................................................44
4.2.5 LVD enabled in stop mode.............................................................................................................................. 45
4.2.6 Power modes behaviors................................................................................................................................... 45
4.3 Low voltage detect (LVD) system..................................................................................................................................46
4.3.1 Power-on reset (POR) operation......................................................................................................................47
4.3.2 LVD reset operation.........................................................................................................................................47
4.3.3 Low-voltage warning (LVW).......................................................................................................................... 47
4.4 Power management control bits and registers................................................................................................................ 48
4.4.1 System Power Management Status and Control 1 Register (PMC_SPMSC1)................................................48
4.4.2 System Power Management Status and Control 2 Register (PMC_SPMSC2)................................................50
Chapter 5
Memory map
5.1 Memory map...................................................................................................................................................................51
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
4 NXP Semiconductors
Section number Title Page
5.2 Peripheral register addresses...........................................................................................................................................52
5.3 Random-access memory (RAM).................................................................................................................................... 54
5.4 Flash memory..................................................................................................................................................................55
Chapter 6
Interrupt
6.1 Interrupts.........................................................................................................................................................................57
6.1.1 Interrupt stack frame........................................................................................................................................ 58
6.1.2 Interrupt vectors, sources, and local masks......................................................................................................59
6.1.3 Hardware nested interrupt................................................................................................................................61
6.1.3.1 Interrupt priority level register.....................................................................................................63
6.1.3.2 Interrupt priority level comparator set......................................................................................... 63
6.1.3.3 Interrupt priority mask update and restore mechanism................................................................63
6.1.3.4 Integration and application of the IPC......................................................................................... 64
6.2 IRQ..................................................................................................................................................................................65
6.2.1 Features............................................................................................................................................................ 65
6.2.1.1 Pin configuration options.............................................................................................................66
6.2.1.2 Edge and level sensitivity............................................................................................................ 67
6.3 Interrupt pin request register...........................................................................................................................................67
6.3.1 Interrupt Pin Request Status and Control Register (IRQ_SC).........................................................................67
6.4 Interrupt priority control register.................................................................................................................................... 69
6.4.1 IPC Status and Control Register (IPC_SC)......................................................................................................69
6.4.2 Interrupt Priority Mask Pseudo Stack Register (IPC_IPMPS)........................................................................ 70
6.4.3
Interrupt Level Setting Registers n (IPC_ILRSn)............................................................................................71
Chapter 7
System control
7.1 System device identification (SDID)..............................................................................................................................73
7.2 Universally unique identification (UUID)......................................................................................................................73
7.3 Reset and system initialization........................................................................................................................................73
7.4 System options................................................................................................................................................................74
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 5
Section number Title Page
7.4.1 BKGD pin enable.............................................................................................................................................74
7.4.2 RESET pin enable............................................................................................................................................74
7.4.3 SCI0 pin reassignment..................................................................................................................................... 74
7.4.4 FTM0 channels pin reassignment.................................................................................................................... 74
7.5 System interconnection...................................................................................................................................................75
7.5.1 ACMP output selection....................................................................................................................................75
7.5.2 SCI0 TxD modulation......................................................................................................................................75
7.5.3 SCI0 RxD capture............................................................................................................................................ 76
7.5.4 SCI0 RxD filter................................................................................................................................................ 76
7.5.5 RTC capture..................................................................................................................................................... 77
7.5.6 ADC hardware trigger......................................................................................................................................77
7.6 FTM software controlled output..................................................................................................................................... 78
7.7 System Control Registers................................................................................................................................................79
7.7.1 System Reset Status Register (SYS_SRS).......................................................................................................79
7.7.2 System Background Debug Force Reset Register (SYS_SBDFR)..................................................................81
7.7.3 System Device Identification Register: High (SYS_SDIDH)......................................................................... 82
7.7.4 System Device Identification Register: Low (SYS_SDIDL).......................................................................... 83
7.7.5 System Options Register 1 (SYS_SOPT1)...................................................................................................... 83
7.7.6 System Options Register 2 (SYS_SOPT2)...................................................................................................... 84
7.7.7 System Options Register 3 (SYS_SOPT3)...................................................................................................... 86
7.7.8 System Options Register 4 (SYS_SOPT4)...................................................................................................... 87
7.7.9 System Options Register 5 (SYS_SOPT5)...................................................................................................... 87
7.7.10 System Options Register 6 (SYS_SOPT6)...................................................................................................... 88
7.7.11 System Options Register 7 (SYS_SOPT7)...................................................................................................... 89
7.7.12 System Options Register 8 (SYS_SOPT8)...................................................................................................... 90
7.7.13 System Clock Gating Control 1 Register (SYS_SCGC1)............................................................................... 91
7.7.14 System Clock Gating Control 2 Register (SYS_SCGC2)............................................................................... 92
7.7.15 System Clock Gating Control 3 Register (SYS_SCGC3)............................................................................... 93
7.7.16 System Clock Gating Control 4 Register (SYS_SCGC4)............................................................................... 94
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
6 NXP Semiconductors
Section number Title Page
7.7.17 Illegal Address Register: High (SYS_ILLAH)................................................................................................95
7.7.18 Illegal Address Register: Low (SYS_ILLAL).................................................................................................96
7.7.19 Universally Unique Identifier Register 1 (SYS_UUID1)................................................................................97
7.7.20 Universally Unique Identifier Register 2 (SYS_UUID2)................................................................................97
7.7.21 Universally Unique Identifier Register 3 (SYS_UUID3)................................................................................98
7.7.22 Universally Unique Identifier Register 4 (SYS_UUID4)................................................................................98
7.7.23 Universally Unique Identifier Register 5 (SYS_UUID5)................................................................................99
7.7.24 Universally Unique Identifier Register 6 (SYS_UUID6)................................................................................99
7.7.25 Universally Unique Identifier Register 7 (SYS_UUID7)................................................................................100
7.7.26 Universally Unique Identifier Register 8 (SYS_UUID8)................................................................................100
Chapter 8
Clock management
8.1 Clock module..................................................................................................................................................................101
8.2 System clock distribution................................................................................................................................................101
8.3 Internal clock source (ICS)............................................................................................................................................. 103
8.4 Oscillator (OSC)............................................................................................................................................................. 104
8.5 Peripheral clock gating................................................................................................................................................... 104
Chapter 9
Central processor unit
9.1 Introduction.....................................................................................................................................................................107
9.1.1 Features............................................................................................................................................................ 107
9.2 Programmer's Model and CPU Registers....................................................................................................................... 108
9.2.1 Accumulator (A).............................................................................................................................................. 108
9.2.2 Index Register (H:X)........................................................................................................................................109
9.2.3 Stack Pointer (SP)............................................................................................................................................ 109
9.2.4 Program Counter (PC)..................................................................................................................................... 110
9.2.5 Condition Code Register (CCR)...................................................................................................................... 110
9.3 Addressing Modes.......................................................................................................................................................... 111
9.3.1 Inherent Addressing Mode (INH)....................................................................................................................112
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 7
Section number Title Page
9.3.2 Relative Addressing Mode (REL)....................................................................................................................112
9.3.3 Immediate Addressing Mode (IMM)...............................................................................................................112
9.3.4 Direct Addressing Mode (DIR)........................................................................................................................113
9.3.5 Extended Addressing Mode (EXT)..................................................................................................................113
9.3.6 Indexed Addressing Mode............................................................................................................................... 114
9.3.6.1 Indexed, No Offset (IX)...............................................................................................................114
9.3.6.2 Indexed, No Offset with Post Increment (IX+)............................................................................114
9.3.6.3 Indexed, 8-Bit Offset (IX1)..........................................................................................................114
9.3.6.4 Indexed, 8-Bit Offset with Post Increment (IX1+)...................................................................... 115
9.3.6.5 Indexed, 16-Bit Offset (IX2)........................................................................................................115
9.3.6.6 SP-Relative, 8-Bit Offset (SP1)................................................................................................... 115
9.3.6.7 SP-Relative, 16-Bit Offset (SP2)................................................................................................. 116
9.3.7 Memory to memory Addressing Mode............................................................................................................116
9.3.7.1 Direct to Direct.............................................................................................................................116
9.3.7.2 Immediate to Direct..................................................................................................................... 116
9.3.7.3 Indexed to Direct, Post Increment................................................................................................116
9.3.7.4 Direct to Indexed, Post-Increment............................................................................................... 117
9.4 Operation modes............................................................................................................................................................. 117
9.4.1 Stop mode........................................................................................................................................................ 117
9.4.2 Wait mode........................................................................................................................................................117
9.4.3 Background mode............................................................................................................................................ 118
9.4.4 Security mode.................................................................................................................................................. 119
9.5 HCS08 V6 Opcodes........................................................................................................................................................121
9.6 Special Operations.......................................................................................................................................................... 121
9.6.1 Reset Sequence................................................................................................................................................ 121
9.6.2 Interrupt Sequence........................................................................................................................................... 121
9.7 Instruction Set Summary.................................................................................................................................................122
Chapter 10
Flash Memory Module (FTMRH)
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
8 NXP Semiconductors
Section number Title Page
10.1 Introduction.....................................................................................................................................................................135
10.2 Feature.............................................................................................................................................................................135
10.2.1 Flash memory features.....................................................................................................................................135
10.2.2 Other flash module features............................................................................................................................. 136
10.3 Functional description.....................................................................................................................................................136
10.3.1 Modes of operation.......................................................................................................................................... 136
10.3.1.1 Wait mode....................................................................................................................................136
10.3.1.2 Stop mode.................................................................................................................................... 136
10.3.2 Flash block read access....................................................................................................................................136
10.3.3 Flash memory map...........................................................................................................................................137
10.3.4 Flash initialization after system reset...............................................................................................................137
10.3.5 Flash command operations...............................................................................................................................137
10.3.5.1 Writing the FCLKDIV register....................................................................................................138
10.3.5.2 Command write sequence............................................................................................................ 140
10.3.6 Flash interrupts.................................................................................................................................................142
10.3.6.1 Description of flash interrupt operation.......................................................................................142
10.3.7 Protection......................................................................................................................................................... 142
10.3.8 Security............................................................................................................................................................ 145
10.3.8.1 Unsecuring the MCU using backdoor key access........................................................................146
10.3.8.2 Unsecuring the MCU using BDM............................................................................................... 147
10.3.8.3 Mode and security effects on flash command availability...........................................................147
10.3.9 Flash commands...............................................................................................................................................147
10.3.9.1 Flash commands...........................................................................................................................147
10.3.10 Flash command summary................................................................................................................................ 148
10.3.10.1 Erase Verify All Blocks command.............................................................................................. 149
10.3.10.2 Erase Verify Block command......................................................................................................149
10.3.10.3 Erase Verify Flash Section command..........................................................................................150
10.3.10.4 Read once command.................................................................................................................... 151
10.3.10.5 Program Flash command............................................................................................................. 152
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 9
Section number Title Page
10.3.10.6 Program Once command..............................................................................................................153
10.3.10.7 Erase All Blocks command..........................................................................................................154
10.3.10.8 Erase flash block command......................................................................................................... 154
10.3.10.9 Erase flash sector command.........................................................................................................155
10.3.10.10 Unsecure flash command.............................................................................................................156
10.3.10.11 Verify backdoor access key command.........................................................................................157
10.3.10.12 Set user margin level command...................................................................................................157
10.3.10.13 Set factory margin level command.............................................................................................. 159
10.4 Memory map and register definition...............................................................................................................................160
10.4.1 Flash Clock Divider Register (FTMRH_FCLKDIV)...................................................................................... 161
10.4.2 Flash Security Register (FTMRH_FSEC)....................................................................................................... 162
10.4.3 Flash CCOB Index Register (FTMRH_FCCOBIX)........................................................................................163
10.4.4 Flash Configuration Register (FTMRH_FCNFG)...........................................................................................163
10.4.5 Flash Status Register (FTMRH_FSTAT)........................................................................................................ 164
10.4.6 Flash Protection Register (FTMRH_FPROT)................................................................................................. 165
10.4.7 Flash Common Command Object Register:High (FTMRH_FCCOBHI)........................................................166
10.4.8 Flash Common Command Object Register: Low (FTMRH_FCCOBLO)...................................................... 167
10.4.9 Flash Option Register (FTMRH_FOPT)......................................................................................................... 167
Chapter 11
Port Control (PORT)
11.1 Introduction.....................................................................................................................................................................169
11.2 Port data and data direction.............................................................................................................................................170
11.3 Internal pullup enable..................................................................................................................................................... 171
11.4 Input glitch filter setting..................................................................................................................................................171
11.5 Pin behavior in stop mode...............................................................................................................................................171
11.6 Port data registers............................................................................................................................................................172
11.6.1 Port A Data Register (PORT_PTAD)..............................................................................................................172
11.6.2 Port B Data Register (PORT_PTBD).............................................................................................................. 173
11.6.3 Port C Data Register (PORT_PTCD).............................................................................................................. 173
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
10 NXP Semiconductors
Section number Title Page
11.6.4 Port A Output Enable Register (PORT_PTAOE)............................................................................................174
11.6.5 Port B Output Enable Register (PORT_PTBOE)............................................................................................ 175
11.6.6 Port C Output Enable Register (PORT_PTCOE)............................................................................................ 176
11.6.7 Port A Input Enable Register (PORT_PTAIE)................................................................................................177
11.6.8 Port B Input Enable Register (PORT_PTBIE)................................................................................................ 178
11.6.9 Port C Input Enable Register (PORT_PTCIE)................................................................................................ 179
11.6.10 Port Filter Register 0 (PORT_IOFLT0)...........................................................................................................180
11.6.11 Port Filter Register 2 (PORT_IOFLT2)...........................................................................................................181
11.6.12 Port Clock Division Register (PORT_FCLKDIV).......................................................................................... 182
11.6.13 Port A Pullup Enable Register (PORT_PTAPE)............................................................................................. 183
11.6.14 Port B Pullup Enable Register (PORT_PTBPE)..............................................................................................184
11.6.15 Port C Pullup Enable Register (PORT_PTCPE)..............................................................................................185
Chapter 12
Keyboard Interrupts (KBI)
12.1 Introduction.....................................................................................................................................................................187
12.1.1 Features............................................................................................................................................................ 187
12.1.2 Modes of Operation......................................................................................................................................... 187
12.1.2.1 KBI in Wait mode........................................................................................................................187
12.1.2.2 KBI in Stop modes.......................................................................................................................188
12.1.3 Block Diagram................................................................................................................................................. 188
12.2 External signals description............................................................................................................................................ 188
12.3 Register definition...........................................................................................................................................................189
12.4 Memory Map and Registers............................................................................................................................................189
12.4.1
KBI Status and Control Register (KBIx_SC).................................................................................................. 190
12.4.2
KBI Pin Enable Register (KBIx_PE)...............................................................................................................191
12.4.3
KBI Edge Select Register (KBIx_ES)............................................................................................................. 191
12.5 Functional Description....................................................................................................................................................192
12.5.1 Edge-only sensitivity........................................................................................................................................192
12.5.2 Edge and level sensitivity................................................................................................................................ 192
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 11
Section number Title Page
12.5.3 KBI Pullup Resistor......................................................................................................................................... 192
12.5.4 KBI initialization..............................................................................................................................................193
Chapter 13
Internal Clock Source (ICS)
13.1 Chip specific ICS information........................................................................................................................................ 195
13.2 Introduction.....................................................................................................................................................................195
13.2.1 Features............................................................................................................................................................ 195
13.2.2 Block diagram..................................................................................................................................................196
13.2.3 Modes of operation.......................................................................................................................................... 196
13.2.3.1 FLL engaged internal (FEI)......................................................................................................... 196
13.2.3.2 FLL engaged external (FEE)........................................................................................................197
13.2.3.3 FLL bypassed internal (FBI)........................................................................................................197
13.2.3.4 FLL bypassed internal low power (FBILP)................................................................................. 197
13.2.3.5 FLL bypassed external (FBE)......................................................................................................197
13.2.3.6 FLL bypassed external low power (FBELP)............................................................................... 197
13.2.3.7 Stop (STOP).................................................................................................................................197
13.3 External signal description..............................................................................................................................................198
13.4 Register definition...........................................................................................................................................................198
13.4.1 ICS Control Register 1 (ICS_C1).................................................................................................................... 198
13.4.2 ICS Control Register 2 (ICS_C2).................................................................................................................... 199
13.4.3 ICS Control Register 3 (ICS_C3).................................................................................................................... 200
13.4.4 ICS Control Register 4 (ICS_C4).................................................................................................................... 201
13.4.5 ICS Status Register (ICS_S)............................................................................................................................ 201
13.5 Functional description.....................................................................................................................................................202
13.5.1 Operational modes........................................................................................................................................... 202
13.5.1.1 FLL engaged internal (FEI)......................................................................................................... 203
13.5.1.2 FLL engaged external (FEE)........................................................................................................203
13.5.1.3 FLL bypassed internal (FBI)........................................................................................................204
13.5.1.4 FLL bypassed internal low power (FBILP)................................................................................. 204
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
12 NXP Semiconductors
Section number Title Page
13.5.1.5 FLL bypassed external (FBE)......................................................................................................204
13.5.1.6 FLL bypassed external low power (FBELP)............................................................................... 205
13.5.1.7 Stop.............................................................................................................................................. 205
13.5.2 Mode switching................................................................................................................................................205
13.5.3 Bus frequency divider...................................................................................................................................... 206
13.5.4 Low-power field usage.....................................................................................................................................206
13.5.5 Internal reference clock....................................................................................................................................206
13.5.6 Fixed frequency clock......................................................................................................................................207
13.5.7 FLL lock and clock monitor.............................................................................................................................207
13.5.7.1 FLL clock lock.............................................................................................................................207
13.5.7.2 External reference clock monitor.................................................................................................208
Chapter 14
Oscillator (OSC)
14.1 Chip specific OSC information.......................................................................................................................................209
14.2 Introduction.....................................................................................................................................................................209
14.2.1 Overview..........................................................................................................................................................209
14.2.2 Features and modes..........................................................................................................................................209
14.2.3 Block diagram..................................................................................................................................................209
14.3 Signal description............................................................................................................................................................210
14.4 External crystal / resonator connections......................................................................................................................... 211
14.5 External clock connections............................................................................................................................................. 212
14.6 Memory map and register descriptions...........................................................................................................................213
14.6.1 OSC Control Register (OSC_CR)....................................................................................................................213
14.7 Functional description.....................................................................................................................................................214
14.7.1 OSC module states...........................................................................................................................................214
14.7.1.1 Off................................................................................................................................................ 215
14.7.1.2 Oscillator startup..........................................................................................................................216
14.7.1.3 Oscillator stable............................................................................................................................216
14.7.1.4 External clock mode.....................................................................................................................216
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 13
Section number Title Page
14.7.2 OSC module modes......................................................................................................................................... 216
14.7.2.1 Low-frequency, high-gain mode..................................................................................................217
14.7.2.2 Low-frequency, low-power mode................................................................................................217
14.7.2.3 High-frequency, high-gain mode................................................................................................. 217
14.7.2.4 High-frequency, low-power mode............................................................................................... 218
14.7.3 Counter.............................................................................................................................................................218
14.7.4 Reference clock pin requirements....................................................................................................................218
Chapter 15
FlexTimer Module (FTM)
15.1 Chip specific FTM information...................................................................................................................................... 219
15.2 Introduction.....................................................................................................................................................................220
15.2.1 FlexTimer philosophy......................................................................................................................................220
15.2.2 Features............................................................................................................................................................ 220
15.2.3 Modes of operation.......................................................................................................................................... 221
15.2.4 Block diagram..................................................................................................................................................221
15.3 Signal description............................................................................................................................................................222
15.3.1 EXTCLK — FTM external clock.................................................................................................................... 223
15.3.2 CHn — FTM channel (n) I/O pin.................................................................................................................... 223
15.4 Memory map and register definition...............................................................................................................................223
15.4.1 Module memory map.......................................................................................................................................223
15.4.2 Register descriptions........................................................................................................................................223
15.4.3
Status and Control (FTMx_SC)....................................................................................................................... 225
15.4.4
Counter High (FTMx_CNTH)......................................................................................................................... 226
15.4.5
Counter Low (FTMx_CNTL).......................................................................................................................... 227
15.4.6
Modulo High (FTMx_MODH)........................................................................................................................ 227
15.4.7
Modulo Low (FTMx_MODL)......................................................................................................................... 228
15.4.8
Channel Status and Control (FTMx_CnSC).................................................................................................... 229
15.4.9
Channel Value High (FTMx_CnVH)...............................................................................................................230
15.4.10
Channel Value Low (FTMx_CnVL)................................................................................................................231
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
14 NXP Semiconductors
Section number Title Page
15.5 Functional Description....................................................................................................................................................232
15.5.1 Clock Source....................................................................................................................................................232
15.5.1.1 Counter Clock Source.................................................................................................................. 232
15.5.2 Prescaler...........................................................................................................................................................233
15.5.3 Counter.............................................................................................................................................................233
15.5.3.1 Up counting..................................................................................................................................234
15.5.3.2 Up-down counting........................................................................................................................234
15.5.3.3 Free running counter.................................................................................................................... 235
15.5.3.4 Counter reset................................................................................................................................ 235
15.5.4 Input capture mode...........................................................................................................................................235
15.5.5 Output compare mode......................................................................................................................................236
15.5.6 Edge-aligned PWM (EPWM) mode................................................................................................................ 238
15.5.7 Center-aligned PWM (CPWM) mode..............................................................................................................239
15.5.8 Update of the registers with write buffers........................................................................................................241
15.5.8.1 MODH:L registers....................................................................................................................... 241
15.5.8.2 CnVH:L registers......................................................................................................................... 242
15.5.9 BDM mode.......................................................................................................................................................242
15.6 Reset overview................................................................................................................................................................242
15.7 FTM Interrupts................................................................................................................................................................244
15.7.1 Timer overflow interrupt..................................................................................................................................244
15.7.2 Channel (n) interrupt........................................................................................................................................244
Chapter 16
8-bit modulo timer (MTIM)
16.1 Chip specific MTIM information....................................................................................................................................245
16.2 Introduction.....................................................................................................................................................................245
16.3 Features...........................................................................................................................................................................246
16.4 Modes of operation......................................................................................................................................................... 246
16.4.1 MTIM in wait mode.........................................................................................................................................246
16.4.2 MTIM in stop mode......................................................................................................................................... 246
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 15
Section number Title Page
16.4.3 MTIM in active background mode.................................................................................................................. 247
16.5 Block diagram.................................................................................................................................................................247
16.6 External signal description..............................................................................................................................................247
16.7 Register definition...........................................................................................................................................................248
16.7.1
MTIM Status and Control Register (MTIMx_SC).......................................................................................... 248
16.7.2
MTIM Clock Configuration Register (MTIMx_CLK).................................................................................... 249
16.7.3
MTIM Counter Register (MTIMx_CNT)........................................................................................................ 250
16.7.4
MTIM Modulo Register (MTIMx_MOD)....................................................................................................... 250
16.8 Functional description.....................................................................................................................................................251
16.8.1 MTIM operation example................................................................................................................................ 252
Chapter 17
Real-time counter (RTC)
17.1 Chip specific RTC information.......................................................................................................................................253
17.2 Introduction.....................................................................................................................................................................253
17.3 Features...........................................................................................................................................................................253
17.3.1 Modes of operation.......................................................................................................................................... 254
17.3.1.1 Wait mode....................................................................................................................................254
17.3.1.2 Stop modes...................................................................................................................................254
17.3.2 Block diagram..................................................................................................................................................254
17.4 Register definition...........................................................................................................................................................255
17.4.1 RTC Status and Control Register 1 (RTC_SC1)............................................................................................. 256
17.4.2 RTC Status and Control Register 2 (RTC_SC2)............................................................................................. 256
17.4.3 RTC Modulo Register: High (RTC_MODH).................................................................................................. 257
17.4.4 RTC Modulo Register: Low (RTC_MODL)................................................................................................... 258
17.4.5 RTC Counter Register: High (RTC_CNTH)................................................................................................... 258
17.4.6 RTC Counter Register: Low (RTC_CNTL).................................................................................................... 259
17.5 Functional description.....................................................................................................................................................259
17.5.1 RTC operation example................................................................................................................................... 260
17.6 Initialization/application information............................................................................................................................. 261
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
16 NXP Semiconductors
Section number Title Page
Chapter 18
Serial communications interface (SCI)
18.1 Chip specific SCI information........................................................................................................................................ 263
18.2 Introduction.....................................................................................................................................................................263
18.2.1 Features............................................................................................................................................................ 263
18.2.2 Modes of operation.......................................................................................................................................... 264
18.2.3 Block diagram..................................................................................................................................................264
18.3 SCI signal descriptions................................................................................................................................................... 267
18.3.1 Detailed signal descriptions............................................................................................................................. 267
18.4 Register definition...........................................................................................................................................................267
18.4.1
SCI Baud Rate Register: High (SCIx_BDH)................................................................................................... 268
18.4.2
SCI Baud Rate Register: Low (SCIx_BDL).................................................................................................... 269
18.4.3
SCI Control Register 1 (SCIx_C1)...................................................................................................................269
18.4.4
SCI Control Register 2 (SCIx_C2)...................................................................................................................271
18.4.5
SCI Status Register 1 (SCIx_S1)..................................................................................................................... 272
18.4.6
SCI Status Register 2 (SCIx_S2)..................................................................................................................... 274
18.4.7
SCI Control Register 3 (SCIx_C3)...................................................................................................................275
18.4.8
SCI Data Register (SCIx_D)............................................................................................................................277
18.5 Functional description.....................................................................................................................................................277
18.5.1 Baud rate generation........................................................................................................................................ 278
18.5.2 Transmitter functional description...................................................................................................................278
18.5.2.1 Send break and queued idle......................................................................................................... 279
18.5.3 Receiver functional description....................................................................................................................... 280
18.5.3.1 Data sampling technique..............................................................................................................281
18.5.3.2 Receiver wake-up operation.........................................................................................................282
18.5.4 Interrupts and status flags................................................................................................................................ 283
18.5.5 Baud rate tolerance...........................................................................................................................................284
18.5.5.1 Slow data tolerance...................................................................................................................... 284
18.5.5.2 Fast data tolerance........................................................................................................................286
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 17
Section number Title Page
18.5.6 Additional SCI functions................................................................................................................................. 287
18.5.6.1 8- and 9-bit data modes................................................................................................................287
18.5.6.2 Stop mode operation.................................................................................................................... 287
18.5.6.3 Loop mode................................................................................................................................... 287
18.5.6.4 Single-wire operation...................................................................................................................288
Chapter 19
Analog-to-digital converter (ADC)
19.1 Chip specific ADC information......................................................................................................................................289
19.1.1 Channel assignments........................................................................................................................................289
19.1.2 Alternate clock................................................................................................................................................. 290
19.1.3 Hardware trigger.............................................................................................................................................. 290
19.1.4 Temperature sensor..........................................................................................................................................291
19.2 Introduction.....................................................................................................................................................................291
19.2.1 Features............................................................................................................................................................ 292
19.2.2 Block Diagram................................................................................................................................................. 292
19.3 External Signal Description............................................................................................................................................ 293
19.3.1 Analog Power (VDDA)................................................................................................................................... 294
19.3.2 Analog Ground (VSSA)...................................................................................................................................294
19.3.3 Voltage Reference High (VREFH)..................................................................................................................294
19.3.4 Voltage Reference Low (VREFL)................................................................................................................... 294
19.3.5 Analog Channel Inputs (ADx)......................................................................................................................... 294
19.4 ADC Control Registers...................................................................................................................................................295
19.4.1 Status and Control Register 1 (ADC_SC1)......................................................................................................295
19.4.2 Status and Control Register 2 (ADC_SC2)......................................................................................................296
19.4.3 Status and Control Register 3 (ADC_SC3)......................................................................................................298
19.4.4 Status and Control Register 4 (ADC_SC4)......................................................................................................299
19.4.5 Conversion Result High Register (ADC_RH).................................................................................................300
19.4.6 Conversion Result Low Register (ADC_RL).................................................................................................. 301
19.4.7 Compare Value High Register (ADC_CVH)...................................................................................................301
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
18 NXP Semiconductors
Section number Title Page
19.4.8 Compare Value Low Register (ADC_CVL)....................................................................................................302
19.4.9 Pin Control 1 Register (ADC_APCTL1).........................................................................................................302
19.4.10 Pin Control 2 Register (ADC_APCTL2).........................................................................................................304
19.5 Functional description.....................................................................................................................................................304
19.5.1 Clock select and divide control........................................................................................................................305
19.5.2 Input select and pin control..............................................................................................................................306
19.5.3 Hardware trigger.............................................................................................................................................. 306
19.5.4 Conversion control...........................................................................................................................................306
19.5.4.1 Initiating conversions...................................................................................................................306
19.5.4.2 Completing conversions...............................................................................................................307
19.5.4.3 Aborting conversions................................................................................................................... 307
19.5.4.4 Power control............................................................................................................................... 308
19.5.4.5 Sample time and total conversion time........................................................................................308
19.5.5 Automatic compare function............................................................................................................................310
19.5.6 FIFO operation.................................................................................................................................................310
19.5.7 MCU wait mode operation...............................................................................................................................313
19.5.8 MCU Stop mode operation.............................................................................................................................. 314
19.5.8.1 Stop mode with ADACK disabled...............................................................................................314
19.5.8.2 Stop mode with ADACK enabled................................................................................................314
19.6 Initialization information................................................................................................................................................ 315
19.6.1 ADC module initialization example................................................................................................................ 315
19.6.1.1 Initialization sequence..................................................................................................................315
19.6.1.2 Pseudo-code example...................................................................................................................316
19.6.2 ADC FIFO module initialization example.......................................................................................................316
19.6.2.1 Pseudo-code example...................................................................................................................317
19.7 Application information..................................................................................................................................................318
19.7.1 External pins and routing................................................................................................................................. 318
19.7.1.1 Analog supply pins.......................................................................................................................318
19.7.1.2 Analog reference pins.................................................................................................................. 318
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
NXP Semiconductors 19
Section number Title Page
19.7.1.3 Analog input pins.........................................................................................................................319
19.7.2 Sources of error................................................................................................................................................320
19.7.2.1 Sampling error..............................................................................................................................320
19.7.2.2 Pin leakage error.......................................................................................................................... 320
19.7.2.3 Noise-induced errors....................................................................................................................320
19.7.2.4 Code width and quantization error...............................................................................................321
19.7.2.5 Linearity errors.............................................................................................................................322
19.7.2.6 Code jitter, non-monotonicity, and missing codes.......................................................................322
Chapter 20
Analog comparator (ACMP)
20.1 Chip specific ACMP information...................................................................................................................................325
20.1.1 ACMP configuration information....................................................................................................................325
20.1.2 ACMP in Stop3 mode......................................................................................................................................325
20.1.3 ACMP0 for SCI0 RXD Filter.......................................................................................................................... 325
20.1.4 ACMP0 output as FTM2CH0 input capture....................................................................................................326
20.1.5 ACMP0 for ADC trigger..................................................................................................................................326
20.2 Introduction.....................................................................................................................................................................326
20.2.1 Features............................................................................................................................................................ 326
20.2.2 Modes of operation.......................................................................................................................................... 327
20.2.2.1 Operation in Wait mode...............................................................................................................327
20.2.2.2 Operation in Stop mode............................................................................................................... 327
20.2.2.3 Operation in Debug mode............................................................................................................327
20.2.3 Block diagram..................................................................................................................................................327
20.3 External signal description..............................................................................................................................................328
20.4 Memory map and register definition...............................................................................................................................328
20.4.1
ACMP Control and Status Register (ACMPx_CS)..........................................................................................329
20.4.2
ACMP Control Register 0 (ACMPx_C0)........................................................................................................ 330
20.4.3
ACMP Control Register 1 (ACMPx_C1)........................................................................................................ 330
20.4.4
ACMP Control Register 2 (ACMPx_C2)........................................................................................................ 331
MC9S08PL16S Reference Manual, Rev. 2, 10/2019
20 NXP Semiconductors
  • 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
  • Page 289 289
  • Page 290 290
  • Page 291 291
  • Page 292 292
  • Page 293 293
  • Page 294 294
  • Page 295 295
  • Page 296 296
  • Page 297 297
  • Page 298 298
  • Page 299 299
  • Page 300 300
  • Page 301 301
  • Page 302 302
  • Page 303 303
  • Page 304 304
  • Page 305 305
  • Page 306 306
  • Page 307 307
  • Page 308 308
  • Page 309 309
  • Page 310 310
  • Page 311 311
  • Page 312 312
  • Page 313 313
  • Page 314 314
  • Page 315 315
  • Page 316 316
  • Page 317 317
  • Page 318 318
  • Page 319 319
  • Page 320 320
  • Page 321 321
  • Page 322 322
  • Page 323 323
  • Page 324 324
  • Page 325 325
  • Page 326 326
  • Page 327 327
  • Page 328 328
  • Page 329 329
  • Page 330 330
  • Page 331 331
  • Page 332 332
  • Page 333 333
  • Page 334 334
  • Page 335 335
  • Page 336 336
  • Page 337 337
  • Page 338 338
  • Page 339 339
  • Page 340 340
  • Page 341 341
  • Page 342 342
  • Page 343 343
  • Page 344 344
  • Page 345 345
  • Page 346 346
  • Page 347 347
  • Page 348 348
  • Page 349 349
  • Page 350 350
  • Page 351 351
  • Page 352 352
  • Page 353 353
  • Page 354 354
  • Page 355 355
  • Page 356 356
  • Page 357 357
  • Page 358 358
  • Page 359 359
  • Page 360 360
  • Page 361 361
  • Page 362 362
  • Page 363 363
  • Page 364 364
  • Page 365 365
  • Page 366 366
  • Page 367 367
  • Page 368 368
  • Page 369 369
  • Page 370 370
  • Page 371 371
  • Page 372 372
  • Page 373 373
  • Page 374 374
  • Page 375 375
  • Page 376 376
  • Page 377 377
  • Page 378 378
  • Page 379 379
  • Page 380 380
  • Page 381 381
  • Page 382 382
  • Page 383 383
  • Page 384 384
  • Page 385 385
  • Page 386 386
  • Page 387 387
  • Page 388 388
  • Page 389 389
  • Page 390 390
  • Page 391 391
  • Page 392 392
  • Page 393 393
  • Page 394 394
  • Page 395 395
  • Page 396 396
  • Page 397 397
  • Page 398 398
  • Page 399 399

NXP S08PLS 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