沈阳理工大学硕士学位论文基于DSP的疲劳驾驶检测系统硬件设计与实现姓名:常瑜亮申请学位级别:硕士专业:通信与信息系统指导教师:宋凯20100301TITMS320DM642DSPCCDTVP5150TMS320DM642SDRAMPCBPCBBSL,DSP,AbstractWiththeincrementoftafficaccidentbecauseoffatiguedrive,fatiguedrivehasalreadybeenaseriousprobleminnowadayssociety.Soithasimportantmeaningstoresearchanddesignafatiguedrivedetectingsystemtodecreasetrafficaccidents.ThehardwareoffatiguedrivedetectingsysteminthispaperisbasedonTMS320DM642digitalsignalprocessormanufacturedbyTICorporation.ThesystemusestheCCDcameraastheimagecapturedevice,usesTVP5150videodecoderdigitizetheimageandsentsthemintoTMS320DM642byvideoportforthefatiguedrivedetectingalgorithmtouse,finallytheresultdecideswhetherornottodrivebuzzeralarm.Themainresearchworkinthispaperincludesthehardwareandschemedesigntoeverymodule,highspeedPCBdesignundertheguidanceofsignalintegrityandhighspeeddigitalcircuitdesigntheory,programmingBSLandmini-driverofthesystemandtestingthehardwareanddebuggingthesoftwareandhardware.Thedebuggingresultshowthatthedesignisfeasibleandhardwareworknormally,itcancompletehighspeedimagecaptureandalarm.Keywordsfatiguedrivedetecting,DSP,hardwaredesign,mini-driver:()()1111.11.1.1,,50,80%25%[1]200148%[2]1.1.2[3]21.21)(EEGECGEMG)EEGelectroencephalographyECGelectrocardiogramEMGelectromyography2)()3)()PERCLOS(PercenteyelidClosure)PERCLOSP8012313456()DSPDSPMPUMPUDSP(Harver)DSPDSPDSPDSP1.31.3.11)4TMS320DM642DSPJTAGFLASHSDRAM2)3)I2CSDRAMCCD1.3.212DSPTMS320DM642TMS320DM6423SDRAM4PCBPCBPCB5/CCSDSP/BIOS/62DSPTMS320DM64252DSPTMS320DM642TMS320DM642TI2003DSPTIC64xDSP//PCI-66///PCICPLD()FIFOVoIPDVR2.1TMS320DM642TMS320DM642500MHz600MHz720MHz2ns1.67ns1.39ns8325760MIPSVelociTI.2VLIWTMS320C64xDSPVelociT64328TMS320DM642[4][5]TMS320DM6422.1TMS320DM642CPU6TMS320DM642L1DCache16KBytesL1PCache16KBytesL2CacheEDMAEMIFVIDEOPORT/MASP/MBSPGPIOI2CHPI/PCI/EMAC2.1TMS320DM6421)3(VP0,VP1,VP2),,CCIR601,ITU-BT.656,BT.1120,SMPTE125M,260M,274M,296M2)1VCXO(VIC)9163)1(EMAC)TMS320DM64210Based-T100Based-TX10Mbps100MbpsQOS4)1(MDIO)32MDIO,PHYPHYDSPMDIOPHYMDIODSPDSPMDIO5)1(McASP)I2SDITS/PDIFIEC60958-1AES-3CP-4306)I2CDSP7)2(McBSP)8)3329)11632(HPI16/HPI32)2DSPTMS320DM642710)13266MHz3.3V/PCIPCI2.211)16I/O(GPIO)/12)164EMIFSRAMEPROMSDRAM,SBSRAM,ZBTSRAM,FIFO1024MB13)164EDMATMS320DM642TIC6000DSP(HD)66MHzPCI600MHzTMS320DM642304MPEG22.2(CPU)CPUVelocTiI(VLIW)(256)832[4][5]TMS320DM642CPU1)2)3)4)64325)46)7)8)CPU(AB3232bit)8(LlL2S1S2MlM2DlD2)(DA1DA2)4CPU(LD1LD2)(ST1ST2)(Load)(Store)82.3TMS320DM642L1L2L1(L1P)(L1D)16KBL2RAM256KBL2[6]L1PL1D3L1P51232Bytes323L1PBit4-Bit0Bit13-Bit5Bit31-Bit14L1D12864BytesCPU4Bit1-Bit0Bit5-Bit2Bit12-Bit6Bit31-Bit13L1PL1DSRAM[7]CCFGL2CACHESRAML2SRAM224KBSRAM32KB4192KBSRAM64KB4128KBSRAM128KB4L242.4VideoPortTMS320DM6423VP0-2VideoportVP20VPxD[0:19]2VPxCLK0VPxCLK1/3VPxCTL0VPxCTL1VPxCTL2VPxCLK0VPxCLK1VPxCTL0~2[8]ABABVP0AMcBSP0VP1A2DSPTMS320DM6429McBSP1VP0VP1BMcASPVP2TMS320DM642FIFOFIFOITU-RBT.656Y/CRawTSI810203ITU-RBT.656YCbCrYCbCr3ITU-RBT.6564:2:2810ITU-RBT.656BT.656SAV4EAV4SAVEAV30xFF0xFF0x004XYITU-RBT.656Y/CRaw8102032.5EDMAEDMAC621x/671x/64xDSPL2cachecache[9]TMS320DM642EDMACPU642Gbit/s6485RAMLinkingChainingEDMA1EDMAEDMATCEDMATCL2/10EDMAEMIFcache2EDMAEDMACCEDMACCEDMAEDMATCTRRAM//[10]EDMA1D2D1D2DEDMA31EDMACCTR2EDMA3CPUCPUESR2.6EMIFATMS320DM642EMIFA(ExternalMemoryInterafce)644CE0-CE3256MB[11]2.12.1TMS320DM642EMIFACE00x80000000-0x8FFFFFFFCE10x90000000-0x9FFFFFFFCE20xA0000000-0xAFFFFFFFCE30xB0000000-0xBFFFFFFFEMIFA133MHz2DSPTMS320DM64211TMS320DM642EMIFACE0-CE3EMIFA6432168TMS320DM642EMIFAAECLKINTMS320DM642AECLKIN133MHzAECLKOUT1AECLKOUT2AECLKOUT1AECLKIN4DSP6DSPAECLKOUT1AECLKOUT2AECLKIN4DSP6DSPAECLKOUT224AEA20AEA19EMIFAAEA20AEA19EMIFA2.2AECLKIN2.2AEA20AEA19AEA20AEA19EMIFA00AECLKIN104DSP016DSP11EMIFAGBLCTLCECTL0-CECTL3CESEC0-CESEC3SDCTLSDTIMSDEXTPDTCTLGBLCTLCECTL0-CECTL34CESEC0-CESEC34SDCTLSDTIMSDEXTSDRAMSDRAMTMS320DM64232EMIFAEA[3:22]EA3EA0TMS320DM642(64bit)64bitEA2EA1EA0BE[0:7]CE[0:3]122.7I2CI2CInterIntergratedCircuitPHILIPS2080I2C2(SDASCL)I2CTMS320DM642I2CI2CI2CI2CEEPROMI2C100K400K[12]I2Cl)SDASCLSDASCLI2C2)SCLSDASTARTSCLSDASTOPI2CI2C3)I2C89ACK9NACKNACK12NACK2DSPTMS320DM64213()SCLSCL(ACK)2.8GPIOTMS320DM642GPIO16/GPIODSPGPIOGPIOGPVALGPIOGPVALGPIOGPEN/GPDIR[13]/GPIOGPDHGPDL10GPIOEDMAPass-throughmodeLogicmodeGPxGPINTxGPINTxCPUEDMAGP[15:0]GPINT0GP[15:0]DSPGPINTGPINTGP0GPINT0_INTGPINT0MGPINT014GPIOGPGCGPOM=02.92.9.1McASPMcASPTMS320DM642McASPVP0VP18McASP2(VP0VP1B)[14]McASP16McASP/McASPD/AA/DMcASP216CODEC8121620242832IISTDM(32)SPDIFIEC60958-1AES-3IISTDM(32)TDM(384)2.9.2McBSPMcBSP(Multi-channelBufferedSerialPort)/A/DD/A[15]McBSPDSPCODECAICA/DD/AAC97IISSPI1288121620243282DSPTMS320DM642152.9.3TMS320DM642EMACEthernetMediaAccessControllerMDIOManagementDataInputOutputEMACMDIOEMAC[16]10/100MEMAC/MDIODSPEMAC/MDIO4KCPUMIIHPYCRC(QOS)2.9.4HPIHostPortInterfaceDSPHPIDSPDSPHPI1632HPI[17]2.9.5PCITMS320DM642PCIPCI2.232RAMEMIF64KBPCIEEPROM[18]2.10TMS320DM642(CPU)(EMIFA)I2C1633.13.11)1TI600MHzTMS320DM642DSP2)1TVP51503)132MB(SDRAM)4)14MBFlash5)14JTAG6)33.3VI/ODSP1.4VTVP51501.8V7)CCDTVP5150TMS320DM642SDRAMFLASHJTAG33.13.2TMS320D