您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 酒店餐饮 > DSP芯片应用系列讲座-三-第6讲TMS320C28x的增强型CAN模块
DSP()6TMS320C28xCAN杨 剑1,张雄伟2(1.5,210007;2.):TMS320C28xCAN,CAN2.0B,C24xDSP,C28xCAN,,TMS320C28xCAN,,eCAN,:;;:TN911.72:A:CN32-1289(2005)03-0076-06eCANofTMS320C28xDSPYANGJian1,ZHANGXiong-wei2,(1.PostgraduateTeam5ICE,PLAUST,Nanjing210007,China;2.DepartmentofElectronicInformationEngineeringICE,PLAUST)Abstract:TheenhancedCAN(eCAN)moduleoftheC28xDSPiscompatiblewiththeCAN2.0Bstandard.Itcanbeusedtocommunicateseriallywithothercontrollersinelectricallynoisyenvironment.ComparedwiththeCANmoduleofC24xDSP,mailboxesofeCANmodulearein-creased,andmoreflexiblefunctionsareprovidedformaskconfigurationandtimemanagement.ThispaperintroducedtheprincipleandgeneralconfigurationofTMS320C28xeCAN,withem-phasisontheenhancedfunctions.AccordingtotheeCANself-testingmode,thispaperalsopre-sentedtheeCANloopbacktestingprogrammingexamples.Keywords:DSP;CAN;serialmultimastercommunicationprotocolCAN(ControllerAreaNetwork),,,TMS320C28xDSPCAN(eCAN),CAN2.0B,CAN,C24xDSPCAN,eCAN32,,,[1,2],eCAN1Mbps,CAN,,26320059JournalofMilitaryCommunicationsTechnologyVol.26No.3Sep.2005:2005-03-10;:2005-04-11:(1976-),,.1CAN1CAN,CAN,1,CANCANCPK(CANProtocolKernel),CPKCAN,CRC,,,,CPK,,CAN2.0B,,CANCAN,2C28xeCANTMS320C28xDSPeCANCANeCAN,2eCAN2.1eCANeCAN22,eCANCAN(CPK)(1)CAN(CPK)CAN,CAN(SN65HVD23x)CPK,CPKCAN,,,,CPKCAN,CAN(2)(MMU)CPUCPUeCANCPU,eCANCPU,CPUC28xeCAN,,,,,eCAN,eCAN,,CAN773:TMS320C28xCAN(3),CAN,C28xRAM,CPUCAN,,,,CPU(4)eCAN,eCAN2632,,32,CPU,eCAN,CPU,CPU,,CPK32.2eCANeCAN,CPK,C28x(RAM),3CPU,CPK3,e-CAN6000h60FFh,eCAN6100h61FFh,512e-CANRAM32,16,32(MSGID)32(MSGCTRL)4(MDL)4(MDH),(LAM)(MOTS)(MOTO)3232RAM,,C28xCPU,eCANeCAN2632,1eCAN,,1eCANCANMECANTECCANMDCANRECCANTRSCANGIF00CANTRRCANGIF11CANTACANGIMCANAACANMIMCANRMPCANMILCANRMLCANOPCCANRFPCANTIOCCANGAMCANRIOCCANMCCANTSCCANBTCCANTOCCANESCANTOS(1)CANCANME,CANMD,CANTIOCCANRIOCCAN,782005,CANTRS,CANTRR,CANTACANAA,,CAN(CANMCSCB),CANGAM,,,CANOPC,,CANRFP,CANRMP,CANRML(2)CAN,,,,,,CANCANBTC(3)CANESCANTECCANRECCANESCANCAN,CANTECCANRECCPU,CAN,CAN,CPUCAN,CANREC,CANREC,,,CANCANMCABO,CAN(4)CAN,CANCPU,CANGIMCAN,CANMIM,,CANMIL(eCAN0INTeCAN1INT),CPU,CANGIF0CANGIF1,,(5)TMS320C28xDSPCAN,CAN,,CANCANTOC,MOTOCAN,CANTSC,,,CANTSCMOTS,MOTO,,,CANTOS1,,CPU,3C28xeCANeCAN,eCAN,,CPU,,,,,[4]3.1eCANeCAN,(CANMC)CCR1,,eCAN,(CANES)CCE1,CPUeCAN,CCR,,eCAN,CCE0,eCAN,eCAN4793:TMS320C28xCAN4eCAN3.2eCAN,,eCANCAN55,,(SYNCSEG)1(TSEG51)2(TSEG2),SYNCSEGCAN,(Tq),(SYSCLK),(1)TSEG1,TSEG2,SJWTSEG1TSEG2,eCAN,TSEG1TSEG2eCANBt(2)(Tq),Br(3)2eCANCANBRP1Mbps6500kbps12250kbps24125kbps48100kbps6050kbps120Tq=BRP/SYSCLK(1)Bt=TSEG1+TSEG2+1(2)Br=SYSCLK/(BRPBt(3),eCAN,CAN,eCAN,(2)(3),BRPTSEG1TSEG22,eCAN150MHz,252,CANBr1Mbps,Bt25,BRP6(3),CANBTCBRPreg5,eCAN,CANBTC()BRPregTSEG1regTSEG2reg,CAN[3]4C28xeCAN,eCAN,eCAN,C,eCAN0()16(),,100(loopcounterrorcount),,eCAN(DSP28-Device.h),,[4]#includeDSP28-Device.h//DSP28-Device.h#defineTXCOUNT100//100longi;//intj;802005longloopcount=0//loopcountlongerrorcount=0//errorcountunsignedlongTestMbox1=0;unsignedlongTestMbox2=0;unsignedlongTestMbox3=0;voidInitECan(void);//InitECanvoidMBXcheck(longT1,longT2,longT3);//MBXcheckvoidMBXrd();//MBXrdmain(){InitECan();//ECanaRegs.CANMD.all=0xFFFF0000;//CANMDECanaMboxes.MBOX0.MSGCTRL.bit.DLC=8;//(8)ECanaMboxes.MBOX0.MSGCTRL.bit.RTR=0;//0ECanaMboxes.MBOX0.MSGID.all=0x9555AAA0;//ECanaMboxes.MBOX16.MSGID.all=0x9555AAA0;////ECanaMboxes.MBOX0.MDRL.all=0x9555AAA0;//(0x9555AAA0)ECanaMboxes.MBOX0.MDRH.all=0x89ABCDEF;//(0x89ABCDEF)ECanaMboxes.MBOX16.MDRL.all=0x00000000;//ECanaMboxes.MBOX16.MDRH.all=0x00000000;//ECanaRegs.CANME.all=0xFFFFFFFF;//01ECanaRegs.CANMC.bit.STM=1;//CANMCSTM,eCANfor(i=0;iTXCOUNT;i++)//,{ECanaRegs.CANTA.all=0x00000000;//1CANTAECanaRegs.CANTRS.all=0x00000001;//CANTRS,0,while(ECanaRegs.CANTA.all!=0x00000001){}//0loopcount++;//MBXrd();//MBXcheck(TestMbox1,TestMbox2,TestMbox3);}//asm(ESTOP0);}//voidMBXrd()//,{voltatilestructMBOX*Maibox=(void*)0x6180;//,16(0x6180)TestMbox1=Maibox-MDRL.all;//TestMbox1TestMbox2=Maibox-MDRH.all;//TestMbox2TestMbox3=Maibox-MSGID.all;}//TestMbox3voidMBXcheck(longT1,longT2,longT3){if((T1!=T3)(T2!=0x89ABCDEF))//,{errorcount++;}}//,,,,CANTRS,CANTA,,,CAN,,C28xeCAN,eCAN,C28xeCAN,eCAN,,[4]:[1].TMS320LF24xDSP[M].:,2003.[2]TexasInstruments.TMS320F281xDSPdatamanual[EB/OL].[3]TexasInstruments.TMS320F28xDSPeCANreferenceguide[EB/OL].[4]TexasInstruments.ProgrammingexamplesfortheTMS320F281xeCAN[EB/OL].:TMS320C28xCAN
本文标题:DSP芯片应用系列讲座-三-第6讲TMS320C28x的增强型CAN模块
链接地址:https://www.777doc.com/doc-6904608 .html