杭州电子科技大学硕士学位论文基于STM32的便携式心电图仪的设计与实现姓名:武利珍申请学位级别:硕士专业:电路与系统指导教师:张文超20091201I[0]STM32A/DA/DSTM32SDLCDSTCortex-M3STM32F103VCIAREmbeddedWorkbenchforARMCSDMATLABMIT-BIHRS232VC++6.0MFCSDSTM32IIABSTRACTAtpresent,therateofcardiovasculardiseaseandtherelatedhazardfactorinourcountryhaveincreased.ECGisanimportantmethodofdiagnosingheartdisease.However,conventionalECGdeviceshavelimitationsofabigsizeandbulkyvolumeandnoteasytocarry.Itisnotconvenientforpatientstostayinthehospitalforlong,soitbecomesveryimportanttodevelopaportableECGmonitor.TheprojectproposedaplanofECGacquisition,analysisandprocessingsystemwhichbasedonSTM32,andcompleteditshardwareandsoftwaredesign.ThecoreofthesystemisECGacquisitioncircuit,whichistocompletethesignalextraction.ThefunctionoftheECGsignalprocessingcircuitistocompletetheA/Dacquisition,displaying,filteringandstorageofthesignal.Thesystemisatypicalbiomedicalsignalcollecting-processingone,whichprocessesweaksignalsinstrongnoisebackground.Becauseoftheimpactofnoiseandinterference,thefront-endacquisitioncircuitneedstohavehigherperformance.AccordingtothecharacteristicsofECG,theprecisioninstrumentationamplifiersarechosentodesignthepreamplifiercircuit.Inordertoreducetheinterferenceeffects,rightlegdrivecircuits,high-passfilterandlow-passfilterisdesignedtoextracttheECGsignal.ThroughtheA/DconverterofECGprocessingcircuit,analogsignalsareconvertedintodigitalsignals,whicharesenttothemicroprocessorforfurtherprocessing.ECGprocessingcircuit,coreofwhichisamicrocontrolleroflowcostandlowpowerCortex-M3byST,mainlyincludepowermanagementcircuits,STM32processorcircuits,SDcardstoragecircuits,serialcommunicationcircuits,LCDinterfacecircuitsandsoon.ThesoftwaredesignusedClanguagetoprogramandcompletedECGcollection,filtering,display,storageandcommunication.ThedevelopmenttoolisIAREmbeddedWorkbenchforARM.Themainprogramcompletedavarietyofspecificfunctionsbycallingthesubroutinemodules.Subroutinesincludedsysteminitialization,ADC,digitalfiltering,waveformdisplaying,datastorage,serialcommunicationandsoon.ThissystemvalidatedtheECGalgorithmsusingECGdatafromMIT-BIHECGdatabasebyMATLAB,andatlastsuppressednoiseandinterferenceeffectivelybyusingasimpleintegercoefficientfilterdesignmethod.Besides,thesystemcanalsocommunicatewiththehostcomputerbyRS232serialport,soPCcanfurtherprocesstheuploadeddatausingitspowerfuldataprocessingandanalysiscapabilities.Hostmachinemanagementsoftwareimplementedalow-costECGsignalacquisitionsystemusingVC++6.0softwaredevelopmentplatform.Themanagementsoftwareistorealizethefunctionsofdataacquisition,processing,display,storageandanalysis.IIIThesubjectrealizedthedesiredtarget,includingdesigningthesystem'shardwareandsoftware,andmakingaprototypemachine.Thesystemwasprovedrunningwell,andcouldmeetthedesignrequirements.Keywords:ECGDevice,ECG,SignalCollection,SignalProcessing,SDCard,STM32111.144%200850%[1]1620%[2][3]21.2Einthoven1887[4]1895•19031cm1mV1cm0.4PQRST19121924Einthoven[5](DynamicElectrocardiographyDCG)1949HolterHolter8012DCG24ECG(1)(2)3(3)(4)GPRS1.3STM32SD24PCTFT-LCD1.3.1(1)(2)1)2)(3)1)A/D2)STM323)4)SD5)6)7)PC41.3.250HzMCUSTCortex-M3STM321.3.3522.1[6][7]2.2[8]2.2.12.1[9]10µV~4mV1mV2.1ECG6[10]PP-RPQRS0.12~0.20s0.20sQRSQSQRSQRS0.10sQRSS-TQRSTST0.05P-RPQRS-[11](1)0.055mV1µV(2)0.05~100Hz0.05~40Hz(3)KK(4)ECG(5)ECG2.2.2Nitish.V.Thakor0.05~100Hz0.05~40HzQRS710~20HzQRS2.3ECGQRSQRS[12]2.3.1(1)[13]30mV5Hz~2KHz(2)0.15Hz~0.3Hz2.3.2(1)[14]50Hz50Hz50Hz50Hz(2)ECG(3)8ECG(1)50Hz(2)933.1--------(1)SystemonChipSoC(2)I/O(3)(4)3.2MCU(1)MCUMCU(2)MCUMCUPC(3)MCUMCU(4)MCUMCU1032ARMSTM32STM32F103VCT63.33.1uuuSDuuuPCu3.1A/DSTM32SDLCDSTM32A/DTFT-LCD3.4113.4.1(1)()[15]3.1E0-R-N-F-a-()1000AgAgCl3.23.2AgAgClAgAgClAgClAg[16](2)()()[17]1212ECGElnthoven1903IIIIII1930WilsonV1--V6aNFRTEEln0+=1240GoldbergeraVRaVLaVFEinihoven--Wilson12VCGFrank1956FrankXYZECGRIIIIII[18]I3.3IIIIRALARLLL+[19]3.3IIII3.4.2(1)1mV1V1000(2)100Hz50Hz(3)1380db(4)(5)B-BINA118[20]3.43.4INA118INA118Rg110dB0.5µV/50µV18RgG=1+50kΩ/RgINA1183.5U1AU1BU3R13R14C10[21]50HzAgAgCl[22]1410G=1+50K/5.6K=10Rg=5.6K3.53.4.30.05Hzl00Hz[23][24][25]RCRCButterworthChebysher[26]3.6U5AC4R6f=0.03HzU5BC5R7f=110Hz50Hz50Hz153.63.4.4A/D03.3V80010001010010RJ3.7OPA26043.7-0.5V1.5VA/D0~3.3V3.8P33.8163.4.55VSTM323.3VICL7660S10KHZLCD3.93.3VAMS11175V~12V3.3V3.103.9ICL7660S3.103.3V3.113.11173.5A/D3.5.1SD3.123.123.5.2STM32STM32F103x[27]ARMCortex-M332RISC72MHz(128KFLASH20KSRAM)I/OAPB212ADC316PWM2I2CSPI3USARTUSBCAN3.3V3.13STM32F103x[28]STM32(1)128K20KSRAMCPU0(/)FlashSRAM(2)STM32ARMARMARMARM(3)STM32FLASHFLASHJTAGUSARTFLASH183.13STM32F103x(4)[29]STM32(5)[30]STM321)STM32STM32STM322)USBUSBUSBUSB(6)STM32F103xx19STM32[31]Ø(PLC)ØHVACØ[32]ØØPCGPSSTM323.5.3STM32STM323.5.3.1STM323.14STM323.14STM323.14STM32(1)RC2010k1.0µF3.6msSTM32(2)8M22pF(3)BOOT0FLASH(4)410O3.5.3.2STM32JTAGJTAG(JointTestActionGroup;)[33](IEEE1149.1JTAGDSPFPGAJTAG4TMSTCKTDITDOJTAG3.153.15JTAG3.5.4LCD3.5.4.1LCDLCDLCD(1)(2)21(3)(4)STNTFT(5)3.2TFT[34]320*2402616AVRARM7STM32MCUlQVGA240x320l3.2lIL9320l4l37PIN1mml5LED3.5.4.2[35]1/1000XYB-BADS7843[36]ADS78433.163.16ADS7843ADS784