2.2Kinetis L Series.............................................................................................................................................................35
2.4.5Security and Integrity modules....................................................................................................................42
2.5Orderable part numbers.................................................................................................................................................44
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.3
Page 4
Section numberTitlePage
3.2Module to Module Interconnects..................................................................................................................................45
3.2.1Module to Module Interconnects.................................................................................................................45
3.6Memories and Memory Interfaces................................................................................................................................72
5.5.1Clock divider values after reset....................................................................................................................119
7.4Entering and exiting power modes...............................................................................................................................143
7.5Module Operation in Low Power Modes......................................................................................................................143
8.3Security Interactions with other Modules.....................................................................................................................149
8.3.1Security Interactions with Debug.................................................................................................................150
9.2Debug Port Pin Descriptions.........................................................................................................................................151
9.3SWD status and control registers..................................................................................................................................152
9.3.1MDM-AP Control Register..........................................................................................................................153
9.3.2MDM-AP Status Register............................................................................................................................154
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
9.6Debug in Low Power Modes........................................................................................................................................157
10.4Module Signal Description Tables................................................................................................................................168
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
8Freescale Semiconductor, Inc.
Page 9
Section numberTitlePage
11.2.2Modes of operation......................................................................................................................................176
11.3External signal description............................................................................................................................................176
11.4Detailed signal description............................................................................................................................................177
11.5Memory map and register definition.............................................................................................................................177
11.5.1Pin Control Register n (PORTx_PCRn).......................................................................................................183
11.5.2Global Pin Control Low Register (PORTx_GPCLR)..................................................................................185
11.5.3Global Pin Control High Register (PORTx_GPCHR).................................................................................186
11.5.4Interrupt Status Flag Register (PORTx_ISFR)............................................................................................186
12.2Memory map and register definition.............................................................................................................................191
13.2Modes of operation.......................................................................................................................................................217
13.3Memory map and register descriptions.........................................................................................................................219
13.4.6Debug in low power modes.........................................................................................................................235
14.5Memory map and register descriptions.........................................................................................................................239
14.5.1Low Voltage Detect Status And Control 1 register (PMC_LVDSC1)........................................................240
14.5.2Low Voltage Detect Status And Control 2 register (PMC_LVDSC2)........................................................241
14.5.3Regulator Status And Control register (PMC_REGSC)..............................................................................242
15.1.2Modes of operation......................................................................................................................................246
15.2LLWU signal descriptions............................................................................................................................................248
17.1.3Modes of Operation.....................................................................................................................................273
17.2External Signal Description..........................................................................................................................................273
17.3Memory Map and Register Definition..........................................................................................................................274
19.1.3Modes of Operation.....................................................................................................................................303
19.2External Signal Description..........................................................................................................................................303
19.3Memory Map and Register Definition..........................................................................................................................304
19.3.3System ROM Memory Map.........................................................................................................................326
22.1.3Modes of operation......................................................................................................................................338
22.2External signal description............................................................................................................................................339
22.5.2Enabling and configuring sources................................................................................................................344
23.2DMA Transfer Overview..............................................................................................................................................351
23.3Memory Map and Registers..........................................................................................................................................352
23.4.1Transfer Requests (Cycle-Steal and Continuous Modes)............................................................................361
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
14Freescale Semiconductor, Inc.
Page 15
Section numberTitlePage
23.4.2Channel Initialization and Startup................................................................................................................361
23.4.3Dual-Address Data Transfer Mode..............................................................................................................363
23.4.4Advanced Data Transfer Controls: Auto-Alignment...................................................................................364
24.1.2Modes of Operation.....................................................................................................................................370
24.2External Signal Description..........................................................................................................................................371
24.4.1MCG mode state diagram............................................................................................................................384
24.4.2Low Power Bit Usage..................................................................................................................................388
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
24.4.5MCG Fixed frequency clock .......................................................................................................................389
24.4.7MCG Auto TRIM (ATM)............................................................................................................................390
24.5.2Using a 32.768 kHz reference......................................................................................................................393
25.2Features and Modes......................................................................................................................................................405
25.4OSC Signal Descriptions..............................................................................................................................................406
25.10 Low Power Modes Operation.......................................................................................................................................414
26.2Modes of operation.......................................................................................................................................................416
26.3External signal description............................................................................................................................................416
26.4Memory map and register descriptions.........................................................................................................................416
27.2External Signal Description..........................................................................................................................................422
27.3Memory Map and Registers..........................................................................................................................................422
27.3.1Flash Configuration Field Description.........................................................................................................422
27.4.3Flash Operation in Low-Power Modes........................................................................................................434
27.4.4Functional Modes of Operation...................................................................................................................434
27.4.5Flash Reads and Ignored Writes..................................................................................................................434
27.4.6Read While Write (RWW)...........................................................................................................................435
27.4.7Flash Program and Erase..............................................................................................................................435
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
28.2ADC Signal Descriptions..............................................................................................................................................459
28.2.1Analog Power (VDDA)...............................................................................................................................460
28.4.1Clock select and divide control....................................................................................................................483
28.4.3Hardware trigger and channel selects..........................................................................................................484
28.6.1External pins and routing.............................................................................................................................501
28.6.2Sources of error............................................................................................................................................503
29.5CMP, DAC and ANMUX diagram...............................................................................................................................511
29.8.3Startup and operation...................................................................................................................................530
30.5.1DAC data buffer operation...........................................................................................................................543
31.1.3Modes of Operation.....................................................................................................................................548
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
31.2TPM Signal Descriptions..............................................................................................................................................549
31.3Memory Map and Register Definition..........................................................................................................................550
31.3.1Status and Control (TPMx_SC)...................................................................................................................552
32.5Initialization and application information.....................................................................................................................582
32.6Example configuration for chained timers....................................................................................................................583
32.7Example configuration for the lifetime timer...............................................................................................................584
33.1.2Modes of operation......................................................................................................................................587
33.2LPTMR signal descriptions..........................................................................................................................................588
33.2.1Detailed signal descriptions.........................................................................................................................588
33.3Memory map and register definition.............................................................................................................................588
33.3.1Low Power Timer Control Status Register (LPTMRx_CSR)......................................................................589
33.3.2Low Power Timer Prescale Register (LPTMRx_PSR)................................................................................590
33.3.3Low Power Timer Compare Register (LPTMRx_CMR).............................................................................592
33.3.4Low Power Timer Counter Register (LPTMRx_CNR)...............................................................................592
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
33.4.1LPTMR power and reset..............................................................................................................................593
34.1.2Modes of operation......................................................................................................................................597
34.1.3RTC Signal Descriptions.............................................................................................................................597
34.2.1RTC Time Seconds Register (RTC_TSR)...................................................................................................599
34.2.2RTC Time Prescaler Register (RTC_TPR)..................................................................................................599
34.2.3RTC Time Alarm Register (RTC_TAR).....................................................................................................600
34.2.4RTC Time Compensation Register (RTC_TCR).........................................................................................600
34.2.5RTC Control Register (RTC_CR)................................................................................................................601
34.2.6RTC Status Register (RTC_SR)..................................................................................................................603
34.3.1Power, clocking, and reset...........................................................................................................................606
35.5OTG and Host mode operation.....................................................................................................................................644
35.7.1OTG dual role A device operation...............................................................................................................648
35.7.2OTG dual role B device operation...............................................................................................................649
36.1.3Modes of Operation.....................................................................................................................................653
36.2USB Voltage Regulator Module Signal Descriptions..................................................................................................653
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
37.1.2Modes of Operation.....................................................................................................................................656
37.2External Signal Description..........................................................................................................................................659
37.2.1SPSCK — SPI Serial Clock.........................................................................................................................659
37.2.2MOSI — Master Data Out, Slave Data In...................................................................................................660
37.2.3MISO — Master Data In, Slave Data Out...................................................................................................660
37.3Memory Map and Register Descriptions......................................................................................................................661
37.3.1SPI control register 1 (SPIx_C1)..................................................................................................................661
37.3.2SPI control register 2 (SPIx_C2)..................................................................................................................663
37.3.4SPI status register (SPIx_S).........................................................................................................................665
37.3.5SPI data register (SPIx_D)...........................................................................................................................667
37.3.6SPI match register (SPIx_M).......................................................................................................................668
37.4.4SPI Transmission by DMA..........................................................................................................................671
37.4.9Low Power Mode Options...........................................................................................................................679
38.1.2Modes of operation......................................................................................................................................688
38.2I2C signal descriptions..................................................................................................................................................689
38.3Memory map and register descriptions.........................................................................................................................689
38.3.2I2C Frequency Divider register (I2Cx_F)....................................................................................................691
38.3.3I2C Control Register 1 (I2Cx_C1)...............................................................................................................692
38.3.4I2C Status register (I2Cx_S)........................................................................................................................694
38.3.5I2C Data I/O register (I2Cx_D)...................................................................................................................695
38.3.6I2C Control Register 2 (I2Cx_C2)...............................................................................................................696
39.1.2Modes of operation......................................................................................................................................722
39.3.5Interrupts and status flags............................................................................................................................745
Chapter 40
Universal Asynchronous Receiver/Transmitter (UART1 and UART2)
40.1.2Modes of operation......................................................................................................................................747
40.3.4Interrupts and status flags............................................................................................................................767
41.1.2Modes of operation......................................................................................................................................771
41.1.3GPIO signal descriptions.............................................................................................................................772
41.2Memory map and register definition.............................................................................................................................773
41.2.1Port Data Output Register (GPIOx_PDOR).................................................................................................775
41.2.2Port Set Output Register (GPIOx_PSOR)....................................................................................................776
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.31
Page 32
Section numberTitlePage
42.1.2Modes of operation......................................................................................................................................785
42.2External signal description............................................................................................................................................787
42.4.3Enable TSI module.......................................................................................................................................797
42.4.4Software and hardware trigger.....................................................................................................................797
42.4.9End of scan...................................................................................................................................................799
42.4.11Wake up MCU from low power modes.......................................................................................................800
42.4.12DMA function support.................................................................................................................................800
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
32Freescale Semiconductor, Inc.
Page 33
Chapter 1
About This Document
1.1
Overview
1.1.1Purpose
This document describes the features, architecture, and programming model of the
Freescale KL25 microcontroller.
1.1.2Audience
This document is primarily for system architects and software application developers
who are using or considering using the KL25 microcontroller in a system.
1.2
Conventions
1.2.1Numbering systems
The following suffixes identify different numbering systems:
This suffixIdentifies a
bBinary number. For example, the binary equivalent of the
number 5 is written 101b. In some cases, binary numbers are
shown with the prefix 0b.
dDecimal number. Decimal numbers are followed by this suffix
only when the possibility of confusion exists. In general,
decimal numbers are shown without a suffix.
hHexadecimal number. For example, the hexadecimal
equivalent of the number 60 is written 3Ch. In some cases,
hexadecimal numbers are shown with the prefix 0x.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.33
Page 34
Conventions
1.2.2Typographic notation
The following typographic notation is used throughout this document:
ExampleDescription
placeholder, xItems in italics are placeholders for information that you provide. Italicized text is also used for
the titles of publications and for emphasis. Plain lowercase letters are also used as
placeholders for single letters and numbers.
code
SR[SCM]A mnemonic in brackets represents a named field in a register. This example refers to the
REVNO[6:4], XAD[7:0]Numbers in brackets and separated by a colon represent either:
Fixed-width type indicates text that must be typed exactly as shown. It is used for instruction
mnemonics, directives, symbols, subcommands, parameters, and operators. Fixed-width type
is also used for example code. Instruction mnemonics and directives in text and tables are
shown in all caps; for example, BSR.
Scaling Mode (SCM) field in the Status Register (SR).
• A subset of a register's named field
For example, REVNO[6:4] refers to bits 6–4 that are part of the COREREV field that
occupies bits 6–0 of the REVNO register.
• A continuous range of individual signals of a bus
For example, XAD[7:0] refers to signals 7–0 of the XAD bus.
1.2.3Special terms
The following terms have special meanings:
TermMeaning
assertedRefers to the state of a signal as follows:
• An active-high signal is asserted when high (1).
• An active-low signal is asserted when low (0).
deassertedRefers to the state of a signal as follows:
• An active-high signal is deasserted when low (0).
• An active-low signal is deasserted when high (1).
In some cases, deasserted signals are described as negated.
reservedRefers to a memory space, register, or field that is either
reserved for future use or for which, when written to, the
module or chip behavior is unpredictable.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
34Freescale Semiconductor, Inc.
Page 35
Chapter 2
Introduction
2.1Overview
This chapter provides an overview of the Kinetis L series of ARM® Cortex™-M0+
MCUs and KL25 product family. It also presents high-level descriptions of the modules
available on the devices covered by this document.
2.2Kinetis L Series
The Kinetis L series is the most scalable portfolio of ultra low-power, mixed-signal ARM
Cortex-M0+ MCUs in the industry. The portfolio includes 5 MCU families that offer a
broad range of memory, peripheral and package options. Kinetis L Series families share
common peripherals and pin-counts allowing developers to migrate easily within an
MCU family or between MCU families to take advantage of more memory or feature
integration. This scalability allows developers to standardize on the Kinetis L Series for
their end product platforms, maximising hardware and software reuse and reducing timeto-market.
Features common to all Kinetis L series families include:
• 12-bit digital-to-analog converters for all series except for KLx4/KLx2 family
• High-speed analog comparators
• Low-power touch sensing with wake-up on touch from reduced power states for all
series except for KLx4 family
• Powerful timers for a broad range of applications including motor control
• Low power focused serial communication interfaces such as low power UART, SPI,
I2C etc.
• Single power supply: 1.71V - 3.6V with multiple low-power modes support single
operation temperature: -40 ~ 105 °C (exclude CSP package)
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.35
Page 36
KL2x Family
KL1x Family
KL0x Family
KL3x Family
Family
Program
Flash
Packages Key Features
Low powerMixed signalUSBSegment LCD
KL4x Family
8-32KB
32-256KB
32-256KB
64-256KB
128-256KB
16-48pin
32-80pin
32-121pin
64-121pin
64-121pin
Kinetis L Series
Kinetis L series MCU families combine the latest low-power innovations with precision
mixed-signal capability and a broad range of communication, connectivity, and humanmachine interface peripherals. Each MCU family is supported by a market-leading
enablement bundle from Freescale and numerous ARM 3rd party ecosystem partners.
The KL0x family is the entry-point to the Kinetis L series and is pin compatible with the
8-bit S08PT family. The KL1x/2x/3x/4x families are compatible with each other and
their equivalent ARM Cortex-M4 Kinetis K series families - K10/20/30/40.
All Kinetis L series families include a powerful array of analog, communication and
timing and control peripherals with the level of feature integration increasing with flash
memory size and the pin count. Features within the Kinetis L series families include:
Figure 2-1. Kinetis L series families of MCU portfolio
• Core and Architecture:
• ARM Cortex-M0+ Core running up to 48 MHz with zero wait state execution
from memories
• Single-cycle access to I/O: Up to 50 percent faster than standard I/O,
improves reaction time to external events allowing bit banging and software
protocol emulation
• Two-stage pipeline: Reduced number of cycles per instruction (CPI),
enabling faster branch instruction and ISR entry, and reducing power
consumption
• Excellent code density vs. 8-bit and 16-bit MCUs - reduces flash size,
system cost and power consumption
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
36Freescale Semiconductor, Inc.
Page 37
Chapter 2 Introduction
• Optimized access to program memory: Accesses on alternate cycles reduces
power consumption
• 100 percent compatible with ARM Cortex-M0 and a subset ARM CortexM3/M4: Reuse existing compilers and debug tools
• Simplified architecture: 56 instructions and 17 registers enables easy
programming and efficient packaging of 8/16/32-bit data in memory
• Linear 4 GB address space removes the need for paging/banking, reducing
software complexity
• ARM third-party ecosystem support: Software and tools to help minimize
development time/cost
• Micro Trace Buffer: Lightweight trace solution allows fast bug identification and
correction
• BME: Bit manipulation engine reduces code size and cycles for bit oriented
operations to peripheral registers eliminating traditional methods where the core
would need to perform read-modify-write operations.
• Up to 4-channel DMA for peripheral and memory servicing with minimal CPU
intervention (feature not available on KL02 family)
• Ultra low-power:
• Extreme dynamic efficiency: 32-bit ARM Cortex-M0+ core combined with
Freescale 90 nm thin film storage flash technology delivers 50% energy savings
per Coremark versus the closest 8/16-bit competitive solution
• Multiple flexible low-power modes, including new operation clocking option
which reduces dynamic power by shutting off bus and system clocks for lowest
power core processing. Peripherals with an alternate asynchronous clock source
can continue operation.
• UART, SPI, I2C, ADC, DAC, TPM, LPT, and DMA support low-power mode
operation without waking up the core
• Memory:
• Scalable memory footprints from 8 KB flash / 1 KB SRAM to 256 KB flash / 32
KB SRAM
• Embedded 64 B cache memory for optimizing bus bandwidth and flash
execution performance (32 B cache on KL02 family)
• Mixed-signal analog:
• Fast, high precision 16-, or 12-bit ADC with optional differential pairs, 12-bit
DAC, high speed comparators. Powerful signal conditioning, conversion and
analysis capability with reduced system cost (12-bit DAC not available on KL02
family)
• Human Machine Interface (HMI):
• Optional capacitive Touch Sensing Interface with full low-power support and
minimal current adder when enabled
• Segment LCD controller
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.37
Page 38
KL25 Sub-Family Introduction
• Connectivity and Communications:
• Up to three UARTs, all UARTs support DMA transfers, and can trigger when
data on bus is detected, UART0 supports 4x to 32x over sampling ratio.
Asynchronous transmit and receive operation for operating in STOP/VLPS
modes.
• Up to two SPIs
• Up to two I2Cs
• Full-speed USB OTG controller with on-chip transceiver
• 5 V to 3.3 V USB on-chip regulator
• One I2S
• Reliability, Safety and Security:
• Internal watchdog with independent clock source
• Timing and Control:
• Powerful timer modules which support general purpose, PWM, and motor
control functions
• Periodic Interrupt Timer for RTOS task scheduler time base or trigger source for
ADC conversion and timer modules
• System:
• GPIO with pin interrupt functionality
• Wide operating voltage range from 1.71 V to 3.6 V with flash programmable
down to 1.71 V with fully functional flash and analog peripherals
• Ambient operating temperature ranges from -40 °C to 105 °C
2.3KL25 Sub-Family Introduction
The device is highly-integrated, market leading ultra low power 32-bit microcontroller
based on the enhanced Cortex-M0+ (CM0+) core platform. The family derivatives
feature:
• Core platform clock up to 48 MHz, bus clock up to 24 MHz
• Memory option is up to 128 KB Flash and 16 KB RAM
• Wide operating voltage ranges from 1.71V to 3.6V with full functional Flash
program/erase/read operations
• Multiple package options from 32-pin to 80-pin
• Ambient operating temperature ranges from –40 °C to 105 °C
The family acts as an ultra low power, cost effective microcontroller to provide
developers an appropriate entry-level 32-bit solution. The family is next generation MCU
solution for low cost, low power, high performance devices applications. It’s valuable for
cost-sensitive, portable applications requiring long battery life-time.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
38Freescale Semiconductor, Inc.
Page 39
Chapter 2 Introduction
2.4Module functional categories
The modules on this device are grouped into functional categories. The following
sections describe the modules assigned to each category in more detail.
Table 2-1. Module functional categories
Module categoryDescription
ARM Cortex-M0+ core• 32-bit MCU core from ARM’s Cortex-M class, 1.77 CoreMark®/MHz from
single-cycle access memories, 48 MHz CPU frequency
System• System integration module
• Power management and mode controllers
• Multiple power modes available based on run, wait, stop, and powerdown modes
• Miscellaneous control module
• Low-leakage wakeup unit
• Peripheral bridge
• Direct memory access (DMA) controller with multiplexer to increase available
DMA requests
• COP watchdog
Memories• Internal memories include:
• Up to 128 KB flash memory
• up to 16 KB SRAM
Clocks• Multiple clock generation options available from internally- and externally-
generated clocks
• MCG module with FLL and PLL for systems and CPU clock sources
• Low power 1 kHz RC oscillator for RTC and COP watchdog
• System oscillator to provide clock source for the MCU
Security• COP watchdog timer (COP)
Analog• 16-bit analog-to-digital converters with DMA supported and four muxed
differential pairs
• Comparator (CMP) with internal 6-bit digital-to-analog converter (DAC)
• 12-bit DAC with DMA support and two 16-bit data buffer
Timers• One 6-channel TPM
• Two 2-channel TPMs
• 2-channel periodic interrupt timer
• Real time clock
• Low-power timer
• System tick timer
Communications• Two 8-bit serial peripheral interface
• USB OTG controller with built-in FS/LS transceiver
• USB voltage regulator
• Two inter-integrated circuit (I2C) modules
• One low power UART module and two UART modules
Human-Machine Interfaces (HMI)• General purpose input/output controller
• Capacitive touch sense input interface enabled in hardware
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.39
Page 40
Module functional categories
2.4.1ARM® Cortex™-M0+ Core Modules
The following core modules are available on this device.
Table 2-2. Core modules
ModuleDescription
ARM® Cortex™-M0+The ARM® Cortex™-M0+ is the newest member of the Cortex M Series of
processors targeting microcontroller applications focused on very cost sensitive,
deterministic, interrupt driven environments. The Cortex M0+ processor is based
on the ARMv6 Architecture and Thumb®-2 ISA and is 100% instruction set
compatible with its predecessor, the Cortex-M0 core, and upward compatible to
Cortex-M3 and M4 cores.
NVICThe ARMv6-M exception model and nested-vectored interrupt controller (NVIC)
implement a relocatable vector table supporting many external interrupts, a single
non-maskable interrupt (NMI), and priority levels.
The NVIC replaces shadow registers with equivalent system and simplified
programmability. The NVIC contains the address of the function to execute for a
particular handler. The address is fetched via the instruction port allowing parallel
register stacking and look-up. The first sixteen entries are allocated to ARM
internal sources with the others mapping to MCU-defined interrupts.
AWICThe primary function of the Asynchronous Wake-up Interrupt Controller (AWIC) is
to detect asynchronous wake-up events in stop modes and signal to clock control
logic to resume system clocking. After clock restart, the NVIC observes the
pending interrupt and performs the normal interrupt or event processing.
Single-cycle I/O PortFor high-speed, single-cycle access to peripherals, the Cortex-M0+ processor
implements a dedicated single-cycle I/O port.
Debug interfacesMost of this device's debug is based on the ARM CoreSight™ architecture. One
debug interface is supported:
• Serial Wire Debug (SWD)
2.4.2System Modules
The following system modules are available on this device.
Table 2-3. System modules
ModuleDescription
System integration module (SIM)The SIM includes integration logic and several module configuration settings.
System mode controllerThe SMC provides control and protection on entry and exit to each power mode,
control for the Power management controller (PMC), and reset entry and exit for
the complete MCU.
Power management controller (PMC)The PMC provides the user with multiple power options. Multiple modes are
supported that allow the user to optimize power consumption for the level of
functionality needed. Includes power-on-reset (POR) and integrated low voltage
detect (LVD) with reset (brownout) capability and selectable LVD trip points.
Miscellaneous control module (MCM)The MCM includes integration logic and details.
Table continues on the next page...
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
40Freescale Semiconductor, Inc.
Page 41
Chapter 2 Introduction
Table 2-3. System modules (continued)
ModuleDescription
Crossbar switch (XBS)The XBS connects bus masters and bus slaves, allowing all bus masters to access
different bus slaves simultaneously and providing arbitration among the bus
masters when they access the same slave.
Low-leakage wakeup unit (LLWU)The LLWU module allows the device to wake from low leakage power modes (LLS
and VLLS) through various internal peripheral and external pin sources.
Peripheral bridgeThe peripheral bridge converts the crossbar switch interface to an interface to
access a majority of peripherals on the device.
DMA multiplexer (DMAMUX)The DMA multiplexer selects from many DMA requests down to 4 for the DMA
controller.
Direct memory access (DMA) controllerThe DMA controller provides programmable channels with transfer control
descriptors for data movement via dual-address transfers for 8-, 16- and 32-bit
data values.
Computer operating properly watchdog
(WDOG)
The WDOG monitors internal system operation and forces a reset in case of
failure. It can run from an independent 1 kHz low power oscillator with a
programmable refresh window to detect deviations in program flow or system
frequency.
2.4.3Memories and Memory Interfaces
The following memories and memory interfaces are available on this device.
Table 2-4. Memories and memory interfaces
ModuleDescription
Flash memoryProgram flash memory — up to 128 KB of the non-volatile flash memory that can
execute program code
Flash memory controllerManages the interface between the device and the on-chip flash memory.
SRAMUp to 16 KB internal system RAM.
2.4.4Clocks
The following clock modules are available on this device.
Table 2-5. Clock modules
ModuleDescription
Multipurpose Clock Generator (MCG)MCG module containing a frequency-locked-loop (FLL) and phase-locked-loop
(PLL) controlled by internal or external reference oscillator.
System oscillatorThe system oscillator, in conjunction with an external crystal or resonator,
generates a reference clock for the MCU.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.41
Page 42
Module functional categories
2.4.5Security and Integrity modules
The following security and integrity modules are available on this device:
Table 2-6. Security and integrity modules
ModuleDescription
Watchdog Timer (WDOG)Watchdog Timer keeps a watch on the system functioning and resets it in case of
its failure.
2.4.6Analog modules
The following analog modules are available on this device:
Table 2-7. Analog modules
ModuleDescription
Analog-to-digital converters (ADC)16-bit successive-approximation ADC module.
Analog comparatorsOne comparator that compares two analog input voltages across the full range of
the supply voltage and can trigger an ADC acquisition, TPM update, or CPU
interrupt.
6-bit digital-to-analog converters (DAC)64-tap resistor ladder network which provides a selectable voltage reference for
comparator.
12-bit digital-to-analog converters (DAC) Low-power general-purpose DAC, whose output can be placed on an external pin
or set as one of the inputs to the analog comparator or ADC.
2.4.7Timer modules
The following timer modules are available on this device:
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
• 16-bit free-running counter or modulo counter with counting be up or updown
• Six configurable channels for input capture, output compare, or edge-aligned
PWM mode
• Support the generation of an interrupt and/or DMA request per channel
• Support the generation of an interrupt and/or DMA request when the counter
overflows
• Support selectable trigger input to optionally reset or cause the counter to
start incrementing.
• Support the generation of hardware triggers when the counter overflows and
per channel
Periodic interrupt timers (PIT)• One general purpose interrupt timer
• Interrupt timers for triggering ADC conversions
• 32-bit counter resolution
• Clocked by bus clock frequency
• DMA support
Low power timer (LPTMR)• 16-bit time counter or pulse counter with compare
• Configurable clock source for prescaler/glitch filter
• Configurable input source for pulse counter
Real-time counter (RTC)• 16-bit up-counter
• 16-bit modulo match limit
• Software controllable periodic interrupt on match
• Software selectable clock sources for input to prescaler with programmable
16-bit prescaler
• XOSC 32.678 kHz nominal
• LPO (~1 kHz)
• External RTC_CLKIN
Chapter 2 Introduction
2.4.8Communication interfaces
The following communication interfaces are available on this device:
Table 2-9. Communication modules
ModuleDescription
USB OTG (low-/full-speed)USB 2.0 compliant module with support for host, device, and On-The-Go modes.
Includes an on-chip transceiver for full and low speeds.
USB voltage regulatorUp to 5 V regulator input typically provided by USB VBUS power with 3.3 V
regulated output that powers on-chip USB subsystem, capable of sourcing 120 mA
to external board components.
Serial peripheral interface (SPI)Synchronous serial bus for communication to an external device
Inter-integrated circuit (I2C)Allows communication between a number of devices. Also supports the System
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.47
Page 48
Core Modules
3.2.2Analog reference options
Several analog blocks have selectable reference voltages as shown in the below table.
These options allow analog peripherals to share or have separate analog references. Care
should be taken when selecting analog references to avoid cross talk noise.
This section summarizes how the module has been configured in the chip. Full
documentation for this module is provided by ARM and can be found at www.arm.com.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
48Freescale Semiconductor, Inc.
Page 49
ARM Cortex-M0+
Core
DebugInterrupts
Crossbar
switch
Chapter 3 Chip Configuration
Figure 3-1. Core configuration
Table 3-3. Reference links to related information
TopicRelated moduleReference
Full descriptionARM Cortex-M0+ core,
r0p0
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
System/instruction/data
bus module
DebugSerial Wire Debug
InterruptsNested Vectored
Crossbar switchCrossbar switch
(SWD)
Interrupt Controller
(NVIC)
Miscellaneous Control
Module (MCM)
ARM Cortex-M0+ Technical Reference Manual, r0p0
Debug
NVIC
MCM
3.3.1.1ARM Cortex M0+ Core
The ARM Cortex M0+ parameter settings are as follows:
Table 3-4. Table 3. ARM Cortex-M0+ parameter settings
Vector Table Offset RegisterVTOR1 = PresentImplements relocation of
exception vector table
WIC SupportWIC1 = PresentImplements WIC interface
WIC RequestsWICLINES34Exact number of wakeup
IRQs is 34
WatchpointsWPT2Implements 2 watchpoints
For details on the ARM Cortex-M0+ processor core see the ARM website: arm.com.
3.3.1.2Buses, Interconnects, and Interfaces
The ARM Cortex-M0+ core has two bus interfaces:
• single 32-bit AMBA-3 AHB-Lite system interface that provides connections to
peripherals and all system memory, which includes flash and RAM.
• single 32-bit I/O port bus interfacing to the GPIO with 1-cycle loads and stores.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
50Freescale Semiconductor, Inc.
Page 51
Nested Vectored
Interrupt Controller
(NVIC)
ARM Cortex-M0+
core
Interrupts
Module
Module
Module
PPB
Chapter 3 Chip Configuration
3.3.1.3System Tick Timer
The CLKSOURCE bit in SysTick Control and Status register selects either the core clock
(when CLKSOURCE = 1) or a divide-by-16 of the core clock (when CLKSOURCE = 0).
Because the timing reference is a variable frequency, the TENMS bit in the SysTick
Calibration Value Register is always zero.
3.3.1.4Debug Facilities
This device supports standard ARM 2-pin SWD debug port.
3.3.1.5Core Privilege Levels
The Core on this device is implemented with both Privileged and Unprivileged levels.
The ARM documentation uses different terms than this document to distinguish between
privilege levels.
This section summarizes how the module has been configured in the chip. Full
documentation for this module is provided by ARM and can be found at www.arm.com.
Figure 3-2. NVIC configuration
Table 3-5. Reference links to related information
TopicRelated moduleReference
Full descriptionNested Vectored
Interrupt Controller
(NVIC)
ARM Cortex-M0+ Technical Reference Manual
Freescale Semiconductor, Inc.51
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Table continues on the next page...
Page 52
Core Modules
Table 3-5. Reference links to related information (continued)
TopicRelated moduleReference
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Private Peripheral Bus
(PPB)
ARM Cortex-M0+ coreARM Cortex-M0+ core
3.3.2.1Interrupt priority levels
This device supports 4 priority levels for interrupts. Therefore, in the NVIC each source
in the IPR registers contains 2 bits. For example, IPR0 is shown below:
The non-maskable interrupt request to the NVIC is controlled by the external NMI signal.
The pin the NMI signal is multiplexed on, must be configured for the NMI function to
generate the non-maskable interrupt request.
3.3.2.3Interrupt channel assignments
The interrupt vector assignments are defined in the following table.
• Vector number — the value stored on the stack when an interrupt is serviced.
• IRQ number — non-core interrupt source count, which is the vector number minus
16.
The IRQ number is used within ARM's NVIC documentation.
Table 3-7. Interrupt vector assignments
AddressVectorIRQ
ARM Core System Handler Vectors
1
NVIC
IPR
register
number
Source moduleSource description
2
Table continues on the next page...
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
0x0000_00401600DMADMA channel 0 transfer complete and error
0x0000_00441710DMADMA channel 1 transfer complete and error
0x0000_00481820DMADMA channel 2 transfer complete and error
0x0000_004C1930DMADMA channel 3 transfer complete and error
0x0000_00502041——
0x0000_00542151FTFACommand complete and read collision
0x0000_00582261PMCLow-voltage detect, low-voltage warning
0x0000_005C2371LLWULow Leakage Wakeup
0x0000_00602482I2C0
0x0000_00642592I2C1
0x0000_006826102SPI0Single interrupt vector for all sources
0x0000_006C27112SPI1Single interrupt vector for all sources
0x0000_007028123UART0Status and error
0x0000_007429133UART1Status and error
0x0000_007830143UART2Status and error
0x0000_007C31153ADC0
0x0000_008032164CMP0
0x0000_008433174TPM0
0x0000_008834184TPM1
0x0000_008C35194TPM2
1
NVIC
IPR
register
number
Source moduleSource description
2
(PendableSrvReq)
Table continues on the next page...
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
0x0000_009036205RTCAlarm interrupt
0x0000_009437215RTCSeconds interrupt
0x0000_009838225PITSingle interrupt vector for all channels
0x0000_009C39235——
0x0000_00A040246USB OTG
0x0000_00A441256DAC0
0x0000_00A842266TSI0
0x0000_00AC43276MCG
0x0000_00B044287LPTMR0
0x0000_00B445297—
0x0000_00B846307Port control modulePin detect (Port A)
0x0000_00BC47317Port control modulePin detect ( Port D )
1. Indicates the NVIC's interrupt source number.
2. Indicates the NVIC's IPR register number used for this IRQ. The equation to calculate this value is: IRQ div 4
1
NVIC
IPR
register
number
Source moduleSource description
2
3.3.2.3.1Determining the bitfield and register location for configuring a
particular interrupt
Suppose you need to configure the SPI0 interrupt. The following table is an excerpt of the
SPI0 row from Interrupt priority levels.
Table 3-8. Interrupt vector assignments
AddressVectorIRQ
0x0000_006826102SPI0Single interrupt vector for all sources
1. Indicates the NVIC's interrupt source number.
2. Indicates the NVIC's IPR register number used for this IRQ. The equation to calculate this value is: IRQ div 4.
1
NVIC IPR
register
number
Source moduleSource description
2
• The NVIC registers you would use to configure the interrupt are:
• NVICIPR2
• To determine the particular IRQ's bitfield location within these particular registers:
This section summarizes how the module has been configured in the chip. Full
documentation for this module is provided by ARM and can be found at www.arm.com.
The device uses the following internal and external inputs to the AWIC module.
Table 3-10. AWIC stop wake-up sources
Wake-up sourceDescription
Available system resetsRESET pin when LPO is its clock source
Low-voltage detectMode Controller
Low-voltage warningMode Controller
Pin interruptsPort control module - Any enabled pin interrupt is capable of waking the system
ADCThe ADC is functional when using internal clock source
Table continues on the next page...
Freescale Semiconductor, Inc.55
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 56
Register
access
Peripheral
bridge
System integration
module (SIM)
System Modules
Table 3-10. AWIC stop wake-up sources (continued)
Wake-up sourceDescription
CMP0Interrupt in normal or trigger mode
I2CxAddress match wakeup
UART0Any interrupt provided clock remains enabled
UART1 and UART2Active edge on RXD
RTCAlarm or seconds interrupt
TSIAny interrupt
NMINMI pin
TPMxAny interrupt provided clock remains enabled
LPTMRAny interrupt provided clock remains enabled
SPISlave mode interrupt
3.4
System Modules
3.4.1SIM Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-4. SIM configuration
Table 3-11. Reference links to related information
TopicRelated moduleReference
Full descriptionSIMSIM
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
56Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 57
Power Management
Controller (PMC)
Register
access
Peripheral
bridge
System Mode
Controller (SMC)
Resets
Chapter 3 Chip Configuration
3.4.2System Mode Controller (SMC) Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-5. System Mode Controller configuration
Table 3-12. Reference links to related information
TopicRelated moduleReference
Full descriptionSystem Mode
Controller (SMC)
System memory mapSystem memory map
Power managementPower management
Power management
controller (PMC)
Low-Leakage Wakeup
Unit (LLWU)
Reset Control Module
(RCM)
SMC
PMC
LLWU
Reset
3.4.2.1VLLS2 not supported
VLLS2 power mode is not supported on this device.
3.4.3PMC Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Freescale Semiconductor, Inc.57
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 58
Register access
Power Management
Controller (PMC)
Module
signals
Peripheral
bridge
Module
signals
System Mode
Controller (SMC)
Low-Leakage
Wakeup Unit
System Modules
Figure 3-6. PMC configuration
Table 3-13. Reference links to related information
TopicRelated moduleReference
Full descriptionPMCPMC
System memory mapSystem memory map
Power managementPower management
Full descriptionSystem Mode
Controller (SMC)
Low-Leakage Wakeup
Unit (LLWU)
Reset Control Module
(RCM)
System Mode Controller
LLWU
Reset
3.4.4Low-Leakage Wake-up Unit (LLWU) Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
58Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 59
Low-Leakage Wake-up
Unit (LLWU)
Power Management
Controller (PMC)
Peripheral
bridge 0
Register
access
Wake-up
requests
Module
Module
Chapter 3 Chip Configuration
Figure 3-7. Low-Leakage Wake-up Unit configuration
Table 3-14. Reference links to related information
TopicRelated moduleReference
Full descriptionLLWULLWU
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management chapter
Power Management
Controller (PMC)
System Mode
Controller (SMC)
Wake-up requestsLLWU wake-up sources
Power Management Controller (PMC)
System Mode Controller
3.4.4.1LLWU interrupt
3.4.4.2Wake-up Sources
The device uses the following internal peripheral and external pin inputs as wakeup
sources to the LLWU module. LLWU_Px are external pin inputs, and LLWU_M0IFM7IF are connections to the internal peripheral interrupt flags.
Freescale Semiconductor, Inc.59
Do not mask the LLWU interrupt when in LLS mode. Masking
the interrupt prevents the device from exiting stop mode when a
wakeup is detected.
In addition to the LLWU wakeup sources, the device also
wakes from low power modes when NMI or RESET pins are
enabled and the respective pin is asserted.
NOTE
NOTE
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-8. MCM configuration
Table 3-16. Reference links to related information
TopicRelated moduleReference
Full descriptionMiscellaneous control
module (MCM)
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Private Peripheral Bus
(PPB)
ARM Cortex-M0+ coreARM Cortex-M0+ core
MCM
60Freescale Semiconductor, Inc.
Table continues on the next page...
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 61
Crossbar Switch
Slave Modules
Master Modules
M2
M0
S0
S2
ARM core
unified bus
DMA
Flash
controller
S1
SRAML
BME
Peripheral
bridge 0
GPIO
controller
SRAMU
Peripherals
USB
M3
Chapter 3 Chip Configuration
Table 3-16. Reference links to related information (continued)
TopicRelated moduleReference
TransferFlash memory
Flash memory controller
controller
3.4.6Crossbar-Light Switch Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Freescale Semiconductor, Inc.61
Figure 3-9. Crossbar-Light switch integration
Table 3-17. Reference links to related information
TopicRelated moduleReference
Full descriptionCrossbar switchCrossbar Switch
System memory mapSystem memory map
ClockingClock Distribution
Crossbar switch master ARM Cortex-M0+ coreARM Cortex-M0+ core
Crossbar switch masterDMA controllerDMA controller
Crossbar switch masterUSB FS/LSUSB FS/LS
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
62Freescale Semiconductor, Inc.
Page 63
Peripherals
Transfers
AIPS-Lite
peripheral bridge
Transfers
Crossbar switch
Figure 3-10. Peripheral bridge configuration
Table 3-18. Reference links to related information
TopicRelated moduleReference
Full descriptionPeripheral bridge
(AIPS-Lite)
System memory mapSystem memory map
ClockingClock Distribution
Crossbar switchCrossbar switchCrossbar switch
Peripheral bridge (AIPS-Lite)
3.4.7.1Number of peripheral bridges
Chapter 3 Chip Configuration
This device contains one peripheral bridge.
3.4.7.2Memory maps
The peripheral bridges are used to access the registers of most of the modules on this
device. See AIPS0 Memory Map for the memory slot assignment for each module.
3.4.8DMA request multiplexer configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Freescale Semiconductor, Inc.63
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Table 3-19. Reference links to related information
TopicRelated moduleReference
Full descriptionDMA request
multiplexer
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Channel requestDMA controllerDMA Controller
RequestsDMA request sources
DMA Mux
3.4.8.1DMA MUX Request Sources
This device includes a DMA request mux that allows up to 63 DMA request signals to be
mapped to any of the 4 DMA channels. Because of the mux there is no hard correlation
between any of the DMA request sources and a specific DMA channel. Some of the
modules support Asynchronous DMA operation as indicated by the last column in the
following DMA source assignment table.
Table 3-20. DMA request sources - MUX 0
Source
number
0—Channel disabled
1ReservedNot used
2UART0ReceiveYes
3UART0TransmitYes
4UART1Receive
5UART1Transmit
6UART2Receive
7UART2Transmit
64Freescale Semiconductor, Inc.
Source moduleSource descriptionAsync DMA
1
Table continues on the next page...
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
1. Configuring a DMA channel to select source 0 or any of the reserved sources disables that DMA channel.
3.4.8.2DMA transfers via PIT trigger
The PIT module can trigger a DMA transfer on the first two DMA channels. The
assignments are detailed at PIT/DMA Periodic Trigger Assignments .
3.4.9DMA Controller Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
66Freescale Semiconductor, Inc.
Page 67
DMA Controller
Crossbar switch
Requests
Peripheral
bridge 0
Register
access
Transfers
DMA Multiplexer
WDOG
Mode Controller
Peripheral
bridge 0
Register
access
Chapter 3 Chip Configuration
Figure 3-12. DMA Controller configuration
Table 3-21. Reference links to related information
This section summarizes how the module has been configured in the chip.
Figure 3-13. COP watchdog configuration
Table 3-22. Reference links to related information
TopicRelated moduleReference
ClockingClock distribution
Power managementPower management
Table continues on the next page...
Freescale Semiconductor, Inc.67
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 68
System Modules
Table 3-22. Reference links to related information (continued)
TopicRelated moduleReference
Programming modelSystem Integration
Module (SIM)
SIM
3.4.10.1COP clocks
The two clock inputs for the COP are the 1 kHz clock and the bus clock.
3.4.10.2COP watchdog operation
The COP watchdog is intended to force a system reset when the application software fails
to execute as expected. To prevent a system reset from the COP timer (when it is
enabled), application software must reset the COP counter periodically. If the application
program gets lost and fails to reset the COP counter before it times out, a system reset is
generated to force the system back to a known starting point.
After any reset, the COP watchdog is enabled. If the COP watchdog is not used in an
application, it can be disabled by clearing COPCTRL[COPT] in the SIM.
The COP counter is reset by writing 0x55 and 0xAA (in that order) to the address of the
SIM's Service COP (SRVCOP) register during the selected timeout period. Writes do not
affect the data in the SRVCOP register. As soon as the write sequence is complete, the
COP timeout period is restarted. If the program fails to perform this restart during the
timeout period, the microcontroller resets. Also, if any value other than 0x55 or 0xAA is
written to the SRVCOP register, the microcontroller immediately resets.
The SIM's COPCTRL[COPCLKS] field selects the clock source used for the COP timer.
The clock source options are either the bus clock or an internal 1 kHz clock source. With
each clock source, there are three associated timeouts controlled by COPCTRL[COPT].
The following table summarizes the control functions of the COPCLKS and COPT bits.
The COP watchdog defaults to operation from the 1 kHz clock source and the longest
timeout for that clock source (210 cycles).
Table 3-23. COP configuration options
Control BitsClock SourceCOP Window Opens
COPCTRL[COPCLKS]COPCTRL[COPT]
N/A00N/AN/ACOP is disabled
0011 kHzN/A25 cycles (32 ms)
(COPCTRL[COPW]=1)
COP Overflow Count
Table continues on the next page...
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
After the bus clock source is selected, windowed COP operation is available by setting
COPCTRL[COPW] in the SIM. In this mode, writes to the SRVCOP register to clear the
COP timer must occur in the last 25% of the selected timeout period. A premature write
immediately resets the chip. When the 1 kHz clock source is selected, windowed COP
operation is not available.
The COP counter is initialized by the first writes to the SIM's COPCTRL register and
after any system reset. Subsequent writes to the SIM's COPCTRL register have no effect
on COP operation. Even if an application uses the reset default settings of the COPT,
COPCLKS, and COPW bits, the user should write to the write-once COPCTRL register
during reset initialization to lock in the settings. This approach prevents accidental
changes if the application program becomes lost.
The write to the SRVCOP register that services (clears) the COP counter should not be
placed in an interrupt service routine (ISR) because the ISR could continue to be
executed periodically even if the main application program fails.
If the bus clock source is selected, the COP counter does not increment while the
microcontroller is in debug mode or while the system is in stop (including VLPS or LLS)
mode. The COP counter resumes when the microcontroller exits debug mode or stop
mode.
If the 1 kHz clock source is selected, the COP counter is re-initialized to zero upon entry
to either debug mode or stop (including VLPS or LLS) mode. The counter begins from
zero upon exit from debug mode or stop mode.
Regardless of the clock selected, the COP is disabled when the chip enters a VLLSx
mode. Upon a reset that wakes the chip from the VLLSx mode, the COP is re-initialized
and enabled as for any reset.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.69
Page 70
Register
access
Peripheral
bridge
Multipurpose Clock
Generator (MCG)
System
oscillator
System integration
module (SIM)
Clock Modules
3.4.10.3Clock Gating
This family of devices includes clock gating control for each peripheral, that is, the clock
to each peripheral can explicitly be gated on or off, using clock-gate control bits in the
SIM module.
3.5
Clock Modules
3.5.1MCG Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-14. MCG configuration
Table 3-24. Reference links to related information
TopicRelated moduleReference
Full descriptionMCGMCG
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Signal multiplexingPort controlSignal multiplexing
3.5.1.1MCG FLL modes
On L-series devices the MCGFLLCLK frequency is limited to 48 MHz max. The DCO is
limited to the two lowest range settings (MCG_C4[DRST_DRS] must be set to either
0b00 or 0b01).
70Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 71
Signal multiplexing
Register
access
Peripheral
bridge
System oscillator
MCG
Module signals
RTC
Chapter 3 Chip Configuration
3.5.2OSC Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-15. OSC configuration
Table 3-25. Reference links to related information
TopicRelated moduleReference
Full descriptionOSCOSC
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Signal multiplexingPort controlSignal multiplexing
Full descriptionMCGMCG
3.5.2.1OSC modes of operation with MCG and RTC
The most common method of controlling the OSC block is through MCG clock source
selection MCG_C1[CLKS] and the MCG_C2 register bits to configure the oscillator
frequency range, gain-mode, and for crystal or external clock operation. The OSC_CR
also provides control for enabling the OSC and configuring internal load capacitors for
the EXTAL and XTAL pins. See the OSC and MCG chapters for more details.
The RTC_CR[OSCE] bit has overriding control over the MCG and OSC_CR enable
functions. When RTC_CR[OSCE] is set, the OSC is configured for low frequency, low
power and the RTC_CR[SCxP] bits override the OSC_CR[SCxP] bits to control the
internal capacitance configuration. See the RTC chapter for more details.
Freescale Semiconductor, Inc.71
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 72
Register
access
Flash memory
Transfers
Flash memory
controller
Peripheral bus
controller 0
Memories and Memory Interfaces
3.6
Memories and Memory Interfaces
3.6.1Flash Memory Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-16. Flash memory configuration
Table 3-26. Reference links to related information
TopicRelated moduleReference
Full descriptionFlash memoryFlash memory
System memory mapSystem memory map
ClockingClock Distribution
TransfersFlash memory
controller
Register accessPeripheral bridgePeripheral bridge
Flash memory controller
3.6.1.1Flash Memory Sizes
The devices covered in this document contain 1 program flash block consisting of 1 KB
sectors.
The amounts of flash memory for the devices covered in this document are:
Table 3-27. KL25 flash memory size
DeviceProgram flash (KB)Block 0 (P-Flash) address range
The flash memory and the flash registers are located at different base addresses as shown
in the following figure. The base address for each is specified in System memory map.
Figure 3-17. Flash memory map
The on-chip Flash is implemented in a portion of the allocated Flash range to form a
contiguous block in the memory map beginning at address 0x0000_0000. See Flash
Memory Sizes for details of supported ranges.
Accesses to the flash memory ranges outside the amount of Flash on the device causes
the bus cycle to be terminated with an error followed by the appropriate response in the
requesting bus master. Read collision events in which flash memory is accessed while a
flash memory resource is being manipulated by a flash command also generates a bus
error response.
3.6.1.3Flash Security
How flash security is implemented on this device is described in Chip Security.
Freescale Semiconductor, Inc.73
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 74
Memories and Memory Interfaces
3.6.1.4Flash Modes
The flash memory chapter defines two modes of operation - NVM normal and NVM
special modes. On this device, The flash memory only operates in NVM normal mode.
All references to NVM special mode should be ignored.
3.6.1.5Erase All Flash Contents
In addition to software, the entire flash memory may be erased external to the flash
memory via the SW-DP debug port by setting MDM-AP CONTROL[0]. MDM-AP
STATUS[0] is set to indicate the mass erase command has been accepted. MDM-AP
STATUS[0] is cleared when the mass erase completes.
3.6.1.6FTFA_FOPT Register
The flash memory's FTFA_FOPT register allows the user to customize the operation of
the MCU at boot time. See FOPT boot options for details of its definition.
3.6.2Flash Memory Controller Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
See MCM_PLACR register description for details on the reset configuration of the FMC.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Table 3-28. Reference links to related information
TopicRelated moduleReference
Full descriptionFlash memory
controller
System memory mapSystem memory map
ClockingClock Distribution
TransfersFlash memoryFlash memory
TransfersCrossbar switchCrossbar Switch
Register accessMCMMCM
Flash memory controller
3.6.3SRAM Configuration
This section summarizes how the module has been configured in the chip.
Figure 3-19. SRAM configuration
Table 3-29. Reference links to related information
TopicRelated moduleReference
Full descriptionSRAMSRAM
System memory mapSystem memory map
ClockingClock Distribution
ARM Cortex-M0+ coreARM Cortex-M0+ core
Freescale Semiconductor, Inc.75
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 76
Memories and Memory Interfaces
3.6.3.1SRAM Sizes
This device contains SRAM which could be accessed by bus masters through the crossbar switch. The amount of SRAM for the devices covered in this document is shown in
the following table.
Table 3-30. KL25 SRAM memory size
DeviceSRAM (KB)
MKL25Z32VFM44
MKL25Z64VFM48
MKL25Z128VFM416
MKL25Z32VFT44
MKL25Z64VFT48
MKL25Z128VFT416
MKL25Z32VLH44
MKL25Z64VLH48
MKL25Z128VLH416
MKL25Z32VLK44
MKL25Z64VLK48
MKL25Z128VLK416
3.6.3.2SRAM Ranges
The on-chip SRAM is split into two ranges, 1/4 is allocated SRAM_L and 3/4 is allocated
to SRAM_U.
The on-chip RAM is implemented such that the SRAM_L and SRAM_U ranges form a
contiguous block in the memory map. As such:
• SRAM_L is anchored to 0x1FFF_FFFF and occupies the space before this ending
address.
• SRAM_U is anchored to 0x2000_0000 and occupies the space after this beginning
address.
Valid address ranges for SRAM_L and SRAM_U are then defined as:
• SRAM_L = [0x2000_0000–(SRAM_size/4)] to 0x1FFF_FFFF
• SRAM_U = 0x2000_0000 to [0x2000_0000+(SRAM_size*(3/4))-1]
This is illustrated in the following figure.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
76Freescale Semiconductor, Inc.
Page 77
SRAM_U
0x2000_0000
SRAM size *(1/4)
SRAM_L
0x1FFF_FFFF
SRAM size * (3/4)
0x2000_0000 – SRAM_size/4
0x2000_0000 + SRAM_size(3/4) - 1
Chapter 3 Chip Configuration
For example, for a device containing 16 KB of SRAM the ranges are:
• SRAM_L: 0x1FFF_F000 – 0x1FFF_FFFF
• SRAM_U: 0x2000_0000 – 0x2000_2FFF
3.6.3.3SRAM retention in low power modes
The SRAM is retained down to VLLS3 mode. In VLLS1 and VLLS0 no SRAM is
retained.
3.7
Analog
3.7.116-bit SAR ADC Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-20. SRAM blocks memory map
Freescale Semiconductor, Inc.77
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 78
Signal multiplexing
Module signals
Register
access
16-bit SAR ADC
Peripheral bus
controller 0
Other peripherals
Analog
Figure 3-21. 16-bit SAR ADC configuration
Table 3-31. Reference links to related information
TopicRelated moduleReference
Full description16-bit SAR ADC16-bit SAR ADC
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Signal multiplexingPort controlSignal multiplexing
3.7.1.1ADC Instantiation Information
This device contains one 16 -bit successive approximation ADC with up to 16-channel.
The ADC supports both software and hardware triggers. The hardware trigger sources are
listed in the Module-to-Module section.
The number of ADC channels present on the device is determined by the pinout of the
specific device package and is shown in the following table.
Table 3-32. Number of KL25 ADC channels
DeviceNumber of ADC channels
MKL25Z32VFM47
MKL25Z64VFM47
MKL25Z128VFM47
MKL25Z32VFT413
MKL25Z64VFT413
MKL25Z128VFT413
MKL25Z32VLH414
MKL25Z64VLH414
MKL25Z128VLH414
MKL25Z32VLK414
Table continues on the next page...
78Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 79
Chapter 3 Chip Configuration
Table 3-32. Number of KL25 ADC channels (continued)
DeviceNumber of ADC channels
MKL25Z64VLK414
MKL25Z128VLK414
3.7.1.2DMA Support on ADC
Applications may require continuous sampling of the ADC that may have considerable
load on the CPU. The ADC supports DMA request functionality for higher performance
when the ADC is sampled at a very high rate. The ADC can trigger the DMA (via DMA
req) on conversion completion.
3.7.1.3ADC0 Connections/Channel Assignment
NOTE
As indicated by the following sections, each ADCx_DPx input
and certain ADCx_DMx inputs may operate as single-ended
ADC channels in single-ended mode.
3.7.1.3.1ADC0 Channel Assignment
ADC Channel
(SC1n[ADCH])
00000DAD0ADC0_DP0 and ADC0_DM0ADC0_DP0/ADC0_SE0
00001DAD1ADC0_DP1 and ADC0_DM1ADC0_DP1/ADC0_SE1
00010DAD2ADC0_DP2 and ADC0_DM2ADC0_DP2/ADC0_SE2
00011DAD3ADC0_DP3 and ADC0_DM3ADC0_DP3/ADC0_SE3
1. ADCx_CFG2[MUXSEL] bit selects between ADCx_SEn channels a and b. Refer to MUXSEL description in ADC chapter
for details.
2. This is the PMC bandgap 1V reference voltage. Prior to reading from this ADC channel, ensure that you enable the
bandgap buffer by setting the PMC_REGSC[BGBE] bit. Refer to the device data sheet for the bandgap voltage (VBG)
specification.
3.7.1.4ADC Analog Supply and Reference Connections
This device includes dedicated VDDA and VSSA pins.
This device contains separate VREFH and VREFL pins on 48-pin and higher devices.
These pins are internally connected to VDDA and VSSA respectively, on 32-pin devices.
3.7.1.5ADC Reference Options
The ADC supports the following references:
• VREFH/VREFL - connected as the primary reference option
• VDDA - connected as the V
reference option
ALT
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
80Freescale Semiconductor, Inc.
Page 81
Signal multiplexing
Module signals
Register
access
CMP
Peripheral
bridge 0
Other peripherals
Chapter 3 Chip Configuration
3.7.2CMP Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-22. CMP configuration
Table 3-33. Reference links to related information
TopicRelated moduleReference
Full descriptionComparator (CMP)Comparator
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Signal multiplexingPort controlSignal multiplexing
3.7.2.1CMP Instantiation Information
The device includes one high speed comparator and two 8-input multiplexors for both the
inverting and non-inverting inputs of the comparator. Each CMP input channel connects
to both muxes. Two of the channels are connected to internal sources, leaving resources
to support up to 6 input pins. See the channel assignment table for a summary of CMP
input connections for this device.
The CMP also includes one 6-bit DAC with a 64-tap resistor ladder network, which
provides a selectable voltage reference for applications where voltage reference is needed
for internal connection to the CMP.
The CMP can be optionally on in all modes except VLLS0.
The CMP has several module to module interconnects in order to facilitate ADC
triggering, TPM triggering and UART IR interfaces. For complete details on the CMP
module interconnects please refer to the Module-to-Module section.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.81
Page 82
Analog
The CMP does not support window compare function and CMP_CR1[WE] must always
be written to 0. The sample function has limited functionality since the SAMPLE input to
the block is not connected to a valid input. Usage of sample operation is limited to a
divided version of the bus clock (CMP_CR1[SE] = 0).
Due to the pin number limitation, the CMP pass through mode is not supported by this
device, so the CMPx_MUXCR[PSTM] must be left as 0.
3.7.2.2CMP input connections
The following table shows the fixed internal connections to the CMP.
1. This is the PMC bandgap 1V reference voltage. Prior to using as CMP input, ensure that you enable the bandgap buffer by
setting the PMC_REGSC[BGBE] bit. Refer to the device data sheet for the bandgap voltage (VBG) specification.
3.7.2.3CMP external references
The 6-bit DAC sub-block supports selection of two references. For this device, the
references are connected as follows:
• VREFH - V
input. When using VREFH, any ADC conversion using this same
in1
reference at the same time is negatively impacted.
• VDD - V
in2
input
3.7.2.4CMP trigger mode
The CMP and 6-bit DAC sub-block supports trigger mode operation when the
CMP_CR1[TRIGM] is set. When trigger mode is enabled, the trigger event will initiate a
compare sequence that must first enable the CMP and DAC prior to performing a CMP
operation and capturing the output. In this device, control for this two staged sequencing
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
82Freescale Semiconductor, Inc.
Page 83
Signal multiplexing
Module signals
Register
access
12-bit DAC
Peripheral bus
controller 0
Other peripherals
Chapter 3 Chip Configuration
is provided from the LPTMR. The LPTMR triggering output is always enabled when the
LPTMR is enabled. The first signal is supplied to enable the CMP and DAC and is
asserted at the same time as the TCF flag is set. The delay to the second signal that
triggers the CMP to capture the result of the compare operation is dependent on the
LPTMR configuration. In Time Counter mode with prescaler enabled, the delay is 1/2
Prescaler output period. In Time Counter mode with prescaler bypassed, the delay is 1/2
Prescaler clock period.
The delay between the first signal from LPTMR and the second signal from LPTMR
must be greater than the Analog comparator initialization delay as defined in the device
datasheet.
3.7.312-bit DAC Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-23. 12-bit DAC configuration
Table 3-35. Reference links to related information
TopicRelated moduleReference
Full description12-bit DAC12-bit DAC
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Signal multiplexingPort controlSignal multiplexing
3.7.3.112-bit DAC Instantiation Information
This device contains one 12-bit digital-to-analog converter (DAC) with programmable
reference generator output. The DAC includes a two word FIFO for DMA support.
Freescale Semiconductor, Inc.83
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 84
Timers
3.7.3.212-bit DAC Output
The output of the DAC can be placed on an external pin or selected as an input to the
analog comparator or ADC.
3.7.3.312-bit DAC Analog Supply and Reference Connections
This device includes dedicated VDDA and VSSA pins.
This device contains separate VREFH and VREFL pins on 48-pin and higher devices.
These pins are internally connected to VDDA and VSSA respectively, on 32-pin devices.
3.7.3.412-bit DAC Reference
For this device VREFH and VDDA are selectable as the DAC reference. VREFH is
connected to the DACREF_1 input and VDDA is connected to the DACREF_2 input.
Use DACx_C0[DACRFS] control bit to select between these two options.
Be aware that if the DAC and ADC use the same reference simultaneously, some
degradation of ADC accuracy is to be expected due to DAC switching.
3.8
Timers
3.8.1Timer/PWM Module Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
84Freescale Semiconductor, Inc.
Page 85
Signal multiplexing
Module signals
Register
access
TPM
Peripheral bus
controller 0
Other peripherals
Chapter 3 Chip Configuration
Figure 3-24. TPM configuration
Table 3-36. Reference links to related information
TopicRelated moduleReference
Full descriptionTimer/PWM ModuleTimer/PWM Module
System memory mapSystem memory map
ClockingClock distribution
Power managementPower management
Signal multiplexingPort controlSignal multiplexing
3.8.1.1TPM Instantiation Information
This device contains three Low Power TPM modules (TPM). All TPM modules in the
device only are configured as basic TPM function, and no quadrature decoder function
and all can be functional in Stop/VLPS mode. The clock source is either external or
internal in Stop/VLPS mode.
The following table shows how these modules are configured.
Table 3-37. TPM configuration
TPM instanceNumber of channelsFeatures/usage
TPM06Basic TPM,functional in Stop/VLPS mode
TPM12Basic TPM,functional in Stop/VLPS mode
TPM22Basic TPM,functional in Stop/VLPS mode
There are several connections to and from the TPMs in order to facilitate customer use
cases. For complete details on the TPM module interconnects please refer to the Module-
to-Module section.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.85
Page 86
Timers
3.8.1.2Clock Options
The TPM blocks are clocked from a single TPM clock that can be selected from
OSCERCLK, MCGIRCLK, MCGPLLCLK/2, or MCGFLLCLK. The selected source is
controlled by SIM_SOPT2[TPMSRC] and SIM_SOPT2[PLLFLLSEL]control registers.
Each TPM also supports an external clock mode (TPM_SC[CMOD]=1x) in which the
counter increments after a synchronized (to the selected TPM clock source) rising edge
detect of an external clock input. The available external clock (either TPM_CLKIN0 or
TPM_CLKIN1) is selected by SIM_SOPT4[TPMxCLKSEL] control register. To
guarantee valid operation the selected external clock must be less than half the frequency
of the selected TPM clock source.
3.8.1.3Trigger Options
Each TPM has a selectable trigger input source controlled by the
TPMx_CONF[TRGSEL] field to use for starting the counter and/or reloading the
counter. The options available are shown in the following table.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
86Freescale Semiconductor, Inc.
Page 87
Register
access
Peripheral
bridge
Periodic interrupt
timer
Chapter 3 Chip Configuration
3.8.1.4Global Timebase
Each TPM has a global timebase feature controlled by the TPMx_CONF[GTBEEN] bit.
TPM1 is configured as the global time when this option is enabled.
3.8.1.5TPM Interrupts
The TPM has multiple sources of interrupt. However, these sources are OR'd together to
generate a single interrupt request to the interrupt controller. When an TPM interrupt
occurs, read the TPM status registers to determine the exact interrupt source.
3.8.2PIT Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-25. PIT configuration
Table 3-39. Reference links to related information
TopicRelated moduleReference
Full descriptionPITPIT
System memory mapSystem memory map
ClockingClock Distribution
Power managementPower management
3.8.2.1PIT/DMA Periodic Trigger Assignments
The PIT generates periodic trigger events to the DMA channel mux as shown in the table
below.
Freescale Semiconductor, Inc.87
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 88
Signal multiplexing
Register
access
Peripheral
bridge
Module signals
Low-power timer
Timers
Table 3-40. PIT channel assignments for periodic DMA triggering
PIT triggers are selected as ADCx trigger sources using the SOPT7[ADCxTRGSEL] bits
in the SIM module. For more details, refer to SIM chapter.
3.8.2.3PIT/TPM Triggers
PIT triggers are selected as TPMx trigger sources using the TPMx_CONF[TRGSEL] bits
in the TPM module. For more details, refer to TPM chapter.
3.8.2.4PIT/DAC Triggers
PIT Channel 0 is configured as the DAC hardware trigger source. For more details, refer
to DAC chapter.
3.8.3Low-power timer configuration
Figure 3-26. LPT configuration
TopicRelated moduleReference
Full descriptionLow-power timerLow-power timer
Table 3-41. Reference links to related information
Table continues on the next page...
88Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 89
Chapter 3 Chip Configuration
Table 3-41. Reference links to related information (continued)
TopicRelated moduleReference
System memory mapSystem memory map
ClockingClock Distribution
Power managementPower management
Signal MultiplexingPort controlSignal Multiplexing
3.8.3.1LPTMR Instantiation Information
The low-power timer (LPTMR) allows operation during all power modes. The LPTMR
can operate as a real-time interrupt or pulse accumulator. It includes a 15-bit prescaler
(real-time interrupt mode) or glitch filter (pulse accumulator mode).
The LPTMR can be clocked from the internal reference clock, the internal 1 kHz LPO,
OSCERCLK, or an external 32.768 kHz crystal. In VLLS0 mode, the clocking option is
limited to an external pin with the OSC configured for bypass (external clock) operation.
An interrupt is generated (and the counter may reset) when the counter equals the value
in the 16-bit compare register.
3.8.3.2LPTMR pulse counter input options
The LPTMR_CSR[TPS] bitfield configures the input source used in pulse counter mode.
The following table shows the chip-specific input assignments for this bitfield.
The prescaler and glitch filter of the LPTMR module can be clocked from one of four
sources determined by the LPTMR0_PSR[PCS] bitfield. The following table shows the
chip-specific clock assignments for this bitfield.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.89
Page 90
Signal multiplexing
Register
access
Peripheral
bridge
Module signals
Real-time clock
Timers
NOTE
The chosen clock must remain enabled if the LPTMR is to
continue operating in all required low-power modes.
LPTMR0_PSR[PCS]Prescaler/glitch filter clock
number
000MCGIRCLK — internal reference clock
011LPO — 1 kHz clock (not available in
102ERCLK32K (not available in VLLS0
113OSCERCLK — external reference clock
Chip clock
(not available in LLS and VLLS modes)
VLLS0 mode)
mode when using 32 kHz oscillator)
(not available in VLLS0 mode)
See Clock Distribution for more details on these clocks.
3.8.4RTC configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-27. RTC configuration
Table 3-42. Reference links to related information
TopicRelated moduleReference
Full descriptionRTCRTC
System memory mapSystem memory map
ClockingClock Distribution
Power managementPower management
90Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 91
Chapter 3 Chip Configuration
3.8.4.1RTC Instantiation Information
RTC prescaler is clocked by ERCLK32K.
RTC is reset on POR Only.
RTC_CR[OSCE] can override the configuration of the System OSC, configuring the
OSC for 32kHz crystal operation in all power modes (except VLLS0) and through any
System Reset. When OSCE is enabled, the RTC also overrides the capacitor
configurations.
3.8.4.2RTC_CLKOUT options
RTC_CLKOUT pin can be driven either with the RTC 1 Hz output or with the
OSCERCLK on-chip clock source. Control for this option is through
SIM_SOPT2[RTCCLKOUTSEL] bit.
When RTCCLKOUTSEL=0, the RTC 1 Hz clock is output is selected on the
RTC_CLKOUT pin. When RTCCLKOUTSEL=1, OSCERCLK clock is output on the
RTC_CLKOUT pin.
3.9
Communication interfaces
3.9.1Universal Serial Bus (USB) FS Subsystem
The USB FS subsystem includes these components:
• Dual-role USB OTG-capable (On-The-Go) controller that supports a full-speed (FS)
device or FS/LS host. The module complies with the USB 2.0 specification.
• USB transceiver that includes internal 15 kΩ pulldowns on the D+ and D- lines for
host mode functionality.
• A 3.3 V regulator.
• VBUS detect signal: To detect a valid VBUS in device mode, use a GPIO signal that
can wake the chip in all power modes.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.91
Page 92
USB controller
FS/LS
transceiver
USB voltage
regulator
D+D-
VREGINVOUT33
Communication interfaces
Figure 3-28. USB Subsystem Overview
3.9.1.1USB Wakeup
When the USB detects that there is no activity on the USB bus for more than 3 ms, the
INT_STAT[SLEEP] bit is set. This bit can cause an interrupt and software decides the
appropriate action.
Waking from a low power mode (except in LLS/VLLS mode where USB is not powered)
occurs through an asynchronous interrupt triggered by activity on the USB bus. Setting
the USBTRC0[USBRESMEN] bit enables this function.
3.9.1.2USB Power Distribution
This chip includes an internal 5 V to 3.3 V USB regulator that powers the USB
transceiver or the MCU (depending on the application).
3.9.1.2.1AA/AAA cells power supply
The chip can be powered by two AA/AAA cells. In this case, the MCU is powered
through VDD which is within the 1.8 to 3.0 V range. After USB cable insertion is
detected, the USB regulator is enabled to power the USB transceiver.
92Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 93
Chapter 3 Chip Configuration
2 AA Cells
TYPE A
D+
VBUS
D-
VDD
VOUT33
Cstab
VREGIN
USB0_DP
USB0_DM
To PMC and Pads
USB
Regulator
USB
XCVR
Figure 3-29. USB regulator AA cell usecase
Chip
USB
Controller
3.9.1.2.2Li-Ion battery power supply
The chip can also be powered by a single Li-ion battery. In this case, VOUT33 is
connected to VDD. The USB regulator must be enabled by default to power the MCU.
When connected to a USB host, the input source of this regulator is switched to the USB
bus supply from the Li-ion battery. To charge the battery, the MCU can configure the
battery charger.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.93
Page 94
Communication interfaces
VDD
To PMC and Pads
VOUT33
C
stab
TYPE A
VBUS
D+
D-
VSS
Charger
Li-Ion
Si2301
VREGIN
USB0_DP
USB0_DM
USB
Regulator
USB
XCVR
Chip
USB
Controller
Figure 3-30. USB regulator Li-ion usecase
3.9.1.2.3USB bus power supply
The chip can also be powered by the USB bus directly. In this case, VOUT33 is
connected to VDD. The USB regulator must be enabled by default to power the MCU,
then to power USB transceiver or external sensor.
VDD
To PMC and Pads
Cstab
TYPE A
VBUS
D+
D-
VOUT33
VREGIN
USB0_DP
USB0_DM
USB
Regulator
XCVR
USB
Chip
USB
Controller
Figure 3-31. USB regulator bus supply
3.9.1.3USB power management
The regulator should be put into STANDBY mode whenever the chip is in Stop mode.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
94Freescale Semiconductor, Inc.
Page 95
Signal multiplexing
Module signals
Register
access
USB controller
Peripheral
bridge 0
Crossbar switch
Transfers
Chapter 3 Chip Configuration
3.9.1.4USB controller configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-32. USB controller configuration
Table 3-43. Reference links to related information
TopicRelated moduleReference
Full descriptionUSB controllerUSB controller
System memory mapSystem memory map
ClockingClock Distribution
TransfersCrossbar switchCrossbar switch
Signal MultiplexingPort controlSignal Multiplexing
NOTE
When USB is not used in the application, it is recommended
that the USB regulator VREGIN and VOUT33 pins remain
floating.
3.9.1.5USB Voltage Regulator Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Freescale Semiconductor, Inc.95
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 96
Signal multiplexing
Module signals
USB Voltage
Regulator
USB OTG
Signal multiplexing
Register
access
SPI
Peripheral
bridge
Module signals
Communication interfaces
Figure 3-33. USB Voltage Regulator configuration
Table 3-44. Reference links to related information
TopicRelated moduleReference
Full descriptionUSB Voltage RegulatorUSB Voltage Regulator
System memory mapSystem memory map
ClockingClock Distribution
USB controllerUSB controller
Signal MultiplexingPort controlSignal Multiplexing
NOTE
When USB is not used in the application, it is recommended
that the USB regulator VREGIN and VOUT33 pins remain
floating.
3.9.2SPI configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-34. SPI configuration
Table 3-45. Reference links to related information
TopicRelated moduleReference
Full descriptionSPISPI
System memory mapSystem memory map
ClockingClock Distribution
Table continues on the next page...
96Freescale Semiconductor, Inc.
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 97
Signal multiplexing
Register
access
Peripheral
bridge
Module signals
2
I C
Chapter 3 Chip Configuration
Table 3-45. Reference links to related information (continued)
TopicRelated moduleReference
Signal MultiplexingPort controlSignal Multiplexing
3.9.2.1SPI Instantiation Information
This device contains two SPI module that supports 8-bit data length.
SPI0 is clocked on the bus clock. SPI1 is clocked from the system clock. SPI1 is
therefore disabled in "Partial Stop Mode".
The SPI supports DMA request and can operate in VLPS mode. When the SPI is
operating in VLPS mode, it will operate as a slave.
SPI can wakeup MCU from VLPS mode upon reception of SPI data in slave mode.
3.9.3I2C Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-35. I2C configuration
Table 3-46. Reference links to related information
TopicRelated moduleReference
Full descriptionI2CI2C
System memory mapSystem memory map
ClockingClock Distribution
Power managementPower management
Signal MultiplexingPort controlSignal Multiplexing
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Freescale Semiconductor, Inc.97
Page 98
Signal multiplexing
Register
access
Peripheral
bridge
Module signals
UART
Communication interfaces
3.9.3.1IIC Instantiation Information
This device has two IIC module.
When the package pins associated with IIC have their mux select configured for IIC
operation, the pins (SCL and SDA) are driven in a pseudo open drain configuration.
The digital glitch filter implemented in the IICx module, controlled by the
I2Cx_FLT[FLT] registers, is clocked from the bus clock and thus has filter granularity in
bus clock cycle counts.
3.9.4UART Configuration
This section summarizes how the module has been configured in the chip. For a
comprehensive description of the module itself, see the module’s dedicated chapter.
Figure 3-36. UART configuration
Table 3-47. Reference links to related information
TopicRelated moduleReference
Full descriptionUART1 and UART2UART
Full descriptionUART0UART
System memory mapSystem memory map
ClockingClock Distribution
Power managementPower management
Signal MultiplexingPort controlSignal Multiplexing
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
98Freescale Semiconductor, Inc.
Page 99
Signal multiplexing
Register
access
Peripheral
bridge
Module signals
GPIO controller
ARM Cortex -M0+
Core
Register access
Chapter 3 Chip Configuration
3.9.4.1UART0 overview
The UART0 module supports basic UART with DMA interface function, x4 to x32
oversampling of baud-rate.
This module supports LIN slave operation.
The module can remain functional in VLPS mode provided the clock it is using remains
enabled.
ISO7816 protocol is intended to be handled in software for this product. To support smart
card reading, TxD pin can be configured as pseudo open drain for 1-wire half-duplex like
ISO7816 communication via the SIM_SOPT5[UART0ODE] bit.
3.9.4.2UART1 and UART2 Overview
This device contains two basic universal asynchronous receiver/transmitter (UART)
modules with DMA function support. Generally, these modules are used in RS-232,
RS-485, and other communications. This module supports LIN Slave operation.
3.10
Human-machine interfaces (HMI)
3.10.1GPIO Configuration
Figure 3-37. GPIO configuration
Table 3-48. Reference links to related information
TopicRelated moduleReference
Full descriptionGPIOGPIO
System memory mapSystem memory map
ClockingClock Distribution
Table continues on the next page...
Freescale Semiconductor, Inc.99
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
Page 100
Human-machine interfaces (HMI)
Table 3-48. Reference links to related information (continued)
TopicRelated moduleReference
Power managementPower management
Crossbar switchCrossbar switchCrossbar switch
Signal MultiplexingPort controlSignal Multiplexing
3.10.1.1GPIO Instantiation Information
The device includes four pins, PTB0, PTB1, PTD6, and PTD7, with high current drive
capability. These pins can be used to drive LED or power MOSFET directly. The high
drive capability applies to all functions which are multiplexed on these pins (UART,
TPM, SPI...etc)
3.10.1.1.1Pull Devices and Directions
The pull devices are enabled out of POR only on RESET_B, NMI_b and respective SWD
signals. Other pins can be enabled by writing to PORTx_PCRn[PE] field.
All the pins are hard wired to be pullup except for SWD_CLK. The state will be reflected
in the PORTx_PCRn[PS] field.
3.10.1.2Port Control and Interrupt Summary
The following table provides more information regarding the Port Control and Interrupt
configurations .
Table 3-49. Ports Summary
FeaturePort APort BPort CPort DPort E
Pull Select control NoNoNoNoNo
Pull Select at reset PTA0=Pull down,
Others=Pull up
Pull Enable control YesYesYesYesYes
Pull Enable at reset PTA0/PTA3/PTA4/
RESET_b=Enabled
; Others=Disabled
Slew Rate Enable
control
NoNoNoNoNo
Pull upPull upPull upPull up
DisabledDisabledDisabledDisabled
Table continues on the next page...
KL25 Sub-Family Reference Manual, Rev. 3, September 2012
100Freescale Semiconductor, Inc.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.