ELECTRONICMEASUREMENTTECHNOLOGY32920099 CAN*王 平 江华丽 何 花(福建师范大学物理与光电信息科技学院 福州 350007) :CAN,,、、。、,,,CAN,,、。CAN。:CAN;AT89S52;SJA1000;PCA82C250:TP393.04 :AApplicationdesignofCANbuscommunicationbasedonMCUWangPing JiangHuali HeHua(SchoolofPhysicsandoptoelectronicsTechnology,FujianNormalUniversity,Fuzhou350007)Abstract:Becauseofexcellentperformance,CANbuscanbeusednotonlyinmotorindustrybutalsoinautocontrol,buildingautomatization,medicineequipmentandsoon.FeaturingthelackofenoughfunctionsandbadcommunicationcapabilityInoursmarthome,weapplythedistributionalsystemtobuildasafeandfastCANnetworksystemtoachievethedatacommunicationamongeverysudsystem.Itisprovedthatthesystemturnouttoinproveintelligentizationandhumanizationofthehouse.ThispapermainlyintroducesthedesignofCANbuscommunicationbaseonMCU.Keywords:CANbus;AT89S52;SJA1000;PCA82C250 *:“”(2007F5039)0 、、、,。,,,。CAN(ControlAreaNetwork),、、,。,CSMA/CD。CAN,,CAN,。。CAN,[1]。1 CAN1.1 CAN,。,,2.5V,0V,,1;3.5V,1.5V,2V,,0。CANCAN。PCA82C250,110[2]。5kb/s10km,1Mb/s40m[3]。1.2 CAN2.0A2.0B,2.0ACAN1.2,CAN2.0B,2.0B,2.0B,。(11)2032,(29·131· 32电 子 测 量 技 术)。。1.3 CAN4:1):;2):;3):;4):。1,、()、(6)、(0~8)、CRC、、7[4]。1 1.4 CAN:、、CRC、、5::、、,,4.7×10-11。,,。1.5 CAN,。(),CAN“”,5,1。2 ,、,[5-6]。,,,,2。、,CAN。CANCAN[7]。2 2.1 CANSJA1000CANPCA82C250CANPhilipsSJA1000,CANPhilipsPCA82C250。1)CANSJA1000SJA1000。CAN2.0A,CAN2.0B。3,、、(RXFIFO)、、(BSP)、(BTL)(EML)。:①:CPU,SJA1000,CPU。②:CPUBSP(),CAN,13,CPU,BSP。③(RXBRXFIFO):CPU,。(RXB,13)FIFO(RXFIFO,64),CPU。CPUFIFO,。④:,。⑤(BSP):、RXFIFOCAN。、、。⑥(BTL):CAN。(),()。(),。⑤(EML):。,·132· 王 平等:基于单片机的CAN总线通讯应用设计93 SJA1000。,255,,,。128,。96(),。2)CANPCA82C250PCA82C250CAN(SJA1000)。1Mbps。4 PCA82C250 PCA82C2504。1:;2:;3:;4:;5:;6:CAN/;7:CAN/;8:;8(RS):、,。3 CAN3.1 5,SJA1000AD0-AD7AT89S52P2,SJA1000ALE、RD、WRAT89S52ALE、RD、WR,SJA1000CSI/OP1.3,MODE+5VSJA1000Intel,INTINT1,CAN。12MHz,C1、C215~30pF,20pF。R5、R6,,390Ψ。R8,120Ψ。CANPCA82C250RS,,[8]。·133· 32电 子 测 量 技 术5 CAN R7,16~140kΨ,20~33kΨ,CAN,CAN。,。3.2 CANCANSJA1000,()、;、;、;。。CANSJA1000,CAN2.0B。,29,4。16ID(,0x00),16ID,(SJA1000)。SJA1000,,。CAN4。,,,、()。。CAN(),INT1,。SJA10004,,,。,8,,。,CAN,[9]。:1:SJA1000(CAN),CAN2.0B,13,(1)、ID(4)8。2:6。,CAN,。,。6 4 CAN,。。,。,。7。·134· 王 平等:基于单片机的CAN总线通讯应用设计97 CAN。,。:(1),(2)。:。200kbyte1。,,。1 ()(1%)0.2500.2300.2300.2200.500.010.4600.4900.4805 CAN。CAN,、,,,,,。[1] ,,.CAN[J].,2008(6):29-31.[2] ,,.[J].,2009,30(4):728-731.[3] ,.CAN[J].,2008,44(36):11-15.[4] ,,,.CAN[J].,2008(5):108-111.[5] ,.[J].,2008,19(11):53-56.[6] ,,.PSTN”[J].,2007,23(4):61-63.[7] ,,.DSPCAN[J].,2008,29(2):377-380.[8] ,.CAN[J].,2008,27(4):331-333.[9] ,,.ATmega128CAN[J].,2008,27(10):48-50.,,1958,,,,,,:,,。E-mail:pwang@fjnu.edu.cn,,1985,,,:,,。,,1985,,,:,,。·135·