Tutorial1 1
Tutorial1 1
SFWRENG/MECHTRON 3K04
McMaster University
Michael Kehinde
[email protected]
Topics Covered
• The pacemaker as an embedded system
• What am I building? Vision, goal and scope of the pacemaker project
Embedded systems are all around us. If you use a thermostat to keep your
room warm so you can attend your online lectures comfortably,
if you use a laundry machine to do
your laundry, if you use a dishwasher
to wash your dishes, or a microwave
to heat up your food — you have in-
teracted with a machine with an em-
bedded system. From the modules in
a digital camera to the engine control
unit in an industry airplane, embed-
ded systems are an integral part of
life in our modern world.
For our purposes, the pacemaker system is based on a MCU called the FRDM-
K64F (K64F). The K64F has most of the components shown in Figure
4 built into the board. For more information on the board’s features, re-
fer to: https://os.mbed.com/platforms/FRDM-K64F/ and https://inst.
eecs.berkeley.edu/~ee192/sp18/files/FRDMK64FUG.pdf.
the processor are stored in program memory; the data being manipulated
by the processor is stored in data memory. Celebrated for its high speed,
long life and electrical programmability, flash memory is the most common
program memory type in embedded systems. Flashing is a term that refers to
the process of writing a program to flash memory. Once the K64F is flashed,
it will execute the program every time the board is powered on. A typical
flash memory layout has a bootloader area and a program area. A bootloader
is a type of firmware (software that is “firm” — not intended to change)
that is executed before the main program. The bootloader contains the code
that communicates with your personal computer, accepts the main program
file/binary, and writes it to the program area.
it helps the pulse generator measure or generate time intervals that synchronize
the timing of the pulse generation or sensing operation.
Serial Communication Ports: provide an interface for serial communica-
tion with external devices. Serial communication is a process where data is
sent one bit at a time over a communication channel. Serial communication
is used by the K64F when you flash or debug pacemaker software, or when
you operate the DCM. Serial communication will be explored in more detail
in Tutorial 5 — Serial Communication.
Interrupt Controller: an interrupt controller listens to peripherals for events
and reports to processor once an event, an “interrupt”, occurs. The use of
interrupts is often contrasted with a process called polling. Polling is when
the software actively checks the status of external devices. Interrupts improve
the performance and power consumption of the embedded computer because
less operations are required from the processor.
Parallel Ports: a parallel port, or General Purpose Input and Output
(GPIO), is an input output communication interface that allows the embed-
ded computer to exchange digital information with the external world. The
pins that come out of the microcontroller board are mapped to GPIO. Pins
(or pin headers) provide electrical contact with the GPIO. A pinout is a visual
map of the microcontroller pins to their functions. Functions include digital
I/O, analog I/O and Pulse Width Modulation (PWM) (more on PWM in
Tutorial 2 — Pacing Basics). Figure 6 is a pinout of the FRDM-K64F
Goal Design and implement system that operates a cardiac pacemaker under
the specified modes.
Scope Design and implement the embedded pacemaker software, and the
driver software and user interface for the DCM. You are also required to verify
and document your software.
Deliverables
• MATLAB Simulink® model implementing the pacemaker operating modes
• DCM software
• Technical Documentation
• Live demonstration
Development Paradigm
A model-driven development (MDD) paradigm will be used develop the
pacemaker software. MDD “uses models as the primary artifact in the de-
velopment process” (definition from: IGI Global). MDD is important in em-
bedded systems because it reduces development time, improves collaborative
development, leads to increased software quality and reliability, and produces
software that is less error prone when compared to traditional design processes.
MDD is prominent in embedded system development across many industries
today.