Sign In
Upload
Manuals
Brands
NXP Semiconductors Manuals
Microcontrollers
MC9S08PA4
NXP Semiconductors MC9S08PA4 Manuals
Manuals and User Guides for NXP Semiconductors MC9S08PA4. We have
1
NXP Semiconductors MC9S08PA4 manual available for free PDF download: Reference Manual
NXP Semiconductors MC9S08PA4 Reference Manual (401 pages)
Brand:
NXP Semiconductors
| Category:
Microcontrollers
| Size: 3 MB
Table of Contents
Table of Contents
3
Chapter 1 Device Overview
23
Introduction
23
MCU Block Diagram
24
System Clock Distribution
25
Chapter 2 Pins and Connections
29
Device Pin Assignment
29
Pin Functions
30
Power (VDD, VSS)
30
Oscillator (XTAL, EXTAL)
31
External Reset Pin (RESET) and Interrupt Pin (IRQ)
32
Background/Mode Select (BKGD/MS)
33
Port a Input/Output (I/O) Pins (PTA5-PTA0)
34
Port B Input/Output (I/O) Pins (PTB7-PTB0)
34
Port C Input/Output (I/O) Pins (PTC3-PTC0)
34
True Open Drain Pins (PTB0)
34
High Current Drive Pins (PTB4, PTB5)
34
Peripheral Pinouts
35
Chapter 3 Power Management
37
Introduction
37
Features
37
Run Mode
37
Wait Mode
38
Stop3 Mode
38
Active BDM Enabled in Stop3 Mode
38
LVD Enabled in Stop Mode
39
Power Modes Behaviors
39
Low Voltage Detect (LVD) System
40
Power-On Reset (POR) Operation
41
LVD Reset Operation
41
Low-Voltage Warning (LVW)
41
Bandgap Reference
42
Power Management Control Bits and Registers
42
System Power Management Status and Control 1 Register (PMC_SPMSC1)
42
System Power Management Status and Control 2 Register (PMC_SPMSC2)
44
Chapter 4 Memory Map
45
Reset and Interrupt Vector Assignments
46
Register Addresses and Bit Assignments
47
Random-Access Memory (RAM)
55
Flash and EEPROM
56
Overview
56
Function Descriptions
58
Modes of Operation
58
Flash and EEPROM Memory Map
58
Flash and EEPROM Initialization after System Reset
59
Flash and EEPROM Command Operations
59
Flash and EEPROM Interrupts
64
Protection
65
Security
68
Flash and EEPROM Commands
70
Flash and EEPROM Command Summary
72
Flash and EEPROM Registers Descriptions
86
Flash Clock Divider Register (NVM_FCLKDIV)
86
Flash Security Register (NVM_FSEC)
87
Flash CCOB Index Register (NVM_FCCOBIX)
88
Flash Configuration Register (NVM_FCNFG)
88
Flash Error Configuration Register (NVM_FERCNFG)
89
Flash Status Register (NVM_FSTAT)
90
Flash Error Status Register (NVM_FERSTAT)
91
Flash Protection Register (NVM_FPROT)
92
EEPROM Protection Register (NVM_EEPROT)
93
Flash Common Command Object Register:high (NVM_FCCOBHI)
94
Flash Common Command Object Register: Low (NVM_FCCOBLO)
95
Flash Option Register (NVM_FOPT)
95
Chapter 5 Interrupt
97
Interrupts
97
Interrupt Stack Frame
98
Interrupt Vectors, Sources, and Local Masks
99
Hardware Nested Interrupt
101
Interrupt Priority Level Register
103
Interrupt Priority Level Comparator Set
104
Interrupt Priority Mask Update and Restore Mechanism
104
Integration and Application of the IPC
105
Irq
105
Features
106
Pin Configuration Options
107
Edge and Level Sensitivity
107
Interrupt Pin Request Register
107
Interrupt Pin Request Status and Control Register (IRQ_SC)
108
Interrupt Priority Control Register
109
IPC Status and Control Register (IPC_SC)
110
Interrupt Priority Mask Pseudo Stack Register (IPC_IPMPS)
111
Interrupt Level Setting Registers N (Ipc_Ilrsn)
111
Chapter 6 System Control
113
System Device Identification (SDID)
113
Universally Unique Identification (UUID)
113
Reset and System Initialization
113
System Options
114
BKGD Pin Enable
114
RESET Pin Enable
114
SCI0 Pin Reassignment
114
FTM0 Channels Pin Reassignment
115
FTM1 Pin Reassignment
115
System Interconnection
115
ACMP Output Selection
116
SCI0 Txd Modulation
116
SCI0 Rxd Capture
116
SCI0 Rxd Filter
117
RTC Capture
117
ADC Hardware Trigger
118
System Control Registers
118
System Reset Status Register (SYS_SRS)
119
System Background Debug Force Reset Register (SYS_SBDFR)
121
System Device Identification Register: High (SYS_SDIDH)
121
System Device Identification Register: Low (SYS_SDIDL)
122
System Options Register 1 (SYS_SOPT1)
122
System Options Register 2 (SYS_SOPT2)
124
System Options Register 3 (SYS_SOPT3)
125
Illegal Address Register: High (SYS_ILLAH)
126
Illegal Address Register: Low (SYS_ILLAL)
126
Universally Unique Identifier Register 1 (SYS_UUID1)
127
Universally Unique Identifier Register 2 (SYS_UUID2)
127
Universally Unique Identifier Register 3 (SYS_UUID3)
128
Universally Unique Identifier Register 4 (SYS_UUID4)
128
Universally Unique Identifier Register 5 (SYS_UUID5)
129
Universally Unique Identifier Register 6 (SYS_UUID6)
129
Universally Unique Identifier Register 7 (SYS_UUID7)
130
Universally Unique Identifier Register 8 (SYS_UUID8)
130
Chapter 7 Parallel Input/Output
131
Introduction
131
Port Data and Data Direction
133
Internal Pullup Enable
133
Input Glitch Filter Setting
134
High Current Drive
134
Pin Behavior in Stop Mode
134
Port Data Registers
134
Port a Data Register (PORT_PTAD)
135
Port B Data Register (PORT_PTBD)
136
Port C Data Register (PORT_PTCD)
136
Port High Drive Enable Register (PORT_HDRVE)
137
Port a Output Enable Register (PORT_PTAOE)
137
Port B Output Enable Register (PORT_PTBOE)
138
Port C Output Enable Register (PORT_PTCOE)
139
Port a Input Enable Register (PORT_PTAIE)
140
Port B Input Enable Register (PORT_PTBIE)
141
Port C Input Enable Register (PORT_PTCIE)
142
Port Filter Register 0 (PORT_IOFLT0)
143
Port Filter Register 2 (PORT_IOFLT2)
144
Port Clock Division Register (PORT_FCLKDIV)
145
Port a Pullup Enable Register (PORT_PTAPE)
146
Port B Pullup Enable Register (PORT_PTBPE)
147
Port C Pullup Enable Register (PORT_PTCPE)
148
Chapter 8 Clock Management
151
Clock Module
151
Internal Clock Source (ICS)
152
Function Description
153
Bus Frequency Divider
154
Low Power Bit Usage
154
Internal Reference Clock (ICSIRCLK)
154
Fixed Frequency Clock (ICSFFCLK)
155
BDC Clock
156
Modes of Operation
156
FLL Engaged Internal (FEI)
157
FLL Engaged External (FEE)
158
FLL Bypassed Internal (FBI)
158
FLL Bypassed Internal Low Power (FBILP)
158
FLL Bypassed External (FBE)
159
FLL Bypassed External Low Power (FBELP)
159
Stop (STOP)
160
FLL Lock and Clock Monitor
161
FLL Clock Lock
161
External Reference Clock Monitor
161
Initialization / Application Information
161
Initializing FEI Mode
162
Initializing FBI Mode
162
Initializing FEE Mode
162
Initializing FBE Mode
163
External Oscillator (OSC)
163
Bypass Mode
164
Low-Power Configuration
164
High-Gain Configuration
165
Initializing External Oscillator for Peripherals
165
Khz Low-Power Oscillator (LPO)
166
Peripheral Clock Gating
166
ICS Control Registers
166
ICS Control Register 1 (ICS_C1)
167
ICS Control Register 2 (ICS_C2)
168
ICS Control Register 3 (ICS_C3)
169
ICS Control Register 4 (ICS_C4)
169
ICS Status Register (ICS_S)
170
OSC Status and Control Register (ICS_OSCSC)
171
System Clock Gating Control Registers
172
System Clock Gating Control 1 Register (SCG_C1)
173
System Clock Gating Control 2 Register (SCG_C2)
174
System Clock Gating Control 3 Register (SCG_C3)
175
System Clock Gating Control 4 Register (SCG_C4)
175
Chapter 9 Chip Configurations
177
Introduction
177
Core Modules
177
Central Processor Unit (CPU)
177
Debug Module (DBG)
177
System Modules
178
Watchdog (WDOG)
178
Clock Module
178
Memory
180
Random-Access-Memory (RAM)
180
Non-Volatile Memory (NVM)
180
Power Modules
180
Timers
181
Flextimer Module (FTM)
181
FTM0 Interconnection
182
FTM1 Interconnection
183
Real-Time Counter (RTC)
183
Communication Interfaces
185
Serial Communications Interface (SCI)
185
SCI0 Infrared Functions
186
Analog
187
Analog-To-Digital Converter (ADC)
187
ADC Channel Assignments
188
Alternate Clock
190
Hardware Trigger
190
Temperature Sensor
190
Analog Comparator (ACMP)
191
ACMP Configuration Information
193
ACMP in Stop3 Mode
193
ACMP to FTM Configuration Information
193
ACMP for SCI0 RXD Filter
193
Human-Machine Interfaces HMI
194
Keyboard Interrupts (KBI)
194
Chapter 10 Central Processor Unit
197
Introduction
197
Features
197
Programmer's Model and CPU Registers
198
Accumulator (A)
198
Index Register (H:X)
199
Stack Pointer (SP)
199
Program Counter (PC)
200
Condition Code Register (CCR)
200
Addressing Modes
201
Inherent Addressing Mode (INH)
202
Relative Addressing Mode (REL)
202
Immediate Addressing Mode (IMM)
202
Direct Addressing Mode (DIR)
203
Extended Addressing Mode (EXT)
203
Indexed Addressing Mode
204
Indexed, no Offset (IX)
204
Indexed, no Offset with Post Increment (IX+)
204
Indexed, 8-Bit Offset (IX1)
204
Indexed, 8-Bit Offset with Post Increment (IX1+)
205
Indexed, 16-Bit Offset (IX2)
205
SP-Relative, 8-Bit Offset (SP1)
205
SP-Relative, 16-Bit Offset (SP2)
206
Memory to Memory Addressing Mode
206
Direct to Direct
206
Immediate to Direct
206
Indexed to Direct, Post Increment
207
Direct to Indexed, Post-Increment
207
Operation Modes
207
Stop Mode
207
Wait Mode
208
Background Mode
208
Security Mode
209
HCS08 V6 Opcodes
211
Special Operations
211
Reset Sequence
211
Interrupt Sequence
211
Instruction Set Summary
212
Chapter 11 Keyboard Interrupts (KBI)
225
Introduction
225
Features
225
Modes of Operation
225
KBI in Wait Mode
225
KBI in Stop Modes
226
KBI in Active Background Mode
226
Block Diagram
226
External Signals Description
227
Register Definition
227
Memory Map and Registers
227
KBI Status and Control Register (Kbix_Sc)
228
Kbix Pin Enable Register (Kbix_Pe)
228
Kbix Edge Select Register (Kbix_Es)
229
Functional Description
229
Edge-Only Sensitivity
230
Edge and Level Sensitivity
230
KBI Pullup Resistor
230
KBI Initialization
231
Chapter 12
233
Flextimer Module (FTM)
233
Introduction
233
Flextimer Philosophy
233
Features
233
Modes of Operation
234
Block Diagram
234
Signal Description
235
EXTCLK - FTM External Clock
236
Chn - FTM Channel (N) I/O Pin
236
Memory Map and Register Definition
236
Module Memory Map
236
Register Descriptions
236
Status and Control (Ftmx_Sc)
238
Counter High (Ftmx_Cnth)
239
Counter Low (Ftmx_Cntl)
240
Modulo High (Ftmx_Modh)
240
Modulo Low (Ftmx_Modl)
241
Channel Status and Control (Ftmx_Cnsc)
241
Channel Value High (Ftmx_Cnvh)
243
Channel Value Low (Ftmx_Cnvl)
244
Functional Description
244
Clock Source
245
Counter Clock Source
245
Prescaler
246
Counter
246
Up Counting
246
Up-Down Counting
247
Free Running Counter
248
Counter Reset
248
Input Capture Mode
248
Output Compare Mode
249
Edge-Aligned PWM (EPWM) Mode
251
Center-Aligned PWM (CPWM) Mode
252
Update of the Registers with Write Buffers
254
MODH:L Registers
254
Cnvh:l Registers
255
BDM Mode
255
Reset Overview
255
FTM Interrupts
257
Timer Overflow Interrupt
257
Channel (N) Interrupt
257
Chapter 13 Real-Time Counter (RTC)
259
Introduction
259
Features
259
Modes of Operation
259
Wait Mode
260
Stop Modes
260
Block Diagram
260
Register Definition
260
RTC Status and Control Register 1 (RTC_SC1)
261
RTC Status and Control Register 2 (RTC_SC2)
262
RTC Modulo Register: High (RTC_MODH)
263
RTC Modulo Register: Low (RTC_MODL)
263
RTC Counter Register: High (RTC_CNTH)
263
RTC Counter Register: Low (RTC_CNTL)
264
Functional Description
264
RTC Operation Example
266
Initialization/Application Information
266
Chapter 14 Serial Communications Interface (SCI)
269
Introduction
269
Features
269
Modes of Operation
269
Block Diagram
270
SCI Signal Descriptions
272
Detailed Signal Descriptions
272
Register Definition
272
SCI Baud Rate Register: High (Scix_Bdh)
273
SCI Baud Rate Register: Low (Scix_Bdl)
274
SCI Control Register 1 (Scix_C1)
274
SCI Control Register 2 (Scix_C2)
276
SCI Status Register 1 (Scix_S1)
277
SCI Status Register 2 (Scix_S2)
279
SCI Control Register 3 (Scix_C3)
280
SCI Data Register (Scix_D)
282
Functional Description
282
Baud Rate Generation
283
Transmitter Functional Description
283
Send Break and Queued Idle
284
Receiver Functional Description
285
Data Sampling Technique
286
Receiver Wake-Up Operation
287
Interrupts and Status Flags
288
Baud Rate Tolerance
289
Slow Data Tolerance
289
Fast Data Tolerance
291
Additional SCI Functions
292
8- and 9-Bit Data Modes
292
Stop Mode Operation
292
Loop Mode
293
Single-Wire Operation
293
Chapter 15 Analog-To-Digital Converter (ADC)
295
Introduction
295
Features
295
Block Diagram
296
External Signal Description
296
Analog Power (VDDA)
297
Analog Ground (VSSA)
297
Voltage Reference High (VREFH)
297
Voltage Reference Low (VREFL)
297
Analog Channel Inputs (Adx)
297
ADC Control Registers
298
Status and Control Register 1 (ADC_SC1)
298
Status and Control Register 2 (ADC_SC2)
300
Status and Control Register 3 (ADC_SC3)
301
Status and Control Register 4 (ADC_SC4)
302
Conversion Result High Register (ADC_RH)
303
Conversion Result Low Register (ADC_RL)
304
Compare Value High Register (ADC_CVH)
305
Compare Value Low Register (ADC_CVL)
305
Pin Control 1 Register (ADC_APCTL1)
306
Functional Description
307
Clock Select and Divide Control
308
Input Select and Pin Control
308
Hardware Trigger
309
Conversion Control
309
Initiating Conversions
309
Completing Conversions
310
Aborting Conversions
310
Power Control
311
Sample Time and Total Conversion Time
311
Automatic Compare Function
312
FIFO Operation
313
MCU Wait Mode Operation
317
MCU Stop3 Mode Operation
317
Stop3 Mode with ADACK Disabled
317
Stop3 Mode with ADACK Enabled
317
Initialization Information
318
ADC Module Initialization Example
318
Initialization Sequence
318
Pseudo-Code Example
319
ADC FIFO Module Initialization Example
319
Pseudo-Code Example
320
Application Information
321
External Pins and Routing
321
Analog Supply Pins
321
Analog Reference Pins
321
Analog Input Pins
322
Sources of Error
323
Sampling Error
323
Pin Leakage Error
323
Noise-Induced Errors
323
Code Width and Quantization Error
325
Linearity Errors
325
Code Jitter, Non-Monotonicity, and Missing Codes
326
Chapter 16 Analog Comparator (ACMP)
327
Introduction
327
Features
327
Modes of Operation
328
Operation in Wait Mode
328
Operation in Stop3 Mode
328
Operation in Debug Mode
328
Block Diagram
328
External Signal Description
329
Memory Map and Register Definition
329
ACMP Control and Status Register (ACMP_CS)
330
ACMP Control Register 0 (ACMP_C0)
331
ACMP Control Register 1 (ACMP_C1)
331
ACMP Control Register 2 (ACMP_C2)
332
Functional Description
332
Setup and Operation of ACMP
333
Resets
334
Interrupts
334
Chapter 17 Watchdog (WDOG)
335
Introduction
335
Features
335
Block Diagram
336
Memory Map and Register Definition
337
Watchdog Control and Status Register 1 (WDOG_CS1)
337
Watchdog Control and Status Register 2 (WDOG_CS2)
339
Watchdog Counter Register: High (WDOG_CNTH)
340
Watchdog Counter Register: Low (WDOG_CNTL)
340
Watchdog Timeout Value Register: High (WDOG_TOVALH)
341
Watchdog Timeout Value Register: Low (WDOG_TOVALL)
341
Watchdog Window Register: High (WDOG_WINH)
342
Watchdog Window Register: Low (WDOG_WINL)
342
Functional Description
343
Watchdog Refresh Mechanism
343
Window Mode
344
Refreshing the Watchdog
344
Example Code: Refreshing the Watchdog
345
Configuring the Watchdog
345
Reconfiguring the Watchdog
346
Unlocking the Watchdog
346
Example Code: Reconfiguring the Watchdog
346
Clock Source
347
Using Interrupts to Delay Resets
348
Backup Reset
348
Functionality in Debug and Low-Power Modes
348
Fast Testing of the Watchdog
349
Testing each Byte of the Counter
349
Entering User Mode
350
Chapter 18 Development Support
351
Introduction
351
Forcing Active Background
351
Features
351
Background Debug Controller (BDC)
352
BKGD Pin Description
353
Communication Details
354
BDC Commands
356
BDC Hardware Breakpoint
359
On-Chip Debug System (DBG)
359
Comparators a and B
360
Bus Capture Information and FIFO Operation
360
Change-Of-Flow Information
361
Tag Vs. Force Breakpoints and Triggers
362
Trigger Modes
363
Hardware Breakpoints
364
Memory Map and Register Description
365
BDC Status and Control Register (BDC_SCR)
365
BDC Breakpoint Match Register: High (BDC_BKPTH)
367
BDC Breakpoint Register: Low (BDC_BKPTL)
368
System Background Debug Force Reset Register (BDC_SBDFR)
368
Chapter 19 Debug Module (DBG)
371
Introduction
371
Features
371
Modes of Operation
372
Block Diagram
372
Signal Description
373
Memory Map and Registers
373
Debug Comparator a High Register (DBG_CAH)
374
Debug Comparator a Low Register (DBG_CAL)
375
Debug Comparator B High Register (DBG_CBH)
376
Debug Comparator B Low Register (DBG_CBL)
376
Debug Comparator C High Register (DBG_CCH)
377
Debug Comparator C Low Register (DBG_CCL)
378
Debug FIFO High Register (DBG_FH)
378
Debug FIFO Low Register (DBG_FL)
379
Debug Comparator a Extension Register (DBG_CAX)
380
Debug Comparator B Extension Register (DBG_CBX)
381
Debug Comparator C Extension Register (DBG_CCX)
382
Debug FIFO Extended Information Register (DBG_FX)
383
Debug Control Register (DBG_C)
383
Debug Trigger Register (DBG_T)
384
Debug Status Register (DBG_S)
386
Debug Count Status Register (DBG_CNT)
387
Functional Description
388
Comparator
388
RWA and RWAEN in Full Modes
388
Comparator C in Loop1 Capture Mode
388
Breakpoints
389
Hardware Breakpoints
389
Trigger Selection
390
Trigger Break Control (TBC)
390
Begin- and End-Trigger
391
Arming the DBG Module
391
Trigger Modes
392
Fifo
395
Storing Data in FIFO
395
Storing with Begin-Trigger
395
Storing with End-Trigger
395
Reading Data from FIFO
395
Interrupt Priority
396
Resets
397
Advertisement
Advertisement
Related Products
NXP Semiconductors MC9S08LG32
NXP Semiconductors MC9S08LG16
NXP Semiconductors MC9S08SU16
NXP Semiconductors MC9S08SU16VFK
NXP Semiconductors MC9S08SU8VFK
NXP Semiconductors MC9S08QL8 MCU Series
NXP Semiconductors MC9S08QL4
NXP Semiconductors MC9S12XS256
NXP Semiconductors MC9S12ZVMB-Family
NXP Semiconductors Freescale MC9S12XE Series
NXP Semiconductors Categories
Motherboard
Microcontrollers
Computer Hardware
Control Unit
Controller
More NXP Semiconductors Manuals
Login
Sign In
OR
Sign in with Facebook
Sign in with Google
Upload manual
Upload from disk
Upload from URL