31320123RESEARCHANDEXPLORATIONINLABORATORYVol.31No.3Mar.2012111121.2004332.214131。。。HCITN70A1006-7167201203-0079-04DesignandRealizationofSerialCommunicationinBluetoothModuleZHANGQun1YANGXu1ZHANGZheng-yan1LUQi-yong121.DepartmentofElectronicEngineeringFudanUniversityShanghai2004332.WuxiResearchInstituteFudanUniversityWuxi214131ChinaAbstractBluetoothtechnologyisakindoftechnologysuitableforshortdistancewirelesscommunicationandhasfeaturesofhighsecurityandlowinterference.InthepaperabluetoothmodulewasdevelopedusingSignal-ChipMicrocomputerandcommunicationbetweenbluetoothmoduleandmobilephonewithbluetoothwasestablishedsothatSignal-ChipMicrocomputerandbluetooth’ssystemwerecontrolledbyamobilephone.Atthesametimethebluetoothmodulecouldbebindedtoaspecialbluetoothdeviceandembeddedinthesafesystemtogreatlyimprovethesystem’ssecurityandrobustness.KeywordsserialcommunicationbluetoothprotocolbluetoothfirmwareHCIinterface2011-05-211987-。1966-。Tel.021-65642766E-maillqyong@fudan.edu.cn02.4GHzISM。。48bit1-4。。11.115-6。I/O。、、2.4GHz2.4GHz。RAM。Flash。MCUBasebandDSP31。IOSPI、PIO、PCM、UART/USB4。13HCI、、。HCIHCI。1RS232RFCOMM。、4。1.2HCIHCI6。HCIHCI、。HCI。HCI7-8。HCI4USB、RS232、UART、SDHCIHCI、HCI、HCI_ACLHCI_SCO1。22.12①②6。。2。22.2CSRBC417143V2.0UART、SPI、PCM、PIO3.3V9600b/s。PCPCAT9-10。AT89C20515V2KB128B2AT89C2051MCS-51KC51。24LC02IICEEPROM2Kbits。IO。LT10843.3vLM25765v。IOIOIO。。P1.4P1.4。312。2083。3。HJR1-2C48。32.31111。56、、、、。5HCI_Reset、HCI_Read_Buffer_Size、HCI_Write_Scan_Enable、HCI_Write_Connection_Accept、HCI_Page_Timeout、HCI_Set_Filt。HCI_Inquiry。HCI_Creat_Connection。HCI_Acl_Data。HCI_Disconnection。、bluetoothspecificationsVersion2.0+EDR11、。bluetoothspecificationsVersion2.0+EDR0x010x030x0C0x000x040x0E0x040x010x030x0C0x00。KC51。unsignedinthci_resetvoiduncharreset_cmd4=0x010x030x0c0x00//uncharreceive_event7=0x000x000x000x000x000x000x00//uncharreset_event7=0x040x0E0x040x010x030x0C0x00//intiintsa=0TI=0fori=0i<4i++SBUF=reset_cmdiwhileTI==0TI=0RI=0fori=0i<7i++whileRI==0receive_eventi=SBUFRI=0fori=0i<7i++ifreceive_eventi==reset_eventisa++returnsasa7。。2.4、、、、。ID18310102030405。ID。11。/。ID++。、ID+++/+/。ID++++。zqascill123456。017a71123456。2.5WindowsCE。RFCOMMRS232RFCOMM。12-13。4。43017a7112345648。5。45。。、、GPS14-16HCI。References1.M.2006.2.M.2002.3.M.2001.4.M.2001.5CSRBC419143BdatasheetS.20064.6.ARM、D.200748-50.7BluetoothspecificationsVersion2.0+EDR.370-650.http//.docin.com/p-57455142.htmlDB/OL.8.、M.2006.9.M.2006.10.M.2005.11.M.2002.12.VisualC++M.2003.13DavidJ.KruglinskiScotWingoGeorgeShepherd.ProgrammingVisualC++6.0M.1999.14.M.2003.15.J.20023041-10.16.J.200129558-60.28