portfolio presentation - unr · tm external use 2 the kinetis concept • freescale uses the most...
TRANSCRIPT
External Use
TM
Kinetis MicrocontrollersPortfolio Presentation
S A S E 2 0 1 4
Gabriel Soccodato | DFAE Electrocomponentes S.A.
TM
External Use 2
The Kinetis Concept
• Freescale uses the most advanced cores from ARMs offering:− CortexTM M4 for highest
computation performance
− CortexTM M0+ for lowest power and
smallest packages
• Depending on their capabilities they are grouped to K10/KL1, K20/KL2/KW20 etc. In a family direct scalability between these groups is given
CoresCores ScalabilityScalability
• Today, six Kinetis families are available. Kinetis L, K, E, M and W series are in production, first Kinetis KV01 is available and more in will be in production Q2 2014.
FamiliesFamilies
Kinetis is the branding for all ARM® CortexTM-M based microcontrollers
TM
External Use 3
Kinetis Series powered by ARM® Cortex™
Cortex-M0Cortex-M0
Cortex-M0+Cortex-M0+
Cortex-M1Cortex-M1
Cortex-M3Cortex-M3
Cortex-M4Cortex-M4High performance data processing & I/O control. Support hardware divide, MAC, bit field processing, DSP. Floating point unit optional (Cortex-M4F).
High performance data processing & I/O control. Support hardware divide, MAC, bit field processing, DSP. Floating point unit optional (Cortex-M4F).
High performance data processing & I/O control. Support hardware divide, MAC (Multiply Accumulate) , bit field processing.
High performance data processing & I/O control. Support hardware divide, MAC (Multiply Accumulate) , bit field processing.
General data processing, high performance I/O control, mixed signal ASICs, replacement for 8/16-bit MCUsGeneral data processing, high performance I/O control, mixed signal ASICs, replacement for 8/16-bit MCUs
General data processing, I/O control, mixed signal ASICs, replacement for 8/16-bit MCUsGeneral data processing, I/O control, mixed signal ASICs, replacement for 8/16-bit MCUs
For FPGA designs only. Optimized for FPGA and can work in most FPGA devicesFor FPGA designs only. Optimized for FPGA and can work in most FPGA devices
AR
Mv7
-Mar
chite
ctur
eA
RM
v6-M
arch
itect
ure
Kinetis K SeriesKinetis
K Series
Kinetis L SeriesKinetis L Series
TM
External Use 4
Kinetis MCU Families
K20
K30
K10
K50
K60
K40
K70
KL1
KL2
KL0
KL4
KL3 KM3+ LCD
+ USB
Baseline
+ Measurement
+ Ethernet & Crypto
+ USB and LCD
+ Graphic LCD
K SeriesGeneral
Purpose
L SeriesLowest Power/
Smallest Package
M Series Metering24b Sigma Delta ADC
& PGA
W SeriesWireless
Sub 1-GHz&
2.4 GHZ
S08PBridge to 8bit MCU KW0
KW2
S08P 8-bit Core
Lowest Price &
5V Supply
KM1
ARM® Cortex™-M4 ARM® Cortex™-M0+ Freescale HC9S08Core:
E SeriesEMC/ESD Robust & 5V Supply
KE0
V SeriesMotor
Control & Power
Conversion
KV1
Feature SetFor all Series
more to come in
2014
more to come in
2014
TM
External Use 5
Kinetis Families
TM
External Use 6
Kinetis K Series
Design Potential. Realized with ARM® CortexTM-M4
www.freescale.com/kinetis/KSeries
TM
External Use 7
K Series: MCU Family CompatibilityHardware & software compatible MCU families with scalable performance, memory and feature integration
I I I I I I I I
I I I I I I I I
I I
I I I
I I
I I
IK30 Family72-100MHz64-512KB64-144pin
I I I I I I I I
I I I I I I I I
I I
I I I
I I I
I IK20 Family
50-120MHz32KB-1MB32-144pin
I I I I I I I I
I I I I I I I I
I I
I I I
I I I
I IK10 Family
50-120MHz32KB-1MB32-144pin
I I I I I I I I
I I I I I I I I
I I
I I I
I I I
I IK40 Family
72-100MHz64-512KB64-144pin
I I I I I I I I
I I
I I I
I I I I I I I I
I I I
I I K50 Family
72-100MHz128-512KB64-144pin
I I I I I I I I
I I I I I I I I
I I
I I I
I I I
I IK60 Family
100-150MHz256KB-1MB100-256pin
I I I I I I I I
I I
I I I
I I I I I I I I
I I I
I I K70 Family
120-150MHz512KB-1MB196-256pin
+ USB
+ Segment LCD
+ Segment LCD
+ USB
+ Ethernet, Encryption, Tamper Detect,
DRAM Controller
Entry Point + Analog Measurement Engine,
Ethernet, Encryption
+ Graphics LCD
TM
External Use 8
Kinetis K-Series: four Sub-Families availableF
eatu
re I
nteg
ratio
n
128-512KB Flash, 100MHz
100MHz 128-512KB, 80-
144pin
128KB-1MB Flash, 120-150MHz, FPU
64KB-256KB Flash, 72MHz
120-150MHz,Floating Point Unit, 128KB-1MB, 64-256pin
72MHz64-256KB, 64-121pin
50MHz32-512KB, 32-121pin
32KB-512KB Flash, 50MHz
K10 FamilyMixed-Signal
K20 FamilyUSB
K30 FamilySegment LCD
K40 FamilyUSB, Segment LCD
K50 Family (Medical)Analog, USB, S. LCD, Ethernet, Encryption
K60 FamilyEthernet, Encryption, USB
K10 Family+ NAND Flash
K20 Family+ USB (HS), NAND Flash
K60 Family+ USB (HS), Tamper, NAND
Flash, DRAM
K70 Family+ Graphics LCD
K10 FamilyMixed-Signal
K20 FamilyUSB
K30 FamilySegment LCD
K40 FamilyUSB, Segment LCD
K50 Family (Medical)Analog, USB, S. LCD, Ethernet,
Encryption
K10 FamilyMixed-Signal
K20 FamilyUSB
TM
External Use 9
Kinetis L Series
Design Made Simple with ARM® CortexTM-M0+
www.freescale.com/kinetis/LSeries
TM
External Use 10
Kinetis L/K Series: MCU Family CompatibilityHardware & software compatible MCU families with scalable performance, memory and feature integration
I I I I I I I I
I I I I I I I I
I I
I I I
I I I
I IK30 Family
72-100MHz64-512KB64-144pin
I I I I I I I I
I I I I I I I I
I I
I I I
I I I
I IK20 Family
50-120MHz32KB-1MB32-144pin
I I I I I I I I
I I I I I I I I
I I I
I I
I I I
I IK10 Family
50-120MHz32KB-1MB32-144pin
I I I I I I I I
I I I I I I I I
I I
I I I
I I
I I
IK40 Family72-100MHz64-512KB64-144pin
I I I I I I I I
I I
I I I
I I I I I I I I
I I I
I I K50 Family
72-100MHz128-512KB64-144pin
I I I I I I I I
I I I I I I I I
I I I
I I
I I I
I IK60 Family
100-150MHz256KB-1MB100-256pin
I I I I I I I I
I I
I I I
I I I I I I I I
I I
I I I K70 Family
120-150MHz512KB-1MB196-256pin
+ USB
+ Segment LCD
+ Segment LCD
+ USB
+ Ethernet, Encryption, Tamper Detect,
DRAM Controller
+ Analog Measurement Engine, Ethernet, Encryption
+ Graphics LCD
I I I I I I I I
I I I I I I I I
I I I
I I
I I
I I IKL3x Family
48MHz64-256KB64-121pin
I I I I I I I I
I I I I I I I II
I I
I I
I I
I I IKL2x Family
48MHz32KB-256KB
32-121pin
I I I I I I I I
I I I I I I I I
I I
I I I
I I
I I IKL1x Family
48MHz32KB-256KB
32-80pin
I I I I I I I I
I I I I I I I I
I I
I I
I
I I
I I IKL4x Family
48MHz128-256KB64-121pin
Entry Point
8-bit MCU Compatible
I I I I I I I I
I I I I I I I I
I I I
I I
I I
I I IKL0x Family
48MHz8KB-32KB<24-48pin
ARM Cortex-M0+
ARM Cortex-M4
TM
External Use 11
USB + Seg. LCD
KL3x
KL1xKL1x
KL1x KL1x
Kinetis L Series: Memory & Package Scalability
Fla
sh M
emor
y
KL2x KL2xKL2x
KL2x
KL2x KL2xKL2x
KL2x KL2x
KL4x
KL3x
KL4x
KL4x
KL3x
KL4x
KL2x
KL1x
KL2x
KL1x
KL1x
KL1x
KL2x
KL1x KL1x KL1x
KL3x
KL2x
KL3x
KL2x
KL2x
KL1x
KL2x
KL1x
KL1x
Segment LCD
USB
General Purpose
Entry Level
Fla
sh M
emo
ry
Package
128KB
64KB
32KB
16KB
8KB
256KB
KL0x
KL0x
KL0x
KL0x
KL0x
100 LQFP /121 MBGA
80 LQFP64 LQFP 48 LQFP /QFN
32 LQFP/ QFN
24 QFN 35WLCSP
KL2x
KL1x
KL0x
KL0x
KL0x
16 QFN
KL0x
KL0x
KL0x
Small Footprint Package
KL3x
20WLCSP
KL0x
Small Packages
Package Size (mm) Pitch (mm) MCU Families Samples / Qual
16QFN 3 x 3 x 1 0.5 KL02 Apr2013 / Aug2013
24QFN 4 x 4 x 1 0.5 KL05/KL04/KL02Now / Now
Feb2013 / Jun2013
20CSP 2 x 2 x 0.56 0.4 KL02 Q213 / Q413
25CSP 2.3 x 2.3 x 0.56 0.4 KL05 Proposed
35CSP 2.55 x 3 x 0.56 0.4 KL15/KL25 Q213 / Q313
TM
External Use 12
Kinetis L Series vs. Kinetis K Series
Category Kinetis L Series Kinetis K Series
Core, Performance ARM Cortex-M0+ (48MHz) ARM Cortex-M4 (50-150MHz)
Flash 8-256KB 32KB-1MB
FeaturesMixed-Signal, USB,
Seg. LCD
FlexMemory, Mixed-Signal, USB, Seg. LCD, CAN, Ethernet, Gra. LCD,
DRAM, Crypto, Tamper Detect, DRAM
Pin-count 16-121pin 32-256pin
Low Power ~50uA/MHz (VLPR) ~200uA/MHz (VLPR)
Price From $0.49
(MKL02, 8KB, 16QFN)From $0.99
(MK10, 32KB, 32QFN)
Target Applications 8 &16-bit replacement Low/mid/high–end 32-bit
TM
External Use 13
Kinetis E Series
Strong RobustnessHigh Efficiency Low Cost with ARM® CortexTM-M0+
www.freescale.com/kinetis/ESeries
TM
External Use 14
Kinetis E selling points
1. Better EMC – Proven passing EFT(IEC61000-4-4) /PSED(IEC61000-4-2) tests in a Microwave single layer PCB design
2. High robustness – 5V operation provides better noise immunity
3. Reduce system cost – No additional BOM for faster response Bit-banging / SW emulation / Direct connection to LED drive circuit / Over-Current and Voltage protection / Up to 256B EEPROM to save an ext EEPROM chip
4. Easy for PCB layout – 0.8mm pin pitch for low cost PCBA assy process
5. Make platform design easier – Pin compatible with KE and S08P / Rich Eco-system / SW reusable / Save time to market
TM
External Use 15
Kinetis E Series: Master Block Diagram
80LQFP(0.65mm pitch);64QFP (0.8mm pitch); 64LQFP(0.5mm pitch);44LQFP (0.8mm pitch);32LQFP (0.8mm pitch); 24QFN(0.65mm pitch);20SOIC(1.27mm pitch); 16TSSOP(0.65mm pitch) Pin compatible within 5V E-series on same package
Temp: -40~105°C operation
Peripheral Bus Peripheral Bus
I/O PortsTimers & Triggers
6ch + 2ch + 2ch 16bit Flex Timer(2)
6ch + 2ch + 2ch 16bit Flex Timer(2)
1 x PWT1 x PWT
Power Management
Single 2.7-5.5V Power SupplySingle 2.7-5.5V Power Supply
Power On Reset
Power On Reset Low Voltage
Detector
Low Voltage Detector
System Clock Management
Int R/C OSC(~32KHz 2%)
Int R/C OSC(~32KHz 2%)
FLL Clock Multiplier
FLL Clock Multiplier
1 x 32bit PIT(2 ch)1 x 32bit PIT(2 ch)
Unique IDUnique ID
Serial Interfaces
3 x SCI (LIN capable)3 x SCI (LIN capable)
2 x 8bit SPI2 x 8bit SPI
Ext Osc (4-24M, 32K)
Ext Osc (4-24M, 32K)
Int LP Osc (1KHz)
Int LP Osc (1KHz)
Display
28x4/24x8 Seg LCD28x4/24x8 Seg LCD
Analog Interfaces
16ch 12bit ADC with 8 FIFO
16ch 12bit ADC with 8 FIFO
2 x ACMP2 x ACMP
2 x IIC (1 x SMBUS)2 x IIC (1 x SMBUS)
1 x msCAN1 x msCAN
Up to 71 GPIOUp to 71 GPIO
2 pins True Open-Drain
2 pins True Open-Drain8 pins
20mA
8 pins 20mA
Reset/InputReset/Input
16bit Real Time Counter16bit Real Time Counter
CRCCRC
1-Cycle GPIO
1-Cycle GPIO
RAM16KB
RAM16KB
WDTWDT
Flash128KB
Flash128KB
BME(1)
BME(1)
Cortex M0+ 48MHz Core Freq
Cortex M0+ 48MHz Core Freq
SWDDebugger
SWDDebuggerNVIC
NVIC
1-CY MUL1-CY MUL
8 x KBI8 x KBI
16ch TSI16ch TSI
(1) Support bit operation in RAM
(2) Faster timer running 2 x core clock
TM
External Use 16
Kinetis E Series: MCU Families
Common Features
System
ARM Cortex-M0+ Core, 48MHz [1]
Multiple power modes, Clock Gating, 2.7V – 5.5V
Operating Temp: -40 to 105°C
Clock Management
External OSC, 4~20MHz, 32KHz
Internal OSC, 32KHz, 1KHz
Analog Peripherals
12-Bit ADC
Analog Comparators
Serial Interfaces
SCI
SPI, IIC
Timers
Real Time Clock
16bit Flex timers
32bit Periodic Interrupt Timer
Optional Features
Family Speed Flash SRAMKey Features
CANSeg.LCD
PWTFast Timer
ADC TSI
KE06Z 48MHz 64-128KB 8-16KB √ √ √ 12-bit
KE35Z 48MHz 16-32KB 2-4KB √ √ √ 12-bit √
KE05Z 48MHz 16-64KB 2-8KB √ √ 12-bit √
KE04Z 48MHz 8-128KB 1-16KB √ √ 12-bit
KE02Z 20MHz 16-64KB 2-4KB 12-bit[1] 20MHz for KE02
Family Production
KE02Z Since 2013
KE02Z-40MHz 2014 Q2
KE04Z8 2014 Q2
KE06Z 2014 Q2
KE04Z 2014 Q2
TM
External Use 17
Kinetis M Series
Highest Precision & Securitywith ARM® CortexTM-M0+
www.freescale.com/kinetis/MSeries
TM
External Use 18
Kinetis M - Highest precision and security
• Up to 48 MHz Cortex™-M0+ with Ultra-Low-Power• Analog Front End
− 24-bit sigma delta ADC with 94 dB SNR − Programmable gain amplifier with gains from 1 to 32 with low temperature drift − High precision internal voltage reference with low temperature drift
• Security− Tamper detection with time
stamping − Random number generator,
memory protection unit
• Interfaces− LCD segment driver up to 288
(8x36) segments− High accuracy RTC
+5 ppm over temperature range − 4x UART, 2x SPI, 2x IIC
TM
External Use 19
Kinetis W Series
From Antenna to Bits with ARM® CortexTM-M0+ & CortexTM-M4
www.freescale.com/kinetis/WSeries
TM
External Use 20
Freescale Wireless Connectivity Strategy
To provide all wireless solutions (from antenna to bits) required for control and monitoring applications in consumer, residential, metering, medical and industrial applications.
Wireless Microcontrollers
• All ISM frequency bands: 315 MHz, 434 MHz, 868 MHz, 915 MHz, 2.4 GHz
• Scalable wireless protocol: From simple point-to-point lightweight protocol, up to full ZigBee-compliant applications.
RF / MCU
CommunicationsSoftware
CommunicationsSoftware
TM
External Use 21
Kinetis W – ARM® CortexTM-M & RF Transceiver
• KW01− Up to 48 MHz Cortex™-M0+ with Ultra-
Low-Power− RF transceiver supports 290-340 MHz,
424-510 MHz, and 862-1020 MHz frequency bands
• KW20− Up to 50 MHz Cortex™-M4 with 16-
channel-DMA− Highly integrated 2.4 GHz RF transceiver − 802.15.4 Packet processor
TM
External Use 22
Feature SMAC SynkroRFZigBee™ RF4CE
ZigBee™2007-PRO
ZigBee™IP
TypicalApplications
CableReplacement
CableReplacement
RF RemoteControl
HomeAutomation
Smart Energy 2.0
Wireless Toysand Games
WirelessControl
HomeEntertainmentand Control
Smart Energy 1.x
HomeAutomation
BuildingAutomation
Health Care
NetworkStack
No Yes Yes Yes Yes
Network Profiles No No Yes Yes YesMemoryRequirements
4-8K 32K <40K 80-100K 256K min
NetworkTopology
Point-to-PointCo-existing
StarCo-existing
StarTree Tree
Star Mesh Mesh
Typical #of Nodes
2-10032 per Controlled
Device32 per Target
Device
2-250ZigBee
IP limit2-1000
ZigBee ProTypical ICCost
$1-2 $2-3 $2-3 $3-4 $4-5
Typical DataThroughput
50-115K 70-100K 70-100K 30-70K 30-70K
2.4GHz Protocol Stack Comparison
TM
External Use 23
Sub-GHz Protocol Stack Comparison
23Feature SMAC 802.15.4g IPv6 Wireless M-Bus
Typical Application
Cable Replacement
Wireless Meter Reading Internet of
ThingsM2M
Wireless Meter Reading (Europe)
MedicalBuilding Control
Medical
Standard Proprietary IEEE 802.15.4 6lowPAN EN 13757-4:2005
Network Stack No No Yes Yes
Network Profiles No No No No
Memory Requirements 4-8K 32K 128K 16-32K
Network Topology
Point to Point Peer-to-Peer
IP
Point-to-Point
StarTree
StarMesh
Typical # of Nodes 2-100 2-100 Not limited 2-100
Data Rate 200 Kbps 50-200 Kbps 1-600Kbps 32-100 Kbps
Protocol Stack Provider
Freescale 3rd Party 3rd Party 3rd Party
TM
External Use 24
Kinetis V Series
Motor & Power Control with ARM® CortexTM-M0+ & CortexTM-M4
www.freescale.com/kinetis/VSeries
TM
External Use 25
Kinetis V Series: Motor & Power Control
• Full Kinetis portfolio compatibility targeting low cost, stand alone motor control, to high performance digital power conversion
• Optimized for processing efficiency with performance ranging from 75MHz to beyond 200MHz
• ARM architecture with best in class, high speed capture and control peripherals for motor control and power management applications
• Enablement and tools built around reducing customer development time and cost, whilst increasing ease of use.
TM
External Use 26
Kinetis V-Series: 3 Phase Motor Control
KVxx
KV1x
KVxx
+ FPU
+ Integrated Motor Control S/W
Baseline
+ Dual Motor Control
+ Advanced Timers
+ Management Core
+ HS ADC
Entry LevelFOC Motor
Control
Integrated Motor
Control Solutions
Scalable Mid Range
Motor Control
High Performance
Motor Control
KVxx
ARM® Cortex™-M
ARM® Cortex™-M0+Core: ARM® Cortex™-M
Multi Domain Motor
Control w/ Comms
KVxx
KVxx
KVxx KVxx
KVxx
KVxxKVxx
Dual ARM® Cortex™-M
+ USB
KVxx
KVxx
KVxx
KVxx
KVxx
KVxx
KVxx
High Performance
MC & extended memory
KV1x
KVxx
KVxx
+ ENET KVxx
Ultra Performance
Power Control w/
Comms
KVxx
KVxx
KVxx
KVxx
KVxx
KVxx
KVxx
TM
External Use 27
DebugInterfaces
HW Divide & SqrRoot
InterruptController
ARM Cortex-M0+75MHz
Internal and External
Watchdogs
4ch-DMA
Inter-ModuleCrossbar
Program Flash32KB
SRAM8KB
Frequency-Locked Loop
Low/HighFrequencyOscillators
InternalReference
Clocks
CyclicRedundancyCheck (CRC)
2 x16-bit ADC
2 x ACMP
1 x12-bitDAC
6ch FlexTimer
ProgrammableDelay Block
Low-PowerTimer
1xI2C
1xSPI
2xUARTs
GPIO
Core System Memories Clocks
Securityand Integrity
Analog Timers Communication Interfaces HMI
Key Features:
Core/System• 75MHz ARM CM0+ with 4ch DMA• H/W DIV & SQRT block
Memory• 32KB Flash, 8KB SRAM
Communications• Multiple serial ports
Analog• 2 x 8ch 16-bit ADC
• 835nS conversion time• 1 x12-bit DAC, • 2 x ACMP w/ 6b DAC
Timers• 1x6ch FlexTimer (PWM)• 2x2ch FlexTimer (PWM/QDEC)• Programmable Delay Block
Others• 32-bit CRC• Inter-module Crossbar Switch• Up to 35 I/Os• 1.71V-3.6V; -40 to 105°C
Packages• 32QFN, 32LQFP, 48LQFP• Pin-to-pin compatible with K series
From $1.18 to $1.37 at 10k units
2x2ch FlexTimer
Kinetis V Series KV1x: Overview
A high performance, cost-optimized and best-in-class enabled 32-bit ARM Cortex-M0+ MCU for low/mid range Brushless DC and FOC PMSM Motor Control
TM
External Use 28
Kinetis Differentiators
TM
External Use 29
Kinetis Key Differentiators in Technology
Security Performance Low Power Mixed Signal Special Features
• Hardware-accelerated security algorithms and tamper detection
• Secure communication and safe operation
• Unique device ID for tracing and tracking
• Non-blocking bus-matrix-switch
• K Series with DSP extension in all sub-families
• FLASH memory controller
• MPU/DMA
• ~50µA/MHz for Kinetis L
• ~200 µA/MHz for Kinetis K
• Up to 11 flexible power-modes
• low-power wake-up logic.
• Supply voltage from 1.71V to 3.6V, resp. 2.7V to 5.5V
• 16-Bit ADCs• 12-bit DACs,• High Speed
comparators • Programmable
Gain Amplifiers• Precision
Voltage Reference
• Flex-Memory – up to 10M erase/write cycles
• Touch-sensing with API library
• EEPROM with Kinetis E Series
• 24b Sigma Delta ADC in M Series
• RF transceiver (sub-1GHz & 2.4GHz) in W Series
TM
External Use 30
48LQFP7 x 7 mm
0.55mm pitch(K10/20)(KL0x)
64LQFP10 x 10 mm0.5mm pitch
(K10/20/30/40/50)(KL1x/2x/3x/4x)
80LQFP12 x 12 mm0.5mm pitch
(K10/20/30/40/50)(KL1x/2x/3x/4x)
100LQFP14 x 14 mm0.5mm pitch
(K10/20/30/40/50/60)(KL2x/3x/4x)
144LQFP20 x 20 mm0.5mm pitch
(K10/20/30/40/50/60)
144 MAPBGA13 x 13 mm1.0mm pitch(K10/20/30/40/50/60)
256 MAPBGA17 x 17 mm1.0mm pitch
(K60/70)
32LQFP7 x 7 mm
0.8mm pitch(K10/20)(KL0x)
169 MAPBGA9 x 9 mm
0.65mm pitch(K60)
Kinetis K/L Package Overview
CSP
64 MAPBGA5 x 5 mm
0.5mm pitch(K10/20)
(KL1x*/2x*/3x*/4x*)
BGA
121 MAPBGA8 x 8 mm
0.65mm pitch(K10/20/30/40/50/60)
(KL2x/3x/4x)
LQFP
256 RCP9 x 9 mm
0.5mm pitch(K61)
176LQFP24 x 24 mm0.5mm pitch(Kinetis X*)
35 CSP2.5x3.0mm
0.4mm pitch(KL15/25)
20 CSP2.0x2.0mm
0.4mm pitch(KL02)
64 CSP3.3x3.3mm
0.4mm pitch(K12/22)
100 CSP4.6x4.8mm
0.4mm pitch(K10/20)
120 CSP5.3x5.3mm
0.4mm pitch(K10/20/60)
143 CSP6.5x5.6mm
0.4mm pitch(K60/61)
42 CSP2.9x2.8mm
0.4mm pitch(KL1x/2x)
169 CSP5.6 x 5.5mm0.4mm pitch(K60 2M)
142 CSP4.8x5.6mm
0.4mm pitch(K24/64)
36 CSP2.4x2.4 mm
0.35mm pitch(KL16/26)
32QFN5 x 5 mm
0.5mm pitch(K10/20)
(KL0x/1x/2x)
48QFN7 x 7 mm
0.5mm pitch(K10/20)
(KL1x/2x)
24QFN4 x 4 mm
0.5mm pitch(KL0x)
16QFN3 x 3 mm
0.5mm pitch(KL02)
QFN
TM
External Use 31
Freescale Product Longevity Program
• The embedded market needs long-term product support
• Freescale has a longstanding track record of providing long-term production support for our products
• Freescale is pleased to introduce a formal product longevity program for the market segments we serve − For the automotive and medical segments, Freescale will
make a broad range of program devices available for a minimum of 15 years
− For all other market segments in which Freescale participates, Freescale will make a broad range of devices available for a minimum of 10 years
− Life cycles begin at the time of launch
• For terms and conditions and to see a list of participating Freescale products available under this program: www.freescale.com/productlongevity
TM
External Use 32
Kinetis Enablement
TM
External Use 33
Kinetis Enablement Overview
Freescale BundleFreescale Bundle
HardwareFreedom board, Tower Platform
HardwareFreedom board, Tower Platform
SoftwareCodeWarrior, Processor Expert, Driver Suite, eGUI, PEG, FreeMASTER
SoftwareCodeWarrior, Processor Expert, Driver Suite, eGUI, PEG, FreeMASTER
RTOSMQX, MQX Lite
RTOSMQX, MQX Lite
Kinetis MCUKinetis MCU
ARM Cortex-M0+ Core48MHz, 1.77 CoreMark/MHz,
2-Stage Pipeline, 1-Cycle GPIO, Micro Trace Buffer
ARM Cortex-M0+ Core48MHz, 1.77 CoreMark/MHz,
2-Stage Pipeline, 1-Cycle GPIO, Micro Trace Buffer
ARM Cortex-M4 Core50-150MHz, 3.40 CoreMark/MHz,
HW-divide, MAC, DSP-commands, FPU option
ARM Cortex-M4 Core50-150MHz, 3.40 CoreMark/MHz,
HW-divide, MAC, DSP-commands, FPU option
Differentiators Low-power, Performance, Flex-Memory, Mixed-Signal, Security,
HMI Features
Differentiators Low-power, Performance, Flex-Memory, Mixed-Signal, Security,
HMI Features
Special FunctionsAnalog Pre-Processing, 24b-
Sigma Delta ADC, sub -1GHz & 2.4 GHz Transceiver
Special FunctionsAnalog Pre-Processing, 24b-
Sigma Delta ADC, sub -1GHz & 2.4 GHz Transceiver
ARM Eco SystemARM Eco System
EnablementEnablement
TM
External Use 34
Kinetis Development Hardware
Freedom Platform
• The new Freescale platform for Kinetis L and Kinetis K microcontroller
• Compatible with Arduino shields
Tower System
• The established and proven platform with highest flexibility and re-usability
• Over 50 add-on boards available.
Device Specific
• Evaluation boards addressing special functions and capabilities of Kinetis devices
Reference Designs
• Home Energy Gateway, 1ph Meter, 3ph Meter, pre-/post-paid Meter, Home Area Network, Home Display, …
TM
External Use 35
Kinetis Development Software
IDE
• CodeWarrior – eclipse-based Basic, Standard, Professional and Free Suite with 128k code size limit
• Processor Expert/Driver Suite – configuration and code generation tool
RTOS
• MQX - Free real-time operating system with USB & Ethernet stacks and file system
• MQX Lite - Free and lightweight RTOS for small microcontrollers
Middleware
• eGui – Free and lightweight graphic frame-work for small microcontrollers
• PEG - high performance, high value tool for medium to high end MCUs with a licence fee associated
Libraries & Tools
• FreeMaster - Real-time monitor and control of an app
• Math & Motor Control Lib - Wide group of algorithms
• Made For iPod - supports development and rapid prototyping of electronic accessories for iPod, iPhone and iPad devices
TM
External Use 36
The ARM® Eco System
Use the broad support for ARM® microcontroller by many
companies.
• Re-use your existing…
GNU Tools
TM
External Use 37
MCU Solution Advisor web applicationwww.freescale.com/SolutionAdvisor
The Solution Advisor helps you quickly identify best-fit processor solutions from the following portfolios:8-bit MCU (microcontroller)Kinetis K Series MCUKinetis L Series MCUPX Series MCUFreescale DSC (digital signal controller)
Interactive MCU selector guide based on:operating characteristicspackaging optionsmemory and FlexMemoryrequirementsa library of configurable hardware modules
Dynamic, sortable, downloadable solution matrix
Pin Muxing verification and suggested placement (Full functionality will be restored soon)
Session and Contact ManagementSave, restore, invite, and share
Generates session summary reports
TM
External Use 38
Freescale Cross Check App
• Features:− Cross reference check of competitive solutions− 10K budgetary resale pricing− Top parametric for comparison− Direct links to data sheets− Additional links for package and environmental information
TM
External Use 39
Where you can find Kinetis designs today
Blood Glucose
Analog & Low Power
WiFi Gateway
MQX & Memory
AC Motor
Performance & IP
E-Meter
Scalability & IP
Wireless Power
Flexibility & SW
Smoke Detector
BOM cost & Low Power
Money Counter Gaming Mouse
Low Power & USB
Fitness Watch Infusion Pump
Tools & Support
Coffee Maker Air Bed Pump Card Reader
Security & IP
HVAC Control
ADC & Analog
Guitar Effect
NAND & Audio
Medical
Consumer
Industrial
Features & BOM cost
Features & Timing
Scalability & Features
Performance & Peripherals
TM
External Use 40
Market’s most scalable portfolio of low-power ARM Cortex-M0+ and ARM Cortex-M4 MCUs with over 700 hardware and software compatible devices
Exceptional integration with fast 16-bit ADCs, DACs, PGAs and more. Powerful, cost-effective signal conversion, conditioning and control
• Ultra-Scalable • Mixed Signal
The world’s most energy-efficient and scalable MCU Series with power optimized peripherals and flexible power modes
• Energy Efficiency
Comprehensive Enablement Freescale MQX RTOS, Tower System and Eclipse-based CodeWarrior IDE,
as well as Kinetis support from most ARM ecosystem providers
Comprehensive Enablement Freescale MQX RTOS, Tower System and Eclipse-based CodeWarrior IDE,
as well as Kinetis support from most ARM ecosystem providers
KINETIS SERIESDESIGN POTENTIAL. REALIZED
TM
External Use 41
CW10.x (Hoy CW 10.6)
KDS+SDK (Hoy Beta 1.0.1)
PE
Eclipse+GCC
Herraminetas SW
TM
External Use 42
MQX/MQX LiteFreeRTOSUSB stackKxxxxSC
SW asociado
TM
External Use 43
OpenSDA: Open-Standard Serial And Debug Adapter El circuito de debugging integrado, OpenSDA, brinda además de debugger puerto serie virtual. El OpenSDA tiene un bootloader “mass storage device”, que proporciona un mecanismo fácil y rápido para cargar diferentes aplicaciones a la interfaz OpenSDA como; programadores de flash, debuggers, conersores serial-to-USB y otros:
• La interfaz de programación de Freescale que usa “mass storage device” elimina la necesidad de instalar herramientas para evaluar aplicaciones en forma rápida
• P&E Multilink: provee un debugger compatible con los diferentes IDEs• SEGGER™ OpenSDA: provee un debugger compatible con los diferentes
IDEs (JLINK Lite)• Interfaz mbed: provee debugger para las herramientas online con soporte
de virtual serial port, CMSIS-DAP, y mass-storage programming interface • CMSIS-DAP(stand alone): Nuevo estándar ARM para debugging
Concepto Freedom
TM
External Use 44
MKL46Z256VLLZ4 MCU (48 MHz, 256KB Flash, 32 KB RAM, Low power, 100LQFP) Dual role USB interface with mini-B USB connector Open SDA 4 digit segment LCD module Capacitive touch slider Ambient light sensor MMA8451Q accelerometer MAG3110 Magnetometer 2 user LEDs 2 user push buttons Flexible power supply options – USB, coin cell battery, external source Battery-ready, power-measurement access points Easy access to MCU I/O via Arduino ™ R3 compatible I/O connectors Programmable OpenSDA debug interface with multiple applications available
including: o Mass storage device flash programming interface o P&E Debug interface provides run-control debugging and compatibility with IDE tools o CMSIS-DAP interface: new ARM standard for embedded debug interface o Data logging application
Arduino R3 compatibility
FRDM-KL46Z
TM
External Use 45
Analog Interfaces
System
Peripheral Bus
Energy Management
Power On Reset
Low Voltage Detector
Voltage Regulator
Clock Management
FLL
Timers
SRTC Temp. Compensated
I/O PortsConnectivity
I2C x 212-bit DAC
HSCMP
Flash128-256K
RAM16-32K
Debug(SWD)
COP
RST
Unique ID
DMA 4-ch
TSI x 16ch
Up to 80 GPIO(4 High Dive)
w/ 25 interrupt
LPO(1KHz
)
RST/Input
LPTMR
Crystal Oscillator (low & high
range)
16b LPTPM 6ch x1, 2ch x 2
SPI x 2
ADC (SAR w/ DMA)12/16-bit, up to 16ch
RunOperation in: Wait VLLS
1 VLLS
0Stop/VLPS
VLLS3
UART x2
Connectivity
USB FS/LS Transceiver
V Regulator
HMI
PLL
ARM Cortex-M0+ Core Ultra-low power48MHz bus freq.
Packages: 64LQFP, 100LQFP, 121MBGA
LPUARTx1
IISx1
USB Controller
PIT2ch, 32bit
Kinetis L Series: KL46 Family Block Diagram
LS Osc(32KHz)
ULP Osc(4MHz)
Segment LCD51x8/55x4
TM
External Use 46
Volvemos a FRDM-KL46Z
TM
External Use 47
OpenSDA
TM
External Use 48
Ejemplo 1“Demo de KL-46Z”
TM
External Use 49
Ejemplo 1 - “Demo de KL-46Z”1-Saque la placa FRDM de su caja2-Conecte el cable USB mini a su PC3-Probablemente sea necesario instalar el driver del adaptador serie. En tal caso; siga los pasos para instalar driver de dispositivo USB en Windows, elija la opción “Instalar automáticamente”
TM
External Use 50
Ejemplo 1 - “Demo de KL-46Z”
4-Verificar en el panel de control el puerto COM en el que se ha instalado el puerto serie virtual CDC del OpenSDA.
5-Abrir la terminal una terminal de puerto serie. En nuestro caso contamos con “putty” que está en la ruta siguiente:Escritorio\Workshop Aplicaciones con Cortex M de Freescale\Terminal\hercules.exe
6-Seleccione la configuración para el puerto serie para que trabaje a 115200,8,N,1 y abra el puerto indicado para este driver
TM
External Use 51
7-Probar las prestaciones de la placa de acuerdo con la siguiente descripción comenzando por presionar el botón de reset
Ejemplo 1 - “Demo de KL-46Z”
TM
External Use 52
Ejemplo 1 - “Demo de KL-46Z”
8-Verifique la información que se muestra en el puerto serie.9-¿Que significan los datos?
TM
External Use 53
Ejemplo 2 – OpenSDA como bootloader MSD
TM
External Use 54
Ejemplo 2 – OpenSDA como bootloader MSD1-Busque en un administrador de archivos el disco extraíble FRDM-KL46Z.
2-Busque la carpeta con las aplicaciones pre-compiladas Escritorio\FRDM_KL46Z_QSP\FRDM-KL46Z_QSP\Precompiled Examples\5-Copie de esta carpeta y pegue en el disco extraíble, las aplicaciones de la carpeta de arriba: freedom_red_led_freedom.srec, freedom_green_led_freedom.srec y sLCD_freedom_freedom.srec6-Vea feedback por la terminal de puerto serie
TM
External Use 55
Ejemplo 3 – Bootloader del Bootloader“Cambiando la funcionalidad de la interfaz OpenSDA”
TM
External Use 56
Ejemplo 3 – Bootloader del Bootloader
1-Desconecte la placa del USB2-Presione botón de reset3-Conecte USB con botón de reset presionado4-Suelte botón de reset5-Aparecerá un nuevo disco extraíble (BOOTLOADER)6-Ir a la carpeta: Escritorio\FRDM_KL46Z_QSP\FRDM-KL46Z_QSP\OpenSDA Applications\7-Programar copiando y pegando en el disco extraíble la aplicaciónDEBUG-APP_Pemicro_v108.SDA
TM
External Use 57
8-Desconectar USB y volver a conectarlo9-Instalar los drivers (Pide dos drivers, CDC y Debugger)10-Debe quedar instalado el debugger y el CDC como se ve debajo11-Tomar nota del número de puerto serie virtual12-Modificar en la terminal para conectarse al puerto serie virtual nuevo, si este ha cambiado
Ejemplo 3 – Bootloader del Bootloader
TM
External Use 58
Ejemplo 4 – Mi Primer Proyecto con CodeWarrior
TM
External Use 59
1-Abrir CodeWarrior: Inicio->Programas->Freescale->Freescale CodeWarrior->CW for MCU v10.6->CodeWarrior
Ejemplo 4 - Creación del Proyecto
2-Especificar Workspace. El workspace es una carpeta que contenerá los proyectos. Se puede especificar cualquier nombre para esta carpeta y se puede tener muchas distintas. Presionar ok.
TM
External Use 60
Ejemplo 4 - Creación del Proyecto
3-Se debe abrir el Workbench del CW que nos permitirá trabajar con nuestros proyectos.
4-En CodeWarrior workbench, ir a [File -> New -> Bareboard Project]
5-Ingrese el nombre del proyecto, por ejemplo “primerEj4KL46” y haga click en [Next].
TM
External Use 61
Ejemplo 4 - Creación del Proyecto
6-Con la ventana de selección del MCU, en la línea [Device or board to be used], ingrese el MCU KL46 y elija el target final MKL46Z256 de la lista, luego haga click en [Next]
7-En la ventana Connections elegimos [OpenSDA]y [Segger J-Link/J-Trace/SWO(SWD)based] y hacemor click en [Next]
TM
External Use 62
8-En la ventana Language and Build Tools Options deje todo en estado default. Revice que el lenguaje is [C] y que se halla esté tildada la opción [Software] en Floating Point, no hay hardware floating point unit (FPU) en los Kinetis L.
Nota: A partir de CodeWarrior 10.3 el soporte para Kinetis L lo da el compilador GCC, el que está seleccionado como se ve como [GCC]. Continua haciendo click en [Next].
Ejemplo 4 - Creación del Proyecto
TM
External Use 63
Ejemplo 4 - Creación del Proyecto
9-Deje las opciones por default y haga click en [Finish].
El CodeWarrior creará el proyecto y hará todos los seteos necesarios agregando la estructura de directorios y los archivos requeridos.
TM
External Use 64
Ejemplo 4 – Compilando
10-Hacemos doble click sobre main.c para ver el código en el editor, main.c está dentro de la carpeta source del proyecto que podemos ver en la venta CodeWarrior Projects.11-Compilamos el proyecto haciendo click sobre el martillo
Nota 1: si hay errores en la compilación los podemos ver en la ventana ProblemsNota 2: los resultados y la realimentación del proceso de compilación lo podemos ver en la ventana Console
TM
External Use 65
Ejemplo 4 – Descargando
12-Descargamos el proyecto al MCU haciendo click sobre el escarabajo
Nota: la primera vez que se intenta descargar un proyecto, es necesario decirle al IDE que target descargar. Si la acción provoca el siguiente mensaje:
12.1-Hay que configurar el target para hacer la descarga.Lo podemos hacer desplegando el nemú asociado al escarabajo.12.2-Hacemos click en [Debug Configurations...]
TM
External Use 66
Ejemplo 4 – Descargando
12.3-Desplegamos las opciones debajo de CodeWarrior y hacemos click en primerEjKL46_FLASH_OpenSDA. Presionamos [Debug]Nota: este procedimiento no será necesario en cuando volvamos a descargar el proyecto.
TM
External Use 67
Ejemplo 4 –Debuggeando
13-La perspectiva de debugging se abrirá automáticamente. Probamos los diferentes controles de debugging para familiarizarnos14-Cerramos la sesión al terminar presionando el botón de stop y volvemos al editor
TM
External Use 68
Ejemplo 4 – Usando CW con KL46_SC
15-Volvemos a la perspectiva de edición
16-Repetimos los pasos los pasos del ejemplo 3 para cambiar la funcionalidad de la interfaz OpenSDA. Desconectamos el Freedom de USB y lo volvemos a conectar con el reset presionado. Luego soltamos el reset.17-Copiar y pegar en el disco BOOTLOADER la aplicación siguiente:c:\Documents and Settings\Administrador\Escritorio\Workshop Aplicaciones con Cortex M de Freescale\FRDM-KL46Z_QSP\OpenSDA Applications\JLink_OpenSDA.sda
TM
External Use 69
Ejemplo 4 – Usando CW con KL46_SC
18-Desconectar la Freedom del USB y volver a conectarlo. Si nos pide instalar drivers, procedemos como lo hacemos habitualmente en Windows.19-Verificar que la herramienta está oinstalada correctamente en el Administrador de dispositivos de Windows
http://www.segger.com/opensda.htmlLicensingSEGGER created a firmware which runs on the Freescale OpenSDA platform, making it J-Link compatible. In order to make use of this firmware, the following Terms Of Use must be accepted:The firmware is only to be used with Freescale target devices. Using it with other devices is prohibited and illegal.The firmware is for use with evaluation boards only. It is not for use with custom hardware.The firmware may only be used for development and/or evaluation purposes. It may not be used for production purposes.The firmware is made available without any warranty and without support.
TM
External Use 70
Ejemplo 4 – Usando CW con KL46_SC20-Compilamos y descargamos la aplicación nuevamente, repitiendo los pasos 11 y 12, pero ahora ante el cuadro de dialogo que nos pide elegir la herramienta seleccionamos platinum_FLASH_Segger J-Link_Trace.Aceptar las condiciones de licencia de Segger.
21-Debuggear la aplicación.22-Finalizar la sesión de debugging y volver a la perspectiva de edición.23-Reestablecer el debugger de P&E siguiendo los pasos 1 a 8 del Ejemplo 3
TM
External Use 71
Ejemplo 5 – Agregamos control de GPIO a mamo
TM
External Use 72
Ejemplo 5 – Configuración de puertos
• Cada pin tiene un registro PCR (32-bit) dedicado. • Ejemplo.: En nuestro MKL46 de 100 pines, “Pin 26” corresponde con
PORTE bit 29 tiene el registro asociado PORTE_PCR29, en el que puedo configurar solo para este pin :− Interrupt flag (w1c )− Interrupt configuration : int/dma, edge/level, low/high, rising/falling/both− Mux control : can select Disabled (analog) or Alternate function Alt1 -> Alt7− Drive Strenght low/high− Open drain yes/no− Slew Rate : fast/slow− Pull Resistor Enable : yes/no, pull-up or pull-down− Passive filter enable : optional passive lowpass filter (10-30MHz BW )
Los seteos configurados en PCR siempre tienen afecto, sin importar que módulo se conectó al pin a travéz del MUX
TM
External Use 73
Configuración de puertos – Clock Gating
TM
External Use 74
Configuración de puertos – PIN MUX – PORTx_PCRxx
TM
External Use 75
Configuración de puertos - Control del puerto
TM
External Use 76
Configuración de puertos - Ejemplo
Habilito el clock
// Habilitación de clock para GPIOSIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK| SIM_SCGC5_PORTB_MASK| SIM_SCGC5_PORTC_MASK| SIM_SCGC5_PORTD_MASK| SIM_SCGC5_PORTE_MASK );
Habilito pin como GPIO
PORTE_PCR29 = (PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK);
Seteo valor inicial
GPIOE_PSOR = (1<<29);
Lo configuro como salida
GPIOE_PDDR = (1<<29);
TM
External Use 77
Ejemplo 5 – Manejo de GPIO
1-Importamos las fuentes que nos permiten manejar las GPIO al proyecto anterior.
2-Parados sobre la carpeta Sources del proyecto, hacemos click con el botón derecho y elegimos Import…
3-Desplegamos [General] y elegimos [File System], luego presionamos [Next].
TM
External Use 78
Ejemplo 5 – Manejo de GPIO
4-Elegimos [Browse].5-Navegamos hasta Escritorio\Workshop
Aplicaciones con Cortex M de Freescale\Fuentes de Ejemplo\Ej5\ y presionamos [Aceptar].
6-Desplegamos [General] y elegimos [File System], luego presionamos [Next].
7-Tildamos gpio.c y gpio.h y presionamos [Finish].
8-Editamos la función main para hacer parpadear los leds que están el PTD5 y PTE29.
9-Compilamos y descargamos el programa al MCU.
TM
External Use 79
Ejemplo 5 – Manejo de GPIO
10-¿Se ven los leds parpadear?
11-¿Qué debemos hacer para que se vean parpadear?
12-¿Cómo lo haríamos de manera más elegante?
13-¿Cómo puedo hacer para controlar la frecuencia de parpadeo?
TM
External Use 80
Ejemplo 6 – GPIO+Systick
TM
External Use 81
Systick
• Timer de 24-bits que está en el core, cuente en forma descendente desde el valor de recarag a cero. Cuando llega a cero, se recarga con el valor almacenado en el registro SYST_RVR y sigue contando. Permanece detenido cuando el debugger encuentra un breakpoint.
• Este timer lo comparten todos los Cortex M de ARM independientemente del fabricante porque forma parte del core como el NVIC. Sus registros se encuentran en las mismas posociones en todos los MCUs
TM
External Use 82
Systick
TM
External Use 83
Ejemplo 6 – GPIO+Systick
1-Importamos las fuentes que nos permiten manejar el Systick
2-Navegamos hasta Escritorio\Workshop Aplicaciones con Cortex M de Freescale\Fuentes de Ejemplo\Ej6\ y presionamos [Aceptar].
3-Desplegamos [General] y elegimos [File System], luego presionamos [Next].
4-Tildamos SysTick.c y SysTick.h y presionamos [Finish]. La carpeta Sources del proyecto debe quedar como indica la figura
TM
External Use 84
Ejemplo 6 – GPIO+Systick
6-Agregamos acceso a las funciones de Systick en main.c
7-Inicializamos Systick para interrumpir cada 1ms8-Compilamos y descargamos el programa.9-Colocamos un breakpoint en la línea indicada dentro
de la rutina de interrupción del Systick y corremos el programa para ver si el Sistick está operativo
10-¿Cómo hacemos para que el Systick controle la conmutación del led en el loop principal de programa y que esta sea cada 1s? De este modo podemos prescindir de la demora por software que usamos.
11-¿El parpadeo es cada 1s?¿Porqué?
TM
External Use 85
12-Repita los pasos 1 a 4 para importar oscilador.c y oscilador.h
Ejemplo 6 – GPIO+Systick
13-Agregamos acceso a las funciones de oscilador en main.c14-Inicializamos el oscilador15-Compilamos y descargamos el programa.16-¿Cuál es la frecuencia parpadeo?
TM
External Use 86
Ejemplo 7 – Usamos los ejemplos de Freescale
TM
External Use 87
Ejemplo 7 – Usando CW con KL46_SC
1-Cerramos el proyecto anterior.2-Importamos un proyecto de ejemplo del paquete KL46_SC, para esto vamos a File->Import…3-Seleccionar General->Existing Projects into Workspace y presionamos Next
TM
External Use 88
Ejemplo 4 – Usando CW con KL46_SC
6-Asegurarse que el tilde Copy Projects into Workspace no esté seleccionado. Presionar [Finish]
4-Presionar [Browse…] para buscar el proyecto según indica la figura5-Presionar [Aceptar]
TM
External Use 89
Ejemplo 4 – Usando CW con KL46_SC7-Hacemos doble click sobre paltinum.c
TM
External Use 90
Ejemplo 4 – Usando CW con KL46_SC
7-Compilamos la aplicación haciendo click sobre el martillo
8-Si no hubo errores, descargar la aplicación presionando el escarabajo
9-Elegir platinum_FLASH_OpenSDA, que es nuestra herramienta
TM
External Use 91
Ejemplo 4 – Usando CW con KL46_SC
10-Probar controles de debugging11-Verificar mensaje en la terminal serie
12-Volvemos al editor y cerramos el proyecto
TM
External Use 92
Ejemplo 8 –Proyecto nuevo y manejo de GPIO con KL46_SC
TM
External Use 93
Clonando proyecto platinum
1-Ejecutar Escritorio\Workshop Aplicaciones con Cortex M de Freescale\kinetis_kl46_sc_rev2\klxx-sc-baremetal\build\cw\ make_new_cw_project.exe
2-Ingresar nombre del proyecto y presionar Enter. EL nombre del proyecto puede ser Ej8KL46
3-Presionar Enter para cerrar el script.
TM
External Use 94
Estructura Necesaria del Proyecto Clonado
Vemos el proyecto creado.Ahora necesitamos copiar algunas fuentes porque el proyecto quedó configurado para buscarlas en la ruta indicada en la figura de la izquierda. Todas las fuentes están en la carpeta src; las comunes, los drivers y las aplicaciones y fuentes propias de cada proyecto.
El proyecto nuevo se ha creado de forma compatible con la estructura de proyectos del paquete KL46_SC que tiene soporte para gran cantidad de periféricos del MCU y para las plataformas de desarrollo como la FRDM que estamos usando.
TM
External Use 95
Importando el nuevo proyecto
1-Importamos el nuevo proyecto repitiendo los pasos 2 a 6 del proyecto anterior2-Intentamos abrir las fuentes creadas por default en el proyecto, obtendremos el mensaje de error que se muestra en la pantalla. Esto sucede porque el proyecto es un clon del proyecto base platinum, que probamos en el ejemplo anterior, y no sus fuentes.
TM
External Use 96
Importando las fuentes necesarias3-Borramos las fuentes de la carpeta project4-Creamos una carpeta con el nombre del proyecto dentro de la ruta siguiente Escritorio\Workshop Aplicaciones con Cortex M de Freescale\kinetis_kl46_sc_rev2\klxx-sc-baremetal\src\projects\5-Copiamos allí las fuentes de la carpeta Escritorio\Workshop Aplicaciones con Cortex M de Freescale\Fuentes de Ejemplo\Ej8\6-Importamos a project las fuentes de la carpeta anterior
La carpeta project debe quedar como indica la figura de la derecha
Nota: No debe tener el tilde en Overwrite existing…
TM
External Use 97
Compilando el proyecto
7-Si hacemos click sobre el nombre del proyecto para resaltarlo y luego presionamos el botón derecho, al abrirse el menú elegimos Clean Project para eliminar archivos generados que pueden hacer fallar la compilación
9-Debuggeamos el proyecto presionando el ícono del escarabajo10-Probamos la funcionalidad del proyecto anterior
8-Compile el proyecto seleccionando Project Build Project o click en el ícono del martillo
TM
External Use 98
Agregando código
8-Cerramos la sesión de debugging.9-Editamos platinum.c:
Agregamos #include “GPIO.h”
Agregamosgpio_init();
Modificamos el lazo principal para que quede:
LED1_OFF;LED2_OFF; ch =in_char();
LED1_ON; LED2_OFF;out_char(ch);LED1_OFF;LED2_ON;10-Compilamos y debuggeamos paso a paso la aplicación
TM
External Use 99
Problema
11-Nos encontramos con un problema; si no debuggeamos por pasos no vemos los leds.¿Cómo lo resolvemos?Modificamos agregando demoras y volvemos a compilar y debuggear pero ahora haciendo correr el programa12-Probamos los cambios y cerramos la sesión de debugging y el proyecto13-Cerramos la sesion de debugging, volvemos al editor y cerramos el proyecto.
TM
External Use 100
Ejemplo 9 - PE
• Programaremos un LED con una frecuencia fija de blinking
LEDs Rojo y Verde
KL46Z256VLL4
PTD5(ROJO)PTE29/TPM0_CH2(VERDE)
TM
External Use 101
Concepto
• Hay muchas formas de hacer parpadear un LED. • Usaremos un PWM lento para cambiar el estado del pin de I/O.• Usaremos CW10.6 y Processor.• Necesitamos los componentes siguentes de PE:
− CPU (Cpu:MKL46Z256VLL4), setear oscilador externo y habilitar el PLL.
− Timer Unit (TimerUnit_LDD), en modo PWM para generar una señal de blinking lenta.
TM
External Use 102
Componentes Cpu:MKL46Z256VLL4
• Es el componente básico del proyecto, es agregado en forma automática.
• La CPU, el PLL, etc. son motorizados por el Multipurpose Clock Generator (MCG), y este asu vez por el oscilador externo (OSC).
TM
External Use 103
Clock del Sistema
Bus 24 MHz
CPU48 MHz
96 MHz
8.0 MHz
TPM 48 MHz
TM
External Use 104
Configuración de Componente Cpu:…
• Propiedades− System oscillator 0: enabled - switch osc on− Clock source: External crystal - use crystal− Clock frequency: 8.0 - crystal frequency− MCG mode: PEE - enable PLL mode − PLL output: 96.0 - set PLL frequency− Core clock: 48.0 - set CPU frequency− Bus clock: 24.0 - set bus frequency
• Methods− none
• Events− none
TM
External Use 105
Componente: TimerUnit_LDD (TPM-Mode)
• Basado en Timer/PWM Module (TPM)
El TPM està hecho en base al timer simple de los MCU de o bits de Freescale (HCS08 Timer PWM Module – TPM). El TPM funciona en los modos de bajo consumo
TM
External Use 106
Funcionalidad del Timer
El contador del TPM0 cuenta con un período de 175ms configurado como “Period value”.Cuando el contador alcanza el valor “Compare” del canal 0 configurado en 80ms setea la salida. Cuando el contador se reinicia, la salida se resetea.
Time
Co
unte
r va
lue
Counter period
Channel 0 offset value
TMP0_CH1 output pin state (LED)
TM
External Use 107
Configuración de Componente TimerUnit_LDDblinking LED demo
• Propiedades− Counter: TPM0_CNT- Timer/PWM Mode− Counter frequency: 375 kHz - set input frequency− Overrun period:174.763 ms- set PWM frequency− Channel list: 1 - use one channel− Mode: Compare - channel is compare− Compare: TPM0_C1V - compare register− Offset: 80 ms - ~50% duty cycle− Output on compare:Set - behavior on compare− Output on overrun: Clear - behavior on overrun− Output pin: ADC0_SE5b/PTD1/…− Auto initialization: yes - called from the CPU
• Methods− none
• Events− none
TM
External Use 108
Creación del Proyecto
1-En CodeWarrior workbench, ir a [File | New | Bareboard Project].
2-Ingrese el nombre del proyecto, por ejemplo “KL46Z-PE_Lab1” y haga click en [Next].
3-Con la ventana de selección del MCU, en la línea [Device or board to be used], ingrese el MCU KL46 y elija el target final MKL46Z256 de la lista, luego haga click en [Next]
TM
External Use 109
Creación del Proyecto
4-En la ventana Connections elegimos [OpenSDA]y [Segger J-Link/J-Trace/SWO(SWD)based] y hacemor click en [Next]
5-En la ventana Language and Build Tools Options deje todo en estado default. Revice que el lenguaje is [C] y que se halla esté tildada la opción [Software] en Floating Point, no hay hardware floating point unit (FPU) en los Kinetis L.
6-A partir de CodeWarrior 10.3 el soporte para Kinetis L lo da el compilador GCC, el que está seleccionado como se ve como [GCC]. Continua haciendo click en [Next].
TM
External Use 110
Creación del Proyecto
7-En la ventana Rapid Application Development eleja [Processor Expert] y deje [Use current perspective]. Elija [Standalone]en Project Mode y go haga click en [Finish].
El Processor Expert creará el proyecto y hará todos los seteos necesarios agregando la estructura de directorios y los archivos requeridos, esta estructura se puede ver en ProcessorExpert.pe en la carpeta de proyecto.
TM
External Use 111
Configuración de los Componentes
8-Abra la vista de Processor Expert seleccionando Processor Expert Show view:
9-Seleccione la CPU en la ventana Components, como se muestra debajo10-Elegir vista avanzada
11-Configuramos el oscilador como se muestra en la imágen siguiente del Component Inspector
TM
External Use 112
Configuración de los Componentes
Las líneas en rojo indican errores producidos por seteos que no pueden lograrse.Los cambios que debemos hacer respecto del default son los siguientes:• System Oscillator 0: Enabled• Clock Frequency: 8MHz• MCG Mode: PEE• PLL module: Enabled• PLL output: 96MHz• Core Clock: 48MHz• BUS Clock: 24MHzAl terminar los seteos, todos los errores deben desaparcer quedando todo el texot en negro.
TM
External Use 113
Configuración de los Componentes
12-Abrir Component Library y seleccione y arrastre TimerUnit_LDD de Components Library a Components view del proyecto:
13-Renombre el componente ”TimerUnit_LDD” de TU1 a PWMTimer usando el botón derecho para abrir el menú de contextocomo se muestra debajo:
TM
External Use 114
Configuración de los Componentes
14-En el Component Inspector de [PWMTimerB/ Properties] setee los siguientes valores (Cambie a la vista a Advanced o Expert ):
15-Se debe elegir el pin de salida, en nuestro caso PTE29 y cambiará la selección de compare a TMP0_C2V.Cambios:1. Counter: TMP0_CNT2. Counter Frequency: 375kHz3. Overrun Period:
174,762667ms4. Channel List: 15. Mode: Compare6. Compare: TPM0_C2V7. Offset: 80ms8. Output on compare: Set9. Output on overrun: Clear10. Initial State: Low11. Output pin Signal: PTE2912. Autoinitialization: yes
TM
External Use 115
Configuración de los Componentes
16-Ahora hay que ejecutar el generador de código de Processor Expert (PEx) presionando generate button en Components view:
17-Para simplificar la vista, reseteamos la vista de la perspectiva actual usando el menu [Window Reset Perspective]
TM
External Use 116
Código Fuente
18-Luego de la generación de código, el proyecto tiene nuevos archivos que pueden verse en CodeWarrior Projects. Abrir el archivo Source\main.c con doble-click en él. Se abrirá en el editor.
19-En el editor de main.c exploremos la función main(void).
La función PE_low_level_init() inicializa todos los drivers de bajo nivel generados por Procesor expert y también el componente PWMTimer.
TM
External Use 117
Compilar y correr el proyecto
20-Compile el proyecto seleccionando Project Build Project o click en el ícono del martillo
21-Conecte el cable USB a la placa
22-Comience la sesión de debugging haciendo click en el botón de debug, compilará y linkeará todo el proyecto. Dependiendo de la configuración del debugger, elija el que correspondapara FRDM-KL46Z board. Puede ser OpenSDA o Segger J-Link. El debugger de CodeWarrior’s comenzará la descarga del binario ejecutable a la Flash del MCU target.
TM
External Use 118
Compilar y correr el proyecto
23-Luego de que finalice la descarga, la vista de la pantalla cambiará a la perspectiva de Debug. Si no cambia, cambiela usted haciendo click en el botón Debug como se muestra en la figura
Nota: El duty cicle de la señal podrá cambiarse con el offset en PWMTimer.25-Probar que pasa cambiandolo
24-Comience la ejecución de la aplicación presionando [F8] o el ícono Resume
El LED rojo de la FRDM-KL46Z comenzará a parpadear. Estamos generando una señal PWM de 5.7 Hz con un duty cycle de aprox. 50%.
TM
External Use 119
Variante
• Los LEDs de la placa están conectados del modo siguiente:− LED ROJO a PTE29/TMP0_CH2− LED VERDE a PTD5/TPM0_CH5
25-Agregue al componente PWMTimer el canal del LED VERDE para hacer lo mismo que hicimos pero con ambos LEDs.
26-Modifique el ejercicio anterior para que el comportamiento de los LEDs sea inverso.
TM
© 2014 Freescale Semiconductor, Inc. | External Use
www.Freescale.com
Muchas gracias