Software Implementation of Serial Data Communication between C2000 Series DSPs[Copy link]
Software Design In the system, TMS320C6711 sends the image processing results to TMS320LF2407 by actively sending through McBSP, and the latter receives the data information by responding to SCI interrupts. Serial Communication Initialization Program The difficulty of software design for serial communication between TMS320C6711 and TMS320LF2407 is the design of the initialization program for McBSP and SCI. The initialization program includes aspects such as the configuration of chip pins, communication mode configuration and interrupt configuration. The following are the initialization program modules of the McBSP module of TMS320C6711 and the SCI module of TMS320LF2407. (1) TMS320C6711 McBSP module initialization procedure void init_mcbsp0_master(void) { MCBSP_Config mcbspCfg0= { 0x00010001, //Configure spcr register 0x000D0000, //Configure rcr register 0x00040020, //Configure xcr register 0x200000ef, //Configure srgr register 0x200000ef, //Configure srgr register 0x200000ef, //Set the baud rate to 312.5kb/s 0x00000000,//Configure mcr register 0x00000000,//Configure rcer register 0x00000000,//Configure xcer register 0x00000b0c//Configure pcr register }; hMcbsp0=MCBSP_open(MCBSP_DEV0, MCBSP_OPEN_RESET); //Select port 0 MCBSP_config(hMcbsp0,&mcbspCfg0); IRQ_map(IRQ_EVT_RINT0, 13); //Map receive interrupt 0 to //Interrupt 13 IRQ_reset(IRQ_EVT_RINT0); IRQ_enable(IRQ_EVT_RINT0); //Enable interrupt MCBSP_enableRcv(hMcbsp0); MCBSP_enableSrgr(hMcbsp0); //Handle to SRGR MCBSP_enableFsync(hMcbsp0); } (2)TMS320LF2407 SCI module initialization procedure void sci_INIT(void) { MCRA=MCRA|0x0003; //Set pins SCITXD/IOPA0 and //SCIRXD/IOPA1 as serial communication function PADATDIR=0X0100; //Set port PA as input port SCICTL1=0x13; //Enable receiving and sending SCICTL2=0x02; //Disable sending interrupt, enable receiving interrupt SCICCR=0X07; //8-bit word length, 1 stop bit, multiple idle lines //Processor mode, no parity check SCIHBAUD=0x00; //Set the baud rate to 312.5kb/s SCILBAUD=0x09; SCIPRI=0x00; //Receive as high priority interrupt SCIRXST=SCIRXST&0xbf;//Clear SCI receive interrupt flag SCICTL1=0x33; //Save settings } Using the McBSP of TMS320C6711 and the SCI of TMS320LF2407, asynchronous serial data communication can be realized, which has the characteristics of simple circuit, flexible setting, fast data transmission speed, reliable and stable performance. On this basis, a master-slave dual DSP data processing system can be successfully constructed, effectively solving the problem that the data processing capability and control capability of a single DSP system are difficult to balance. The design scheme introduced in this article has been adopted in actual application systems and has been tested for a long time. Practice has proved that this design is an effective means of multi-DSP data exchange.