Dear team:
One of my customer use SPI which simulated by the McBSP module of f28335 to communicate with TLV5638.
Now TLV5638 chip can output DA signal normally, but there is a problem: outa and outb, only one output can be selected, but not two ports at the same time. Configure according to the example of output at the same time in the chip manual, but only the data of outa can be detected. What may be the problem?
Below is the code:
void InitMcbspa16bit(void) { McbspaRegs.RCR1.bit.RWDLEN1=2; // 16-bit word McbspaRegs.XCR1.bit.XWDLEN1=2; // 16-bit word } Uint16 mcbsp_xmit(Uint16 McbspTXD) { Uint16 McbspRXD; McbspaRegs.DXR1.all=McbspTXD;// McbspTXD=v->xxxx,待发送数据 // McbspaRegs.DXR2.all=McbspTXD; while(McbspaRegs.SPCR2.bit.XRDY==0){} //等待变1,表示发送器准备好 while(McbspaRegs.SPCR2.bit.XEMPTY==1){} //等待变0,表示XSR为空 // while(McbspaRegs.MFFTX.bit.TXFFST!=0){} while(McbspaRegs.SPCR1.bit.RRDY == 0){} //等待变1,表示接收器准备好 // while(McbspaRegs.SPCR1.bit.RFULL != 1){} //等待RBR退满 // while(McbspaRegs.MFFRX.bit.RXFFST != 1) {} //wait for McBSP_SPI receive McbspRXD=McbspaRegs.DRR1.all; // 接收到的数据 return(McbspRXD); }
Best Regards