• MC9S08JS16 (Data Sheet)
Contains pin assignments and diagrams, all electrical
specifications, and mechanical drawing outlines.
Find the most current versions of all documents at:
http://www.freescale.com
MC9S08JS16 Features
8-Bit HCS08 Central Processor Unit (CPU)
•48 MHz HCS08 CPU (central processor
unit)
•24 MHz internal bus frequency
•HC08 instruction set with added BGND
instruction
•Support for up to 32 interrupt/reset sources
Memory Options
•Up to 16 KB of on-chip in-circuit
programmable flash memory with block
protection and security options
•Up to 512 bytes of on-chip RAM
•256 bytes of USB RAM
Clock Source Options
•Clock source options include crystal,
resonator, external clock
•MCG (multi-purpose clock generator) —
PLL and FLL; internal reference clock with
trim adjustment
System Protection
•Optional computer operating properly
(COP) reset with option to run from
independent 1 kHz internal clock source or
the bus clock
•Low-voltage detection
•Illegal opcode detection with reset
•Illegal address detection with reset
Power-Saving Modes
•Wait plus two stops
USB Bootload
•Mass erase entire flash array
•Partial erase flash array — erase all flash
blocks except for the first 1 KB of flash
transceiver; supports endpoint 0 and up to 6
additional endpoints
•SPI — One 8- or 16-bit selectable serial
peripheral interface module with a receive
data buffer hardware match function
•SCI — One serial communication interface
module with optional 13-bit break. Full
duplex non-return to zero (NRZ); LIN
master extended break generation; LIN
slave extended break detection; wakeup on
active edge
•MTIM — One 8-bit modulo counter with
8-bit prescaler and overflow interrupt
•TPM — One 2-channel 16-bit
timer/pulse-width modulator (TPM)
module: selectable input capture, output
compare, and edge-aligned PWM capability
on each channel. Timer module may be
configured for buffered, centered PWM
(CPWM) on all channels
•KBI — 8-pin keyboard interrupt module
•RTC — Real-time counter with binary- or
decimal-based prescaler
•CRC — Hardware CRC generator circuit
using 16-bit shift register; CRC16-CCITT
compliancy with x16+x12+x5+1 polynomial
Input/Output
•Software selectable pullups on ports when
used as inputs
•Software selectable slew rate control on
ports when used as outputs
•Software selectable drive strength on ports
when used as outputs
•Master reset pin and power-on reset (POR)
•Internal pullup on RESET, IRQ, and
BKGD/MS pins to reduce customer system
cost
Package Options
•Program flash
Peripherals
•USB — USB 2.0 full-speed (12 Mbps) with
dedicated on-chip 3.3 V regulator and
•24-pin quad flat no-lead (QFN)
•20-pin small outline IC package (SOIC)
MC9S08JS16 MCU Series Reference Manual
Covers:MC9S08JS16
MC9S08JS8
MC9S08JS16L
MC9S08JS8L
MC9S08JS16RM
Rev. 4
4/2009
Revision History
To provide the most up-to-date information, the revision of our documents on the World Wide Web will
be the most current. Your printed copy may be an earlier revision. To verify you have the latest information
available, refer to:
http://freescale.com
The following revision history table summarizes changes contained in this document.
Revision
Number
18/27/2008Initial public release.
212/17/2008Changed the content of register at address 0xFFAE and 0xFFAF in Ta bl e 4 - 4 and added the
33/6/2009Updated Figure 4-4 and Figure 4-5.
44/24/2009Added MC9S08JS16L and MC9S08JS8L information.
Revision
Date
Description of Changes
description of factory trim value before this table.
Deleted duplicated information in KBI Features section.
Changed the default of PTASE/PTBSE registers after reset to 0.
This product incorporates SuperFlash® technology licensed from SST.
6.2Port Data and Data Direction ..........................................................................................................79
6.3Pin Control ......................................................................................................................................80
14.2 Features .........................................................................................................................................215
14.3 TPMV3 Differences from Previous Versions ................................................................................217
14.3.1 Migrating from TPMV1 ..................................................................................................219
14.3.2 Features ...........................................................................................................................220
14.3.3 Modes of Operation ........................................................................................................220
17.4.1 BDC Registers and Control Bits .....................................................................................297
17.4.2 System Background Debug Force Reset Register (SBDFR) ..........................................299
17.4.3 DBG Registers and Control Bits .....................................................................................300
MC9S08JS16 MCU Series Reference Manual, Rev. 4
16Freescale Semiconductor
Chapter 1
Device Overview
1.1Introduction
MC9S08JS16 series MCUs are members of the low-cost, high-performance HCS08 family of 8-bit
microcontroller units (MCUs). All MCUs in the family use the enhanced HCS08 core and are available
with a variety of modules, memory sizes, memory types, and package types.
NOTE
The only difference between MC9S08JS16/MC9S08JS8 and
MC9S08JS16L/MC9S08JS8L is that MC9S08JS16 and MC9S08JS8
support USB bootloader function with voltage above 3.9 V while
MC9S08JS16L and MC9S08JS8L support USB bootloader function at
3.3 V.
Disable internal USB voltage regulator and apply 3.3 V to the V
USB33
pin
when using MC9S08JS16L and MC9S08JS8L for the USB bootloader
function.
Table 1-1 summarizes the peripheral availability per package type for the devices available in the
MC9S08JS16 series.
Table 1-1. MC9S08JS16 Series Features by MCU and Package
FeatureMC9S08JS8/MC9S08JS8LMC9S08JS16/MC9S08JS16L
Package24-pin QFN20-pin SOIC24-pin QFN20-pin SOIC
Flash size (bytes)8,19216,384
RAM size (bytes)512512
USB RAM (bytes)256256
IRQyesyes
KBI88
SCIyesyes
SPIyesyes
MTIMyesyes
TPM channels22
USByesyes
CRCyesyes
I/O pins14 (2 output only)14 (2 output only)
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Freescale Semiconductor17
Chapter 1 Device Overview
V
SS
V
DD
PORT B
8-BIT KEYBOARD
INTERRUPT MODULE (KBI)
USER FLASH (IN BYTES)
USER RAM (IN BYTES)
ON-CHIP ICE AND
DEBUG MODULE (DBG)
HCS08 CORE
CPU
NOTES:
1. Port pins are software configurable with pullup device if input port.
2. Pin contains software configurable pullup/pulldown device if IRQ is enabled (IRQPE = 1).
Pulldown is enabled if rising edge detect is selected (IRQEDG = 1).
3. IRQ does not have a clamp diode to V
DD
. IRQ must not be driven above VDD.
4. RESET
contains integrated pullup device if PTB1 enabled as reset pin function (RSTPE = 1).
5. Pin contains integrated pullup device.
6. When pin functions as KBI (KBIPEn = 1) and associated pin is configured to enable the pullup
device, KBEDGn can be used to reconfigure the pullup as a pulldown device.
PTA2/KBIP2/MOSI
PORT A
HCS08 SYSTEM CONTROL
RESETS AND INTERRUPTS
MODES OF OPERATION
POWER MANAGEMENT
VOLTAGE
REGULATOR
COPIRQLVD
LOW-POWER OSCILLATOR
MULTI-PURPOSE CLOCK
GENERATOR (MCG)
RESET
2-CHANNEL TIMER/PWM
MODULE (TPM)
PTA3/KBIP3/SPSCK
BKGD/MS
IRQ
KBIPx
TCLK
TPMCH0
TPMCH1
EXTAL
XTAL
USB
USB ENDPOINT
MODULE
RAM
FULL SPEED
USB
TRANSCEIVER
USBDP
USBDN
PTA6/KBIP6/RxD
PTA7/KBIP7/TxD
REAL-TIME COUNTER
(RTC)
PTA4/KBIP4/SS
PTA5/KBIP5/TPMCH1
8
SYSTEM
USB 3.3 V VOLTAGE REGULATOR
V
USB33
512
MC9S08JS16 = 16,384
V
SSOSC
PTA0/KBIP0/TPMCH0
PTA1/KBIP1/MISO
PTB3/BLMS
PTB2/BKGD/MS
PTB0/IRQ/TCLK
PTB1/RESET
PTB5/EXTAL
PTB4/XTAL
SERIAL PERIPHERAL
INTERFACE MODULE (SPI)
SPSCK
SS
MISO
MOSI
8-/16-BIT
8-BIT MODULO TIMER
MODULE (MTIM)
INTERFACE MODULE (SCI)
SERIAL COMMUNICATIONS
RxD
TxD
BDC
Bootloader ROM (IN BYTES)
4096
16-BIT Cyclic Redundancy
MODULE (CRC)
Check Generator
MC9S08JS8L = 8,192
MC9S08JS16L = 16,384
MC9S08JS8 = 8,192
1.2MCU Block Diagram
The block diagram in Figure 1-1 shows the structure of the MC9S08JS16 series MCU.
Figure 1-1. MC9S08JS16 Series Block Diagram
18Freescale Semiconductor
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Chapter 1 Device Overview
TPM
BDC
CPU
RAMFLASH
2
MCG
MCGOUT
÷2
BUSCLK
MCGLCLK
MCGERCLK
COP
1
The fixed frequency clock (FFCLK) is internally synchronized to the bus clock and must not exceed one half of the
bus clock frequency.
2
Flash and EEPROM have frequency requirements for program and erase operation. See MC9S08JS16 Series
Data Sheet for details.
XOSC
EXTALXTAL
FFCLK
1
MCGFFCLK
RTC
1 kHz
LPO
TCLK
MCGIRCLK
÷2
USB
USB RAM
SCI
ROM
MTIM
SPI
CRC
Table 1-2 lists the functional versions of the on-chip modules.
Table 1-2. Versions of On-Chip Modules
ModuleVersion
Central Processing Unit(CPU)2
Keyboard Interrupt(KBI)2
Multi-Purpose Clock Generator(MCG)1
Real-Time Counter(RTC)1
Serial Communications Interface(SCI)4
Serial Peripheral Interface(SPI16)1
Modulo Timer (MTIM)1
Timer Pulse-Width Modulator(TPM)3
Universal Serial Bus(USB)1
Cyclic Redundancy Check Generator(CRC)2
Debug Module(DBG)2
1.3System Clock Distribution
TCLK — External input clock source for TPM and MTIM and is referenced as TPMCLK in Chapter 14,
“Timer/Pulse-Width Modulator (S08TPMV3).”
Figure 1-2. System Clock Distribution Diagram
The MCG supplies the following clock sources:
Freescale Semiconductor19
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Chapter 1 Device Overview
•MCGOUT — This clock source is used as the CPU, USB RAM and USB module clock, and is
divided by two to generate the peripheral bus clock (BUSCLK). Control bits in the MCG control
registers determine which of the three clock sources is connected:
— Internal reference clock
— External reference clock
— Frequency-locked loop (FLL) or phase-locked loop (PLL) output
See Chapter 9, “Multi-Purpose Clock Generator (S08MCGV1),” for details on configuring the
MCGOUT clock.
•MCGLCLK — This clock source is derived from the digitally controlled oscillator (DCO) of the
MCG. Development tools can select this internal self-clocked source to speed up BDC
communications in systems where the bus clock is slow.
•MCGIRCLK — This is the internal reference clock and can be selected as the real-time counter
(RTC) clock source. Chapter 9, “Multi-Purpose Clock Generator (S08MCGV1),” explains the
MCGIRCLK in more detail. See Chapter 11, “Real-Time Counter (S08RTCV1),” for more
information regarding the use of MCGIRCLK.
•MCGERCLK — This is the external reference clock and can be selected as the clock source of
RTC module. Section 9.4.6, “External Reference Clock,” explains the MCGERCLK in more
detail. See Chapter 11, “Real-Time Counter (S08RTCV1),” for more information regarding the use
of MCGERCLK with this module.
•MCGFFCLK — This clock source is divided by two to generate FFCLK after being synchronized
to the BUSCLK. It can be selected as clock source for the TPM or MTIM modules. The frequency
of the MCGFFCLK is determined by the settings of the MCG. See Section 9.4.7, “Fixed Frequency
Clock,” for details.
•LPO clock — This clock is generated from an internal low power oscillator that is completely
independent of the MCG module. The LPO clock can be selected as the clock source to the RTC
or COP modules. See Chapter 11, “Real-Time Counter (S08RTCV1),” and Section 5.4, “Computer
Operating Properly (COP) Watchdog,” for details on using the LPO clock with these modules.
•TCLK — TCLK is the optional external clock source for the TPM or MTIM modules. The TCLK
must be limited to 1/4th the frequency of the BUSCLK for synchronization. See Chapter 14,
“Timer/Pulse-Width Modulator (S08TPMV3),” for more details.
MC9S08JS16 MCU Series Reference Manual, Rev. 4
20Freescale Semiconductor
Chapter 2
USBDN
PTB3/BLMS
1
2
3
4
5
PTA0/KBIP0/TPMCH0
81011
7
17
23
PTB2/BKGD/MS
13
14
15
16
22212019
PTB5/EXTAL
V
SSOSC
PTA5/KBIP5/TPMCH1
V
USB33
V
DD
PTA4/KBIP4/SS
PTA2/KBIP2/MOSI
PTA1/KBIP1/MISO
PTA7/KBIP7/TxD
PTB4/XTAL
PTA3/KBIP3/SPSCK
PTB1/RESET
PTB0/IRQ/TCLK
USBDP
V
SS
PTA6/KBIP6/RxD
24-Pin QFN
12
NC
6
NC
V
SS
NC
18
24
NC
9
Pins and Connections
2.1Introduction
This chapter describes signals that connect to package pins. It includes a pinout diagram, a table of signal
properties, and detailed discussion of signals.
2.2Device Pin Assignment
Freescale Semiconductor21
Figure 2-1. MC9S08JS16 Series in 24-pin QFN Package
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Chapter 2 Pins and Connections
1
2
3
4
5
6
7
8
9
10
20
19
18
17
16
15
14
13
12
11
PTA3/KBIP3/SPSCK
PTA4/KBIP4/SS
USBDP
USBDN
V
USB33
PTA5/KBIP5/TPMCH1
V
DD
V
SS
V
SSOSC
PTB0/IRQ/TCLK
PTB1/RESET
PTA0/KBIP0/TPMCH0
PTA1/KBIP1/MISO
PTA2/KBIP2/MOSI
PTA7/KBIP7/TxD
PTA6/KBIP6/RxD
PTB5/EXTAL
PTB4/XTAL
PTB2/BKGD/MS
PTB3/BLMS
Figure 2-2. MC9S08JS16 Series in 20-Pin SOIC Package
2.3Recommended System Connections
Figure 2-3 shows pin connections that are common to almost all MC9S08JS16 series application systems.
22Freescale Semiconductor
MC9S08JS16 MCU Series Reference Manual, Rev. 4
V
DD
V
SS
RESET
OPTIONAL
MANUAL
RESET
V
DD
1
BACKGROUND HEADER
C
BY
0.1 μF
C
BLK
10 μF
+
5 V
+
SYSTEM
POWER
I/O AND
PERIPHERAL
INTERFACE TO
SYSTEM
APPLICATION
V
DD
PORT
A
PORT
B
IRQ
ASYNCHRONOUS
INTERRUPT
INPUT
NOTES:
1. External crystal circuity is not required if using the MCG internal clock. For USB operation, an external crystal is required.
2. XTAL and EXTAL use the same pins as PTB4 and PTB5, respectively.
3. RC filters on RESET
and IRQ are recommended for EMC-sensitive applications.
4. R
PUDP
is shown for full-speed USB only. The diagram shows a configuration where the on-chip regulator and R
PUDP
are enabled. The voltage regulator output is
used for R
PUDP. RPUDP
can optionally be disabled if using an external pullup resistor on USBDP.
5. V
BUS
is a 5.0 V supply from upstream port that can be used for USB operation.
6. USBDP and USBDN are powered by the 3.3 V regulator.
7. For USB operation, an external crystal with a value of 2 MHz or 4 MHz is recommended.
8. BLMS
pin has loading limitation, do not connect any cap with this pin.
9. If there is an external pullup resistor on PTB2/PTB3, PTB2/PTB3 must be configured as anoutput pin. Otherwise there will be current consumption on the pin (about
0.5 mA for a 10 kΩ resistor). The load on PTB2/PTB3 must be smaller than 50 pF.
10. When using internal V
USB33
as supply, there needs to be an external cap.
MC9S08JS16
V
DD
4.7 kΩ
–
0
.1 μF
V
DD
4.7 kΩ–10 kΩ
0.1 μF
1
0 kΩ
2
43
USBDN
V
USB33
USBDP
V
Bus
USB SERIES-B CONNECTOR
V
USB33
3.3 V Reference
R
PUDP
BKGD/MS
XTAL
EXTAL
C2
C1
X1
R
F
R
S
NOTE 1
V
SSOSC
PTB3/BLMS
PTB2/BKGD/MS
PTB0/IRQ/TCLK
PTB1/RESET
PTB5/EXTAL
PTB4/XTAL
PTA2/KBIP2/MOSI
PTA3/KBIP3/SPSCK
PTA6/KBIP6/RxD
PTA7/KBIP7/TxD
PTA4/KBIP4/SS
PTA5/KBIP5/TPMCH1
PTA0/KBIP0/TPMCH0
PTA1/KBIP1/MISO
BLMS
OPTIONAL
MANUAL
BLMS
NOTE 8, 9
C
4
0.47 μF
C
3
4.7 μF
+
NOTE 10
33 Ω ± 1%
33 Ω ± 1%
Chapter 2 Pins and Connections
Freescale Semiconductor23
Figure 2-3. Basic System Connections
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Chapter 2 Pins and Connections
2.3.1Power (VDD, VSS, V
SSOSC
, V
USB33
)
VDD and VSS are the primary power supply pins for the MCU. This voltage source supplies power to all
I/O buffer circuitry and to an internal voltage regulator. The internal voltage regulator provides regulated
lower-voltage source to the CPU and other internal circuitry of the MCU.
Typically, application systems have two separate capacitors across the power pins. In this case, there must
be a bulk electrolytic capacitor, such as a 10 μF tantalum capacitor, to provide bulk charge storage for the
overall system and a 0.1 μF ceramic bypass capacitor located as near to the paired VDD and V
pins as practical to suppress high-frequency noise. The MC9S08JS16 has a V
pin. This pin must be
SSOSC
SS
power
connected to the system ground plane or to the primary VSS pin through a low-impedance connection.
V
Controller (S08USBV1),” for a complete description of the V
is connected to the internal USB 3.3 V regulator. See Chapter 15, “Universal Serial Bus Device
USB33
power pin.
USB33
2.3.2Oscillator (XTAL, EXTAL)
Immediately after reset, the MCU uses an internally generated clock provided by the multi-purpose clock
generator (MCG) module. For more information on the MCG, see Chapter 9, “Multi-Purpose Clock
Generator (S08MCGV1).”
The oscillator (XOSC) in this MCU is a Pierce oscillator that can accommodate a crystal or ceramic
resonator. Rather than a crystal or ceramic resonator, an external oscillator can be connected to the EXTAL
input pin.
RS (when used) and RF must be low-inductance resistors such as carbon composition resistors.
Wire-wound resistors, and some metal film resistors, have too much inductance. C1 and C2 normally are
high-quality ceramic capacitors that are specifically designed for high-frequency applications.
RF is used to provide a bias path to keep the EXTAL input in its linear range during crystal startup; its value
is not generally critical. Typical systems use 1 MΩ to 10 MΩ. Higher values are sensitive to humidity and
lower values reduce gain and (in extreme cases) could prevent startup.
C1 and C2 are typically in the 5 pF to 25 pF range and are chosen to match the requirements of a specific
crystal or resonator. Be sure to take into account printed circuit board (PCB) capacitance and MCU pin
capacitance when selecting C1 and C2. The crystal manufacturer typically specifies a load capacitance that
is the series combination of C1 and C2 (which are usually the same size). As a first-order approximation,
use 10 pF as an estimate of combined pin and PCB capacitance for each oscillator pin (EXTAL and
XTAL).
2.3.3RESET Pin
After a power-on reset (POR), the PTB1/RESET pin defaults to a general-purpose input port pin, PTB1.
Setting RSTPE in SOPT1 configures the pin to be the RESET pin containing an internal pullup device.
After configured as RESET
enabled can be used to reset the MCU from an external source when the pin is driven low.
, the pin remains RESET until the next LVD or POR. The RESET pin when
MC9S08JS16 MCU Series Reference Manual, Rev. 4
24Freescale Semiconductor
Chapter 2 Pins and Connections
Internal power-on reset and low-voltage reset circuitry typically make external reset circuitry unnecessary.
This pin is normally connected to the standard 6-pin background debug connector so a development
system can directly reset the MCU system. If desired, a manual external reset can be added by supplying
a simple switch to ground (pull reset pin low to force a reset).
When any non-POR reset is initiated (whether from an external source or from an internal source), the
RESET pin is driven low for approximately 66 bus cycles and released. The reset circuity decodes the
cause of reset and records it by setting a corresponding bit in the system control reset status register (SRS).
NOTE
The voltage on the internally pulled up RESET pin when measured is below
VDD. The internal gates connected to this pin are pulled to VDD. If the
RESET pin is required to drive to a V
level, an external pullup must be
DD
used.
NOTE
In EMC-sensitive applications, an external RC filter is recommended on the
RESET pin, if enabled (Figure 2-3).
2.3.4Background/Mode Select (BKGD/MS)
During a power-on-reset (POR) or background debug force reset (see Section 5.7.3, “System Background
Debug Force Reset Register (SBDFR),” for details), the PTB2/BKGD/MS pin functions as a mode select
pin. Immediately after reset rises the pin functions as the background pin and can be used for background
debug communication. When enabled as the BKGD/MS pin (BKGDPE = 1), an internal pullup device is
automatically enabled.
The background debug communication function is enabled when BKGDPE in SOPT1 is set. BKGDPE is
set following any reset of the MCU and must be cleared to use the PTB2/BKGD/MS pin’s alternative pin
functions.
If nothing is connected to this pin, the MCU will enter normal operating mode at the rising edge of reset.
If a debug system is connected to the 6-pin standard background debug header, it can hold BKGD/MS low
during the rising edge of reset which forces the MCU to active background mode.
The BKGD pin is used primarily for background debug controller (BDC) communications using a custom
protocol that uses 16 clock cycles of the target MCU’s BDC clock per bit time. The target MCU’s BDC
clock could be as fast as the bus clock rate, so there must never be any significant capacitance connected
to the BKGD/MS pin that could interfere with background serial communications.
Although the BKGD pin is a pseudo open-drain pin, the background debug communication protocol
provides brief, actively driven, high speedup pulses to ensure fast rise times. Small capacitances from
cables and the absolute value of the internal pullup device play almost no role in determining rise and fall
times on the BKGD pin.
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Freescale Semiconductor25
Chapter 2 Pins and Connections
NOTE
Before the IRQ or RESET function is enabled, be sure to enable the GPIO
pullup in that function’s pin and wait about 2 μs. Otherwise the IRQ or
RESET configuration may fail.
2.3.5Bootloader Mode Select (BLMS)
During a power-on-reset (POR), the CPU detects the state of the PTB3/BLMS pin that functions as a mode
select pin. When the logic is low and BKGD/MS is not pulled low, the CPU enters the bootloader mode.
During a power-on-reset (POR), an internal pullup device is automatically enabled in PTB3/BLMS pin.
Immediately after reset rises the pin functions as a general-purpose output only pin and an internal pullup
device is automatically disabled.
2.3.6USB Data Pins (USBDP, USBDN)
The USBDP (D+) and USBDN (D–) pins are the analog input/output lines for full-speed data
communication in the USB physical layer (PHY) module. An optional internal pullup resistor for the
USBDP pin, R
, is available.
PUDP
2.3.7General-Purpose I/O and Peripheral Ports
The MC9S08JS16 series of MCUs supports up to 14 general-purpose I/O pins, including two output-only
pins, which are shared with on-chip peripheral functions (timers, serial I/O, keyboard interrupts, etc.).
When a port pin is configured as a general-purpose output or a peripheral uses the port pin as an output,
software can select one of two drive strengths and enable or disable slew rate control. When a port pin is
configured as a general-purpose input or a peripheral uses the port pin as an input, software can enable a
pullup device.
For information about controlling these pins as general-purpose I/O pins, see Chapter 6, “Parallel
Input/Output.” For information about how and when on-chip peripheral systems use these pins, see the
appropriate module chapter.
Immediately after reset, all pins except the output-only pin (PTB2/BKGD/MS, PTB3/BLMS) are
configured as high-impedance general-purpose inputs with internal pullup devices disabled.
Table 2-1. Pin Availability by Package Pin-Count
Pin Number
(Package)
24 (QFN) 20 (SOIC)Port PinAlt 1Alt 2
14PTB0IRQTCLK
<-- Lowest Priority --> Highest
25PTB1RESET
36PTB2BKGDMS
47PTB3BLMS
MC9S08JS16 MCU Series Reference Manual, Rev. 4
26Freescale Semiconductor
Chapter 2 Pins and Connections
Table 2-1. Pin Availability by Package Pin-Count (continued)
Pin Number
(Package)
24 (QFN) 20 (SOIC)Port PinAlt 1Alt 2
58PTA0KBIP0TPMCH0
6—NC
79PTA1KBIP1MISO
810PTA2KBIP2MOSI
911PTA3KBIP3SPSCK
1012PTA4KBIP4SS
1113V
12—NC
1314V
1415USBDN
1516USBDP
1617V
1718PTA5KBIP5TPMCH1
18—NC
<-- Lowest Priority --> Highest
DD
SS
USB33
1919PTA6KBIP6RxD
2020PTA7KBIP7TxD
211PTB4XTAL
222PTB5EXTAL
233V
24—NC
SSOSC
NOTE
When an alternative function is first enabled, it is possible to get a spurious
edge to the module. User software must clear any associated flags before
interrupts are enabled. Table 2-1 illustrates the priority if multiple modules
are enabled. The highest priority module will have control over the pin.
Selecting a higher priority pin function with a lower priority function
already enabled can cause spurious edges to the lower priority module. All
modules that share a pin must be disabled before another module is enabled.
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Freescale Semiconductor27
Chapter 2 Pins and Connections
MC9S08JS16 MCU Series Reference Manual, Rev. 4
28Freescale Semiconductor
Chapter 3
Modes of Operation
3.1Introduction
The operating modes of the MC9S08JS16 series are described in this section. Entry into each mode, exit
from each mode, and functionality while in each mode are described.
3.2Features
•Active background mode for code development
•Wait mode:
— CPU halts operation to conserve power
— System clocks keep running
— Full voltage regulation is maintained
•Stop modes: CPU and bus clocks stopped
— Stop2: Partial power down of internal circuits; RAM and USB RAM contents retained
— Stop3: All internal circuits powered for fast recovery; RAM, USB RAM, and register contents
are retained
3.3Run Mode
Run is the normal operating mode for the MC9S08JS16 series. This mode is selected upon the MCU
exiting reset if the BKGD/MS pin is high. In this mode, the CPU executes code from internal memory with
execution beginning at the address fetched from memory at 0xFFFE:0xFFFF after reset.
3.4Active Background Mode
The active background mode functions are managed through the background debug controller (BDC) in
the HCS08 core. The BDC, together with the on-chip in-circuit emulator (ICE) debug module (DBG),
provides the means for analyzing MCU operation during software development.
Active background mode is entered in any of the following ways:
•When the BKGD/MS pin is low during POR or immediately after issuing a background debug
force reset (see Section 5.7.3, “System Background Debug Force Reset Register (SBDFR)”)
•When a BACKGROUND command is received through the BKGD pin
•When a BGND instruction is executed
•When encountering a BDC breakpoint
•When encountering a DBG breakpoint
MC9S08JS16 MCU Series Reference Manual, Rev. 4
Freescale Semiconductor29
Chapter 3 Modes of Operation
After entering active background mode, the CPU is held in a suspended state waiting for serial background
commands rather than executing instructions from the user application program.
Background commands are of two types:
•Non-intrusive commands, defined as commands that can be issued while the user program is
running. Non-intrusive commands can be issued through the BKGD pin while the MCU is in run
mode; non-intrusive commands can also be executed when the MCU is in the active background
mode. Non-intrusive commands include:
— Memory access commands
— Memory-access-with-status commands
— BDC register access commands
— The BACKGROUND command
•Active background commands, which can only be executed while the MCU is in active background
mode. Active background commands include commands to:
— Read or write CPU registers
— Trace one user program instruction at a time
— Leave active background mode to return to the user application program (GO)
The active background mode is used to program a bootloader or user application program into the flash
program memory before the MCU is operated in run mode for the first time. When the MC9S08JS16 series
devices are shipped from the Freescale factory, the flash program memory is erased by default unless
specifically noted, so there is no program that could be executed in run mode until the flash memory is
initially programmed. The active background mode can also be used to erase and reprogram the flash
memory after it has been previously programmed.
For additional information about the active background mode, refer to Chapter 17, “Development
Support.”
3.5Wait Mode
Wait mode is entered by executing a WAIT instruction. Upon execution of the WAIT instruction, the CPU
enters a low-power state in which it is not clocked. The I bit in the condition code register (CCR) is cleared
when the CPU enters wait mode, enabling interrupts. When an interrupt request occurs, the CPU exits wait
mode and resumes processing, beginning with the stacking operations leading to the interrupt service
routine.
While the MCU is in wait mode, there are some restrictions on which background debug commands can
be used. Only the BACKGROUND command and memory-access-with-status commands are available
while the MCU is in wait mode. The memory-access-with-status commands do not allow memory access,
but they report an error indicating that the MCU is in stop or wait mode. The BACKGROUND command
can be used to wake the MCU from wait mode and enter active background mode.
MC9S08JS16 MCU Series Reference Manual, Rev. 4
30Freescale Semiconductor
Loading...
+ 276 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.