with freescale microcontrollers
TRANSCRIPT
External Use
TM
Hands-on Workshop: Design
Healthcare Applications
with Freescale Microcontrollers
FTF-HCR-F0197
A P R . 2 0 1 4
Alejandra Guzmán | Applications Engineer
TM
External Use 1
Agenda
• Non-Communicable diseases
• Portable healthcare applications
• Measurement Engine
• Pulse Oxymetry
• Lab 1: Measure the % of oxygen on your blood stream
• Low Power
• Lab 2: See RTC wakeup functionality
TM
External Use 2
What Kills More People Worldwide ?
Noncommunicable diseases - 2011
Noncommunicable diseases - 2000
66% 36 million
Data gather from the world health organization
60% 31 million
TM
External Use 3
Non-communicable diseases 1. Cardiovascular 2. Cancer 3. Diabetes 4. Chronic lung diseases
Data gather from the world health organization
TM
External Use 4
Non-Communicable Diseases
2.8
million died each year
(ie.: a consequence of being
overweight or obese) 9% of adults aged 25 and over
had high blood glucose in
2008
40% of adults aged 25
and over had high
blood pressure in
2008
80% of premature heart disease, stroke and
diabetes can be prevented
Data gather from the world health organization
TM
External Use 5
Portable Healthcare Applications
TM
External Use 6
General Architecture of a Healthcare device
Connectivity
Ethernet
USB
MCU/MPU
Audio
Codec Power
Mgmt.
Vref RTC
Sensors
Signal Conditioning
Actuators
Touch
Sensors
Freescale
Offering
Energy
Harvesting
DAC
ADC
EEPROM
Wi-fi
LCD
Driver
BT/LE
Zigbee®
TM
External Use 7
Kinetis L Series Product Roadmap Energy Efficiency, Scalable, Mixed-Signal 32-bit MCUs, Based on ARM® Cortex-M0+™
Kinetis L Series
Memory Density 32KB 64KB 128KB 256KB 8KB 16KB
Inte
gra
tio
n &
Pe
rfo
rma
nce
KL02
KL16 – w/ 16bit ADC, DAC, TSI, I2S KL15 – w/ 16bit ADC, DAC, TSI KL14 – General Purpose
KL05 – w/ RTC, DMA, DAC, TSI KL04 – w/ RTC, DMA KL02 – Entry Level
KL26 – w/ 16bit ADC, DAC, TSI, I2S KL25 – w/ 16bit ADC, DAC, TSI KL24 – USB
KL36 – w/ 16bit ADC, DAC, TSI, I2S KL34 – SLCD
KL46 – SLCD + USB w/ 16bit ADC, DAC, TSI, I2S
KL02 KL02
KL04 KL04 KL04
KL05 KL05 KL05
KL14 KL14
KL15 KL15 KL15
KL16 KL16 KL16 KL16
KL24 KL24
KL25 KL25 KL25
KL26 KL26 KL26 KL26
KL34
KL36 KL36 KL36
KL46 KL46
TM
External Use 8
Pe
rfo
rman
ce
Memory Density 32KB 64KB 128KB 256KB 512KB 1MB
50 MHz
72 MHz
100 MHz
120 MHz
150 MHz
Kinetis K Series
Kinetis K-Series Product Roadmap ARM Cortex-M4 solutions for a wide range of embedded applications
2MB
K1x – Baseline
K30 – SLCD
K40 – SLCD + USB
K60/K61–Ethernet w/optional Tamper
K70 – Graphics
K2x – USB
K5x – Measurement ( Medical )
K10D / K20D
180 MHz
Production
K10D / K20D K10D / K20D
K30D / K40D K30D / K40D K30D / K40D
K10D / K20D K10D / K20D K10D / K20D
K30D / K40D K30D / K40D K30D / K40D
K5xD K5xD
K60D K60D
K10F / K20F K10F / K20F
K60F / K61F K60F / K61F
K70F K70F
K60F / K61F K60F / K61F
K70F K70F
K11D / K21D
K12D / K22D
K11D / K21D
K12D / K22D
K11D / K21D
K12D / K22D
K24F
K64F K63F / K64F
K11 – Baseline w/Tamper MCUs
K24 – USBs MCU w/ extended RAM
K63/K64–Ethernet w/ optional Tamper
TM
External Use 9
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
K30 Family M4 / 72-100MHz
64-512KB
64-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
K20 Family M4 / 50-120MHz
32KB-1MB
32-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
K10 Family M4 / 50-120MHz
32KB-1MB
32-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
K40 Family M4 / 72-100MHz
64-512KB
64-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-100MHz
128-512KB
64-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
K60 Family 100-150MHz
256KB-1MB
100-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-150MHz
512KB-1MB
196-256pin
+ USB
+ Segment
LCD
+ Segment
LCD
+ USB
+ Ethernet
+ Encryption
+ Tamper Detect
+ DRAM Controller
8/16-bit
MCU
+ 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 I
KL0 Family M0+ / 48MHz
8KB-32KB
24-48pin KL10 Family M0+ / 48MHz
32KB-256KB
32-80pin
KL30 Family M0+ / 48MHz
64KB-256KB
64-121pin
KL40 Family M0+ / 48MHz
128KB-256KB
64-121pin
KL20 Family M0+ / 48MHz
32KB-256KB
32-121pin
+ Analog Engine
+ Ethernet
+ Encryption
Kinetis Family Compatibility K – L Series
TM
External Use 10
SWD
Interface MTB
Interrupt
Controller
ARM Cortex-M0+
48MHz
DMA
BME
Low-
Leakage
Wakeup
Program Flash
32-256KB
SRAM
4-32KB
Low & High
Frequency
Oscillators
4MHz/
32KHz IRC
Unique ID 16ch 12/16-
bit SAR
ADC
High Speed
Analog
Comparator
6ch
Timer/PWM
Low Power
Timer
Periodic
Interrupt
Timers
RTC
Low Power
UART
UART x2
Up to 80
GPIO
with 25
Interrupt
/4 high drive
Core System Memories Clocks
Security
and Integrity
Analog Timers Communication Interfaces HMI
SPI x2
2x 2ch
Timer/PWM
Internal
Watchdog
I2S
32-Byte
Register File
1KHz LPO
FLL/PLL
I2C x2
16ch Touch
Sensor
Interface 12-bit DAC
USB FS
OTG
USB Voltage
Regulator
Kinetis L Series
Kinetis KL2x Family
TM
External Use 11
Kinetis K50 Family
Core
ARM® Cortex™- M4
72/100 MHz
Debug
Interfaces DSP
Interrupt
Controller
System Memories Clocks
Timers Communication
Interfaces
HMI Analog Security
and Integrity
Internal and
External
Watchdogs
Memory
Protection Unit
(MPU)
DMA
Low–Leakage
Wake-Up Unit
Program Flash
(64 to 512 KB)
FlexMemory
(32 to 256 KB)
(2 to 4 KB EE)
Serial
Programming
Interface
(EZPort)
SRAM
(32 to 128 KB)
External Bus
Interface
(FlexBus)
Phase-Locked
Loop
Low/High-
Frequency
Oscillators
Internal
Reference
Clocks
Flequency-
Locked Loop
Cyclic
Redundancy
Check (CRC)
16-bit ADC
PGA
Analog
Comparator
with 6-bit DAC
12-bit DAC
Voltage
Reference
FlexTimer
Carrier
Modulator
Transmitter
Programmable
Delay Block
Periodic
Interrupt
Timers
Low-Power
Timer
Independent
Real-Time
Clock (RTC)
Secure Digital
Host Controller
(SDHC)
I2C
UART
(ISO 7816)
IEEE 1588
Ethernet MAC
SPI
I2S GPIO
Xtrinsic Low-
Power Touch –
Sensing
Interface
Standard Feature
Optional Feature
Segment LCD
Controller
USB OTG
(LS/FS/HS)
USB Voltage
Regulator
USB Device
Charger Detect
(DCD)
Random
Number
Generator
Cryotographic
Acceleration
Unit (CAU)
OPAMP
TRIAMP IEEE® 1588
Timer
Kinetis K Series
TM
External Use 12
Standard Feature
Optional Feature
Debug
Interfaces DSP
Interrupt
Controller Floating Point
Unit (sFPU)
ARM Cortex-M4
Up to 120 MHz
Internal and
External
Watchdogs
Memory
Protection Unit
(MPU)
16-ch DMA
Low-Leakage
Wake-Up Unit
Program Flash
(Up to 1MB)
SRAM
(256KB)
External Bus
Interface
(FlexBus)
Serial
Programming
Interface
(EzPort)
Phase-Locked
Loop
Frequency-
Locked Loop
Low/High
Frequency
Oscillators
Internal
Reference
Clocks
Cyclic
Redundancy
Check (CRC)
Up to 2 x16-
bit ADC
3 x ACMP
Up to 2 x
12-bit
DAC
FlexTimer
Programmable
Delay Block
Periodic
Interrupt
Timers
Low-Power
Timer
Independent
Real-Time
Clock (RTC)
3xI2C 1xI2S
3xSPI
1 x USB OTG
(LS/FS) +
PHY
6xUARTs
Secure
Digital Host
Controller
(SDHC)
GPIO
Core System Memories Clocks
Security
and Integrity
Analog Timers Communication Interfaces HMI
USB
Voltage
Regulator
IEEE 1588
Ethernet
MAC DRY ICE
Cryptographic
Acceleration
Unit (CAU)
Random
Number
Generator
Up to 4KB
EEPROM
(Flexmemory)
CAN
Vref
Kinetis K63 – K64
Kinetis K Series
TM
External Use 13
+/-250mV analogue I/O pads with 6kV PESD
Kinetis M Series
Kinetis M Series
TM
External Use 14
Hardware System
Open source hardware
platform for prototyping
application development
+ CodeWarrior IDE
Visual and automated
framework to accelerate
development time
Create, configure,
optimize, migrate,
and deliver
software components
+ Processor Expert + Freescale MQX
Comprehensive solution
for embedded control
and connectivity
MQX Core
PSP & BSP
Complimentary MQX RTOS
+ Freemaster
Real-time debug monitor
and
data visualization tool
Kinetis Tools Freescale Microcontroller Enablement Bundle
TM
External Use 15
Product Longevity
• Freescale has a product longevity program for the
market segments that we serve.
• For the automotive and medical segments, Freescale has a broad
range of devices available for a minimum of 15 years
• For all other segments in which Freescale participates, Freescale
has a broad range of devices available for a minimum of 10 years
• Life cycles begin at the time of launch. A list of participating
products is available at www.freescale.com/productlongevity
TM
External Use 16
Healthcare AFE Reference Platform
TM
External Use 17
Announcing the Healthcare AFE Reference Platform
• Speed development time for portable medical devices with a
complete hardware platform, schematics and software.
Gain Valuable Healthcare Expertise • Proven leader
• Medical Center of Excellence
• Leadership in Continua Health Alliance
• Strong partner ecosystem
Lower Development Costs • Reduce system cost, board size and complexity
• Scalability and analog measurement engine
• Tower System
• 15 years assured supply
Speed Time to Market • Accelerate development time
• Comprehensive design platform
• Kinetis K53 MCU
• Online, on-demand resources
TM
External Use 18
Healthcare Plug-In Boards
MED-BPM • Blood pressure monitors
• Isolation circuitry for an air
pump and escape valve,
designed for 3–3.3 V
MED-SP02 • Pulse oximetry solution
requiring an SpO2 or beats per
minute determination using
non-invasive procedures
• Reduced in size
MED-EKG • EKG, heart rate monitoring
• Scalable
MED-STETH • Digital stethoscopes, fetal
heart rate monitors
• Based on ultrasonic waves
MED-GLU • Single-board glucometer solution
• Reduced in size
• Together with Tower System, a
complete solution including serial
communications and LCD screens
MED-SPI • Spirometer solution
• Differential pressure sensor
that facilitates the
measurement of air flow and
allows calculation of lung
capacity measurement
Cardio-
vascular
Respiratory Metabolic
TM
External Use 19
External Analog Partner
• Precision analog IP is VERY important to the accuracy of
healthcare devices.
• For greater flexibility and to satisfy the needs of the most
demanding applications, Freescale partnered with Linear
Technology.
• Plug-in boards featuring Linear Technology’s Operations
Amplifiers are included for these applications:
− Pulse Oximetry
− EKG
− Blood Glucose Monitoring
− Blood Pressure Monitoring
TM
External Use 20
Precision Analog Improves Accuracy
The challenge
Increase device accuracy without increasing cost.
The FDA is requiring higher accuracy on most medical devices and changes to healthcare provide significant cost pressure.
The solution
Integrated precision analog. Integrating precise analog components such as Op Amps, Tri Amps, high resolution
ADC, and DACs.
Ideal solution
Platforms w/ Flexible Analog Freescale offers customers fully integrated analog solutions that are pin compatible and
scalable.
Freescale solutions contain key analog peripherals needed to connect to a custom analog ASIC.
TM
External Use 21
Measurement Engine
TM
External Use 22
Analog peripherals on Kinetis
• Common Features
• Family dependent
− 24-bit ∑∆ ADC only available on Kinetis M
− OPAMPs and TRIAMPs only available on Kinetis K5x
16-bit
ADC
High-Speed
Comparators VREF
PGA 24-bit
∑∆
OPAMP
TRIAMP
12-bit
DAC
TM
External Use 23
16-bit SAR ADC
• DMA support
• Single-Ended or Differential inputs
• Operation in low power modes
• Hardware conversion trigger
• Hardware average (4,8,16,32)
• Hardware compare (2 thresholds)
• External or internal voltage reference
• ENOB = 14.5 (16-bit differential)
• Self-calibration
TM
External Use 24
Comparator
• Rail to rail inputs
• 6-bit DAC for supply reference source
• Selectable interrupt: rising, falling or both edges
• Wide range of outputs: sampled, windowed, digital filter
• Two software selectable performance levels
• DMA transfer support
• Functional in all modes of operation[1]
Window & Filter functions are not available on Stop,VLPS,LLS,VLLSx
TM
External Use 25
Programmable Gain Amplifier
Designed to increase Dynamic Range
Amplifies low-amplitude signals before they are fed to the 16-bit SAR
ADC
607.8125 mV
600 mV
15.625
mV
pp592.1875
mV
1.2 V
0.2 V
0.7 V
1.2 V
0.2 V
0.7 V
607.8125 mV
600 mV
15.625
mV
pp
592.1875 mV
PGA
PGA_DP
Gain = 64
PGA_DM
ADC16
ADC16_DP
ADC16_DM
1.2 V
0.2 V
0.7 V
27306 LSB
-27307 LSB
0
VPPADC,DIF = 31.25 mVpp
TM
External Use 26
24-bit ∑∆ ADC
• 24-bit (after averaging) ∑∆ ADC with PGA
• Option to bypass the PGA
• PGA with 7 µA sensitivity
• Single ended or Differential mode
• ±250 mV (1 Vpp differential, 0.5 Vpp single ended) input range
• Supports external modulators when AFE is bypassed
• DMA request on conversion complete
TM
External Use 27
TRIAMPs & OPAMPs
Electrical OPAMP TRIAMP
Offset current ±3 mV ±3 mV
Offset voltage ±500 pV ±300 pV
Bias current ±500 pA ±300 pA
Input range 0 to
VDDA
-0.1 to
VDDA - 1.4V
• Signal conditioning
• OPAMPs provide internal gain options
• OPAMPs configurable inputs
• Specifically for limited temperature range ( 0°C to 50°C )
TM
External Use 28
12-bit DAC
• On-chip programmable reference generator output
• Voltage range from 1/4096 VIN to VIN
• VIN can be selected from two reference sources (internal, external)
• Data buffer, configurable watermark, multiple operation modes
• DMA support
TM
External Use 29
100
LQFP ADC0 PGA0 OPAMP0 DAC0
TRIAM
P0 CMP0 ADC1 PGA1 OPAMP1 CMP1 VREF CMP2
13 DP1 DP0
14 DM1 DM0
15 DP1 DP0 DM1
16 DM1 DM0
17 DP0 DP DP3
18 DM0 DM DM3
19 DP3 DP0 DP
20 DM3 DM0 DM
25 SE22 DP2 SE16 OUT DP2 IN2
26 SE16 SE21 OUT DP1 IN2
27 IN5 SE18 IN5 OUT
28 OUT DM2
29 DM
30 DP
33 SE22 IN5
34 SE23 DP4 OUT DP4 IN3
35 DP5 IN4 SE23 DP5 IN3
Analog Pinout K5x
TM
External Use 30
Sampling with the Best Current Consumption
Sample 2 ADC inputs at 48ksps without CPU load
ADC0 INA
Result 1A
Result 1B
Result 2A
Result 2B
DMA0
DMA1
INB RUN mode
96 ksps
INA
INB
ADC0
ADC1
Result Buffer A
Result Buffer B
DMA0
DMA1
48 ksps
48 ksps
VLPR mode
IDD IDDA
Run 20.8 mA 186 uA
VLPR 3.01 mA 488 uA
TM
External Use 31
Pulse Oxymetry
TM
External Use 32
Pulse Oximetry Fundamentals
• Body cells need oxygen to gain energy.
• Oxygen transport is performed by the
circulatory system.
1. Deoxygenated blood enters the heart.
2. Heart pumps blood to the lungs.
3. At the lungs, blood passes through the
alveoli, where gas exchange is performed,
leaving oxygenated blood.
4. Blood is pumped back to the aorta.
TM
External Use 33
Pulse Oximetry Fundamentals
• Blood red cells contain a protein called hemoglobin
• When oxygen reacts with this protein, it generates Oxyhemoglobin
(HbO2)
• HbO2 circulates through the body irrigating tissues. When it gets in
contact with a cell, the hemoglobin releases oxygen and becomes
Deoxyhemoglobin (Hb)
• At this point, blood without oxygen returns to the heart to
repeat the process
TM
External Use 34
Pulse Oximeter SPO2
• A pulse oximeter is the non-invasive measurement of oxygen
saturation SpO2. It works according to two physical principles:
1. The fact that oxyhemoglobin HbO2 and hemoglobin Hb have
different absorption spectra
2. The presence of a pulse wave generated by changes of
volume
TM
External Use 35
Pulse Oximeter SPO2
• Oxygen saturation (SpO2) is defined as the
ratio of oxyhemoglobin (HbO2) to the total
concentration of hemoglobin (HbO2 +
deoxyhemoglobin).
• Hb has a higher absorption at 660 nm red
and HbO2 higher absorption at 940 nm
infrared.
Red660 nm
Infrared940 nm
Ph
oto
dete
cto
r
Tissue & Bone
Venous blood
Arterial blood
DC
AC
TM
External Use 36
Pulse Oximeter SPO2
The pulse oximeter analyzes the light absorption of two wavelengths
from the pulsatile added volume of oxygenated arterial blood.
Filter & Amplification
PWM
GPIO
LED driver
Red
Infrared
Current to voltage converter
SPO2
Sensor
Infrared Voltage
ADC
Kinetis MED-SPO2
Red Voltage
TM
External Use 37
Lab 1: Measure the % of oxygen on your blood stream
TM
External Use 38
Kinetis K5x
Low Power Boards
TM
External Use 39
Low Power Board
MCU
144 MAPBGA
K51 72MHz
K50 100MHz
K60 100MHz
Analog circuitry
JTAG
Power
USB
HMI
3V coin cell or
USB power
RTC wakeup pin
Potentiometers
External temperature sensor
Medical connector
Glucose meters testing circuit
TWRPIs Segment LCD
General purpose
2 touch electrodes
2 IRQs
2 LEDs
TM
External Use 40
Kinetis
MCU
MCG
RTC
MCUPower
ADC DAC VREF
USB JTAG SPI
OpAmpsTriAmps
TSI
sLCD
GPIO
8MHz
32kHz
Battery
RTC
WakeupSwitch
TWRPI Expansion
Touchpad
Buttons
LEDs
TWRPI-
SLCD
Temp.
sensorPotentiometers
Testing
circuit
Medical
Connector
Power
Analog
HMI
Low Power Board
TM
External Use 41
Low Power Board
TM
External Use 42
Analog Features
• Five potentiometers with individual
VDDA jumpers to avoid current
draw
• Glucose meter testing circuits
• Analog oriented layout
• External temp sensor
MCU
Analog
circuitry
JTAG
Power
USB
HMI TWRPIs
TM
External Use 43
RTC Wakeup Pin
MCU
Analog
circuitry
JTAG
Power
USB
HMI TWRPIs
Supports all Kinetis low power
modes : Run, Wait, Stop, VLPR,
VLPW, VLPS, LLS, VLLS3, VLLS,
VLLS1, BAT.
BAT (back-up battery only) – The chip is
powered down except for the VBAT supply
The RTC and the 32-byte VBAT register file
for customer-critical data remain powered
TM
External Use 44
RTC Wakeup Pin
When the MCU goes into VBAT mode, the RTC circuit turns off the
MCU power source leaving only VBAT enabled.
TM
External Use 45
RTC Wakeup Pin
RTC_MOSFET comes from the output of an SR latch circuit with the
following equivalent circuit. The schematic doesn’t have a latch
circuit because we are using NOR gates to reduce costs (U5).
TM
External Use 46
RTC Wakeup Pin
RTC_WAKEUP_B = RTC_WAKEUP pin from the K50. This signal
passes through a NOT gate prior to the latch Reset input.
RTC_BYPASS = Kinetis GPIO output connected to the latch Set
input.
TM
External Use 47
RTC Wakeup Pin
Q3 is configured as a MOSFET switch that allows or interrupts the
power in the microcontroller. RTC_MOSFET line determines the
state of this switch.
oRTC_MOSFET = logical 0 3.3Vo = 3.3V
oRTC_MOSFET = logical 1 3.3Vo = 0V
3.3Vo is the MCU voltage supply
TM
External Use 48
BGM Battery Calculator
Time
Po
we
r
Control Compute
Standby
Button
Polling
Measure
Display
Standby Button Polling Measure Display
900 nA 3.8 µA 48.9 µA 3.29 mA 3.8 µA
TM
External Use 49
BGM battery calculator
BGM measurements per day 3
Duration (minutes) 2 5 2 5
Standby Button wake
up Polling
Measurement Display Data
% Time 97.08 0.42 1.04 0.42 1.04
BGM actions None Insert strip Place blood BGM
Measurement
Functions needed RTC
wakeup pin
RTC
GPIO
LCD
RTC
ADC compare
LCD
RTC
AFE
TSI
LCD
CPU / DSP
RTC
LCD
Freescale MCU mode VLLS0 VLLS1 VLPS VLPR (2 MHz) VLLS1
Freescale system power 900 nA 3.8 µA 48.9 µA 3.29 mA 3.8 µA
Exit condition Button Strip insertion Blood detection Measure done Timeout
minutes per day 1398 6 15 6 15
current per day 873.8 nA 15.8 nA 509.4 nA 13.7 µA 39.6 nA 15.1 µA
Average current µA 15.1
Battery capacity (240
mAh) 240
Battery life
Hours 15844.85
Days 660.20
Years 1.81
TM
External Use 50
LAB 2 See RTC Wakeup pin working
TM
© 2014 Freescale Semiconductor, Inc. | External Use
www.Freescale.com