Heart Alert
description
Transcript of Heart Alert
![Page 1: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/1.jpg)
HEART ALERTWireless Heart Rate Monitor
Software Design
![Page 2: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/2.jpg)
On-Person Unit MC13213 (HCS08)
16 MHz Bus Frequency On Chip Resources
60K of Flash4K of RAM
Require Resources15K of Flash2K of RAM
Timeslice KernelPeriod: 50 ms
![Page 3: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/3.jpg)
On-Person UnitTasks
Start Task Waitforslice Task Timer Task Sampling Task Rate Analysis Task Alert Task Sleep Task
![Page 4: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/4.jpg)
On-Person UnitModule List
Module Tasks Public Functions and Data
Main1.cStartTask
WaitforsliceTimerTask
SamplingTaskRateAnalysisTask
AlertTaskTimerTask
TimeStampAlertFlag
Heart Rate Data
Start08.c
Timer.cCurrentCount()ResetCount()
Count
OCDelay.c GetmSCnt()
![Page 5: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/5.jpg)
On-Person UnitModule List
Module Tasks Public Functions and Data
simple_phy.c UINT8 PDDataRequest(tTxPacket *);void PLMEMC13192ResetIndication();
mc13213.c
Several other freescale provided modules
necessary for SMAC
![Page 6: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/6.jpg)
On-Person UnitStart Task
System InitializationCPUSMACADC
PeriodRun Once out of reset
Max Execution Time~100 ms
![Page 7: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/7.jpg)
On-Person UnitWaitforslice Task
Waits for the remainder of the timeslice period to pass before exiting to the next task
Period50 ms (periodic)
![Page 8: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/8.jpg)
On-Person UnitTimer Task
A timer used to deduce the period of the heart beat and thus how many beats per minuteAccuracy: ±50 ms
Period 50 ms (periodic)
Max Execution Time0.5 ms
![Page 9: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/9.jpg)
On-Person UnitSampling Task
Turns on LED, Optical Sensor, Instrumentation Amplifier and takes 100 ADC samples
Period50 ms (periodic)
Max Execution Time8 ms3 ms (typical)
![Page 10: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/10.jpg)
On-Person UnitRate Analysis Task
Analyze the heart rate data byAveraging the 100 ADC SamplesDeciding if period has occurredObtaining time elapsed since previous peakCalculating Heart Rate in beats per minuteComparing to acceptable rangeSetting Alert Flag
Period50 ms
Max Execution Time5 ms
![Page 11: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/11.jpg)
On-Person UnitAlert Task
Will send the alert signal to the computer connected unit
PeriodOnce until disarmed (sporadic)
Max Execution Time1 ms
![Page 12: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/12.jpg)
On-Person UnitSleep Task
Put the CPU into low power mode called WaitInternal Timer Module use as software
interrupt to wake the CPU Period
50 ms (periodic) Max Execution Time
25 ms
![Page 13: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/13.jpg)
![Page 14: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/14.jpg)
On-Person UnitCPU Load
Task Execution Time Task Period CPU Load
Timer Task 0.5 ms 50 ms 1%
Sampling Task 8 ms 50 ms 16%
Rate Analysis Task 5 ms 50 ms 10%
Alert Task 1 ms 50 ms 2%
Sleep Task 25 ms 50 ms 50%
Total CPU Load (max) 79%
![Page 15: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/15.jpg)
Computer Connected UnitTasks
Start Task Waitforslice Task User Interface Task Alert Pole Task Send Alert Task
![Page 16: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/16.jpg)
Computer Connected UnitModule List
Module Tasks Public Functions and Data
Main1.cStartTask
WaitforsliceUser InterfaceTask
AlertPoleTaskSendAlertTask
HRLimitsAlertFlag
Start08.c
OCDelay.c GetmSCnt()
![Page 17: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/17.jpg)
On-Person UnitModule List
Module Tasks Public Functions and Data
simple_phy.c UINT8 PDDataRequest(tTxPacket *);void PLMEMC13192ResetIndication();
mc13213.c
SCIBIO9s12Dx.a12sci_open()sci_read()sci_write()
Several other Freescale provided modules necessary for SMAC
![Page 18: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/18.jpg)
On-Person UnitStart Task
System InitializationCPUSMACSCI
PeriodRun Once out of reset
Max Execution Time~100 ms
![Page 19: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/19.jpg)
On-Person UnitWaitforslice Task
Waits for the remainder of the timeslice period to pass before exiting to the next task
Period15 ms (periodic)
![Page 20: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/20.jpg)
Computer Connected UnitUser Interface Task
Handles the acquisition of heart rate limits from the user
Period15 ms (periodic)
Max Execution Time3 ms
![Page 21: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/21.jpg)
Computer Connected UnitAlert Pole Task
Poles for an alert from the on-person unit and sets an alert flag if an alert is received
Period15 ms
Max Execution Time1 ms
![Page 22: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/22.jpg)
Computer Connected UnitSend Alert Task
Sends an alert to an emergency service
For project demonstration, an alert will be displayed on the terminal
Period 15 ms
Max Execution time 1 ms
![Page 23: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/23.jpg)
![Page 24: Heart Alert](https://reader036.fdocuments.us/reader036/viewer/2022070420/56815f99550346895dce9c41/html5/thumbnails/24.jpg)
Computer Connected UnitCPU Load
Task Execution Time Task Period CPU Load
User Interface Task 3 ms 15 ms 20%
Alert Pole Task 1 ms 15 ms 6.67%
Send Task 1 ms 15 ms 6.67%
Total CPU Load (max) 33.34%