AN4025 FREESCALE | Alldatasheet

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 31

Technical content

1 Introduction

This document describes a combinational medical device designed to integrate both a low-end glucometer and a blood pressure monitor. Nowadays, people suffering from chronic degenerative diseases such as hypertension and diabetes can develop a plurimetabolic syndrome. This syndrome and both diseases in the same patient share some risk factors such as obesity, hypercholesterolemia, and atherosclerosis. Medical combinational devices target this new market and not only is power consumption a target, but bringing a better solution for disease control. This application note addresses medical devices implemented with Freescale technology. By using the MC9S08LL16 this device is energy efficient. It includes a Medical USB Stack programmed into the MC9S08JS16 for communication and the MPXV5050GP pressure sensor. A glucometer is a device for measuring levels of glucose concentration in the blood. This device is usually portable and is used at home for monitoring diabetic-patients. A blood pressure monitor is a device that detects systolic and diastolic blood pressure, heart rate, and mean arterial pressure for patients who suffer or are at risk of developing high blood pressure. © 2009 Freescale Semiconductor, Inc. Document Number: AN4025Freescale Semiconductor Rev. 1, 4/2010Application Note Implementing a Glucometer and Blood Pressure Monitor Medical Devices Roxana Suarez and Carlos Casillasby: RTAC Americas Guadalajara Mexico

Contents

Personal Healthcare Device Class and Medical USB

2 Glucometers and Diabetes

hypoglycemia and infections. High blood sugar may also be a sign of infection or illness that needs to be treated.

2.1 Diabetes Fundamentals

of Diabetes and Heart Disease Book, Marcel Dekker Inc. kinds of strips to monitor other variables such as ketones which are produced when a patient is experiencing hyperglycemia. Figure 1. Blood glucose monitor block diagram

2.2 Glucose Sensors

giving the glucose concentration.

Figure 2. Electrode reactions between glucose and gluconic acid layer, a polyurethane film that is permeable by the glucose, oxygen, and hydrogen peroxide.

2.3 Amperometry

applications go to Medical Application User Guide at www.freescale.com. 3Freescale Semiconductor, Inc.

Figure 4. Chip schematic of the sensor is linear with a glucose concentration in the range of 5 to 30 mmol/ L and a fast response time of about 20 seconds.

3 Blood Glucose Monitor

glucose is shown on the liquid crystal display (LCD).

3.1 Transimpedance Amplifier

input. The positive input can be connected to either GND or used for offset calibration.

3.2 Glucose Software Overview

seconds sends an error message to the LCD.

break; If no errors occur. The ADC conversion continues and sets the ranges as shown in the code below. The samples obtained must be the following:

  • Range 0— ADC Conversion < 128,
  • Range 1— 141 < ADC Conversion <= 292
  • Range 2— 239 < Range 2 ADC Conversion<=407
  • Range 3— 408 < Range 3 ADC Conversion<= 537
  • Range 4— 539 < Range 4 ADC Conversion<= 752
  • Range 5— ADC Conversion >752. Indicates a high level of glucose NOTE The ADC module resolution is 0.8058 mV/count. while(CountSec<6) bLCD_CharPosition = 10; vfnLCD_Write_Char (0x30+(5-CountSec)); if(CountSec==1) ADC_Start_conversion (2); Sample=ADC_Get_Newconversion(2); if(Sample<128) bLCD_CharPosition = 0; vfnLCD_Write_Char ('0'); Range=0; The code below sets the glucose levels for each range. You have to change the information in range 2, range 3, and range 4 in the lines as commented below. Finally, determine the glucose level with the equation: Glucose = x + midpoint The x variable for:
  • Range 1 = 35
  • Range 2 = 86
  • Range 3 = 166
  • Range 4 = 201 if(Range==1) // changes for 2, 3 or 4 low=0; high=51; midpoint=0; while (low<high) midpoint =(low+high)/2; if (Sample<Range1[midpoint]) // changes for Range2, Range3 or Range4 high=midpoint-1; else low=midpoint+1; Glucose=35+midpoint; Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 5Freescale Semiconductor, Inc. Blood Glucose Monitor

Intialization range arrays: The TakeSample function disables the ADC and displays the results on the LCD. DisplayResults(); vfnLCD_All_Segments_OFF (); TASK=5;

4 Blood Pressure Monitor and Hypertension

Because hypertension (high blood pressure) becoming more and more common, technology has had to develop medical devices to help control these diseases. These portable devices allow monitoring blood pressure at home.

4.1 Hypertension Fundamentals

Hypertension or high blood pressure is a condition when the blood pressure in the arteries is chronically elevated. In every heart beat, the heart pumps blood through the arteries to rest of the body. Blood pressure is the force of the blood that is pushing up against the walls of the blood vessels. If the pressure is too high, the heart has to work harder to pump and this can lead to several diseases. A blood pressure monitor is a device used to measure arterial pressure as blood is pumped away from the heart. Typically, from a user's perspective, a monitor includes an inflatable cuff to restrict blood flow and a manometer (pressure meter) to measure the blood pressure. From a system designer’s perspective a blood pressure monitor is more complex. It consists of a power supply, motor, memory, pressure sensor, and user interfaces that can include a display, keypad, or touchpad, and audio as well as optional USB or wireless communication interfaces. For more information go to the Blood Pressure Monitors webpage. Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 Freescale Semiconductor, Inc.6 Blood Pressure Monitor and Hypertension

Figure 5. Blood pressure monitor general block diagram

5 Blood Pressure Monitor

pressure sensor, the hardware, and software developed are also described.

5.1 Pressure Sensor

by the MCU so that the motor either turns on or turns off. Also important is an air compressor controlled by the motor and valve. The pressure sensor provides a signal that splits in two. One without a filter, and the other with a filter that removes noise.

  • Patented silicon shear stress strain gauge
  • Pressure range up to 300 mm Hg (consult the datasheet)
  • Polysulfone case material (medical, class V approved)

5.2 Hardware—Blood Pressure Monitor

the cuff starts to deflate. The pressure sensor is also connected to the cuff for taking in every moment and measuring the pressure. Figure 6 shows how to connect these elements. A hose can be used. 7Freescale Semiconductor, Inc.

Figure 6. Pressure gauge block diagram Figure 7. Motor, mini air pump, valve Figure 8. Pressure sensor connection

5.3 Software—Blood Pressure Monitor

control. The values can be changed depending on the hardware implementation.

  • Clock source—Bus clock/64 = 10 MHz/64 = 156.250 kHz
  • Clock cycle—6.4 us PWM configuration:
  • Counter Value—0x200 (HEX) = 512 (DEC) = 3.27 ms per duty cycle
  • Motor PWM—0x80 (HEX) = 128 (DEC) = 25% of duty cycle
  • Valve PWM—0x 100 (HEX) = 256 (DEC) = 50% of duty cycle NOTE This value is used to generate the PWM in the TPMxMOD register. Although the motor and valve PWM have the same clock source they are never enabled at the same time.

5.4 Obtaining Blood Pressure Measurements

datasheets show values in kPa. present when the pressure sensor detects 180 mm Hg. Figure 9. Voltage output versus pressure 9Freescale Semiconductor, Inc.

5.5 Motor and Valve Control

below shows how to implement the motor control. Figure 10. Motor control flowchart contracts and diastolic which represents the pressure in the arteries when the heart is at rest (cuff deflates). and control of hypertension it is important to obtain the heart rate.

5.6.1 Obtaining the Heart Rate

pressure on the cuff. This variation in the pressure from the cuff is actually due to the pressure change from blood circulating.

5.6.2 Oscillometric Method

pressure and the heart rate.

Figure 11. Oscillatory pressure curve

5.6.3 Mean Arterial Pressure

as the average arterial pressure during a single cardiac cycle.

6 Technology and Medical Devices

7 LCD Driver

segments and generates the waveforms necessary to drive an LCD. The LCD used for this application is a glass with 29 segments.

7.1 Modes of Operation and Power Supply

in stop2 with all clocks turned off. connections between the LCD glass and the MCU. 11Freescale Semiconductor, Inc.

7.2 LCD Hardware

Figure 12. Connection to LL16

7.2.1 LCD Segment Specs

Driver Specifications (document AN3796) is available at the Freescale website.

Figure 13. LCD glass Table 1 shows the custom glass worksheet. Table 1. LCD Specs 13Freescale Semiconductor, Inc.

7.3 LCD Software

General LCD software flowchart Figure 14 shows the LCD sequence. It is in an infinite loop that always returns to the Task Management switch. To show the different options of the application this function controls a variable named TASK. This variable is configured with a 1 to enter in the glucometer's principal menu, 2 for the blood pressure monitor device (choose an application), 3 to save the measurement, 4 for Bluetooth communication, 5 for USB communication, and 6 to enter stop mode. To change the status of the TASK variable assign the value necessary. Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 Freescale Semiconductor, Inc.14 LCD Driver

Figure 14. LCD flowchart source, and the duty cycle for the waves to generate the messages in the LCD glass. Below you can see how to enable the LCD pins, and set which LCD pins will be backplanes and COMS. Table 2. LCD pins and backplane configurations RegNum—Number of the register to write. RegNum—Number of the register to write. 15Freescale Semiconductor, Inc.

Figure 15. LCD.c structure Table 3. Communications status

8 Bluetooth Connectivity

This communication helps short range transmission of data from medical devices to mobile phones and computers. This feature in medical devices helps to have contact between the patient and the doctor without having to go to the doctor's office.

8.1 Bluetooth Theory

Bluetooth is an open wireless protocol that creates personal area networks (PANs) and exchanges data over short distances between fixed or mobile devices. It can connect several devices and overcome problems of synchronization. Bluetooth provides 10 meters of distance to set communication at a speed of up to 1 Mb/s, high compatibility to most computers, and it is not necessary to implement a special network for communication.

8.1.1 Service Discovery Application Profile (SDAP)

Service discovery protocol (SDP) provides a means for applications to discover what services are available and to determine characteristics of those available services. A specific service discovery protocol is needed in a Bluetooth environment. The service discovery protocol defined in Bluetooth specification is intended to address unique characteristics of a Bluetooth environment.

8.2 Bluetooth Hardware

In this application the LMX9838 Bluetooth serial port module is used. It integrates the Bluetooth 2.0 baseband controller with 2.4 GHz radio, crystal, antenna, and other features. This section explains how to connect this device with the MCU. To power up the device some filters were implemented to the VCC, VCC_CORE, and VCC_IO pins as shown in Figure 16. It is important to connect the LMX9838 with adequate ground planes and a filtered power supply. To provide better performance and low power consumption an external crystal was placed at 32 kHz. The Bluetooth device also provides two pins to connect LEDs that indicate link status and RF traffic. Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 17Freescale Semiconductor, Inc. Bluetooth Connectivity

Figure 16. Bluetooth driver a QS3VH253Q multiplexor is used to control what communication is used. Figure 17. Communication multiplexor

8.2.1 Baud Rate Configuration

OP3, OP4, and OP5. Table 4 shows different UART frequency settings.

Table 4. UART frequency settings

  1. System parameters in non-volatile storage

When the value is at 1 this means a 1 K pull-up resistor must be placed. configured in the SCI_Init (void) function.

8.3 Bluetooth Software

connect and disconnect the system. It also configures the serial port and when to reset. 19Freescale Semiconductor, Inc.

Figure 18. Bluetooth software flowchart Table 5. Bluetooth functions using Bluetooth. First, the hardware reset is generated to activate module.

9 Micro SD Card

explains the connections and software for an SD Card drive. Figure 19. SD Card connection diagram

Figure 20. CONN_SD_CARD 8

9.1 Software—Micro SD Card

the SD.c file. The following commands are the principal commands. Table 6. SD Card Command 21Freescale Semiconductor, Inc.

9.2 SD Card Initialization

to check the block length and place the clock to maximum. Figure 21. Initialization flowchart As explained in Figure 21, the SD Card initialization is executed with the SD_init function. The slave is enabled and disabled. and the CRC waits for a response from the slave device. the card is fully initialized and ready to respond to general commands. Using the M9S08JM60 Series Designer Reference Manual (document DRM104). Table 7. SD Card function error occurs a code returns.

9.3 Stored Information

pressure, and the heart beats taken.

void StoreData (void){ if(SD_Init()==1){ Error(9); if (App_ID==1){ //Save Glucose Information GMem[1]=Glucose; GMem[0]=Glucose>>8; GMem[2]=Hr; GMem[3]=Min; GMem[4]=Day; GMem[5]=Month; ptrG=&GMem[0]; if(SD_Write_Block(RG,ptrG)!=0){ Error(9); if (App_ID == 2){ //Save Blood Pressure Information BPMem[1]=SystolicPressure; BPMem[0]=SystolicPressure>>8; BPMem[3]=DyastolicPressure; BPMem[2]=DyastolicPressure>>8; BPMem[5]=HeartBeat; BPMem[4]=HeartBeat>>8; BPMem[6]=Hr; BPMem[7]=Min; BPMem[8]=Day; BPMem[9]=Month; ptrBP=&BPMem[0]; if(SD_Write_Block(RP,ptrBP)!=0){ Error(9); } } void BPReadMemory (void){ ptrBP=&BPMem[0]; if(!SD_Read_Block(RP,ptrBP)){ SystolicPressure=(BPMem[0]<<8)+BPMem[1]; DyastolicPressure=(BPMem[2]<<8)+BPMem[3]; HeartBeat=(BPMem[4]<<8)+BPMem[5]; Hr=BPMem[6]; Min=BPMem[7]; Day=BPMem[8]; Month=BPMem[9]; MemoryDisplay(2); } else{ Error(9);

9.4 Read Information

This code is to read the information provided by the SD Card. Blood pressure and glucose information. void BPReadMemory (void){ ptrBP=&BPMem[0]; Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 23Freescale Semiconductor, Inc. Micro SD Card

10 Power Management

It is important to correctly implement the power source to control the analog and digital voltage for different stages in the system. regulated voltage of 3.3 V with a capacitor coupling to ensure the voltage level and improve the signal integration. Figure 22. Voltage and GND isolations

10.1 Power Management and the MC9S08LL16

low power consumption. This device provides wait and stop modes. The system provides three power sources from the principal voltage source.

  • Integrated circuit voltage
  • Motor and valve voltage
  • Pressure sensor supply voltage Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 Freescale Semiconductor, Inc.24 Power Management

A switch with transistors is implemented for the pressure sensor voltage source. The MCU sends a signal to the Q2 base. The principal voltage source connects to GND and the pressure sensor voltage source is then generated. Table 8. Power source MC9S08LL16L, MAX4734, LMX9838SB, MC9S08JS16, SD Card, buzzer, QS3VH253Q, push buttons. Figure 23. Pressure block on/off power

11 Errors System

an error is generated. The errors are identified with a number and each number of errors alert about different situations.

  • Error(1)—Waits a few seconds and if a strip is not detected, the system considers that the strip is used.
  • Error(2)—Waits a few seconds and if a strip is detected, but does not have a reaction, the system considers that there is no blood sample.
  • Error(3)—Detects a strip and reaction but there is not enough blood to sample.
  • Error(4)—When the pressure detected is higher than 180 mm Hg it is possible that there is an escape of air.
  • Error(5)—Heart pulse not detected.
  • Error(6)—The diastolic pressure is lower than 30 mm Hg.
  • Error(7)—Bluetooth is enabled but cannot make a connection.
  • Error(8)—The USB module is enabled but cannot make a connection.
  • Error(9)—Connection error with the SD Card.

12 Personal Healthcare Device Class and Medical USB Stack

Applications

Personal Healthcare Devices Class (PHDC)— It is required to implement methods for sending personal healthcare data to a USB host. The PHDC is to enable seamless interoperability between personal healthcare devices and USB hosts. Medical USB Stack—Is based on USB PHDC and the IEEE–11073. It is compatible with Continua host emulator software. This Medical USB Stack enables microcontrollers with guidelines for Continua Health Alliance connectivity and is a first step to test your application prior official Continua certification. Freescale provides implementations to the PHDC using the MC9S08JS16. Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 25Freescale Semiconductor, Inc. Errors System

  • MEDUSBAPIRM—Medical Applications USB Stack API Reference
  • MEDCONLIBAPIRM—USB Device API Reference
  • MEDUSBUG—Medical Applications USB Stack User Guide
  • MEDCONLIBUG—Medical Connectivity Library Users Guide
  • MDCLUSBSFTWRFS—Medical Applications USB Stack Fact Sheet USB hardware connections:

Figure 24. MC9S08JS16 connection and USB connector

13 User Guide

Without a J7 jumper the system remains off. Turn the system on to start. Figure 25. Evaluation board

Figure 34. Heart beats per minutes When the system is powered on, all the LCD segments turn on and detect any damage. Figure 35. Display test

14 Conclusion

Freescale provides a variety of devices with low power consumption and high performance to develop medical applications. Flexibility in selecting the right communication interface makes Freescale an adequate solution to use USB or Bluetooth. intelligent hospitals, telehealth solutions, or single end-user monitoring devices.

15 References

  • Ultra Low Power Medical Device Demo by Freescale— http://www.youtube.com/watch?v=eQTT_sjCMPo
  • Blood Glucose Meter with Blood Pressure Monitor—http://www.youtube.com/watch?v=NuoRK7DgJkM
  • Continua USB PHDC Demo—http://www.youtube.com/watch?v=Z47ILv0eSLQ
  • Electrocardiograph and Heart Rate Monitor Fundamentales (document AN4059) at the Freescale Medical webpage— www.freescale.com/medical
  • Medical Management of Diabetes and Heart Disease Book, Marcel Dekker Inc, Authors: Burton E. Sobel and David J. Schneider.
  • Blood Pressure Monitors A Freescale Reference Design at www.freescale.com Implementing a Glucometer and Blood Pressure Monitor Medical Devices, Rev. 1, 4/2010 Freescale Semiconductor, Inc.30 Conclusion

How to Reach Us: Home Page: www.freescale.com Web Support: http://www.freescale.com/support USA/Europe or Locations Not Listed: Freescale Semiconductor Technical Information Center, EL516

2100 East Elliot Road

Tempe, Arizona 85284 +1-800-521-6274 or +1-480-768-2130 www.freescale.com/support Europe, Middle East, and Africa: Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7

81829 Muenchen, Germany

+44 1296 380 456 (English) +46 8 52200080 (English) +49 89 92103 559 (German) +33 1 69 35 48 48 (French) www.freescale.com/support Japan: Freescale Semiconductor Japan Ltd. Headquarters ARCO Tower 15F 1-8-1, Shimo-Meguro, Meguro-ku, Tokyo 153-0064 Japan 0120 191014 or +81 3 5437 9125 support.japan@freescale.com Asia/Pacific: Freescale Semiconductor China Ltd. Exchange Building 23F No. 118 Jianguo Road Chaoyang District Beijing 100022 China +86 10 5879 8000 support.asia@freescale.com For Literature Requests Only: Freescale Semiconductor Literature Distribution Center 1-800-441-2447 or +1-303-675-2140 Fax: +1-303-675-2150 LDCForFreescaleSemiconductor@hibbertgroup.com Document Number: AN4025 Rev. 1, 4/2010 Information in this document is provided solely to enable system and sofware implementers to use Freescale Semiconductors products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation, or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any liability, including without limitation consequential or incidental damages. "Typical" parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals", must be validated for each customer application by customer's technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor prodcuts are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claims alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. RoHS-compliant and/or Pb-free versions of Freescale products have the functionality and electrical characteristics as their non-RoHS-complaint and/or non-Pb-free counterparts. For further information, see http://www.freescale.com or contact your Freescale sales representative. For information on Freescale's Environmental Products program, go to http://www.freescale.com/epp. Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. © 2010 Freescale Semiconductor, Inc.