Other Parts Discussed in Thread: TMS320F28027, CC2520
Hi,
I am working with TMS320F28027 piccolo. I want to operate in SPI 4 wire mode to communicate with a tranceiver chip.I am using this tranceiver to receive a signal from transmitter side.Currently i am seeing on scope that the signal is received properly by the tranceiver but it is not getting communicated properly to SPI.
Earlier i was running in loopback mode(SpiaRegs.SPICCR.bit.SPILBK=1;) and my receiver was receiving signals properly from transmitter side(i checked the received digital signal on scope by directly probing on the receiver) but it was not read properly by TMS320F28027(I checked the value of received signal in watch window and it was wrong).Then,I figured out that i am reading the same value on watch window what i send.This is how i figured out that i was operating in loopback mode but then i changed the configuration to disable the loopback mode (SpiaRegs.SPICCR.bit.SPILBK=0;) and now the receiver has stopped receiving any signals.
Please advice me for operating SPI in 4 wire mode as there are no examples in control suite which demonstrate this.
Here is my code for SPI AND SPI-FIFO Initialization
{
SpiaRegs.SPICCR.bit.SPISWRESET=0;
SpiaRegs.SPICCR.bit.CLKPOLARITY=0;
SpiaRegs.SPICCR.bit.SPICHAR=7;
SpiaRegs.SPICTL.all =0x000E; // Enable master mode, SPICLK delayed by half cycle
// enable talk, and SPI int disabled.
SpiaRegs.SPIBRR =0x0000;
SpiaRegs.SPICCR.bit.SPILBK=0;
SpiaRegs.SPIPRI.bit.FREE = 1; // Set so breakpoints don't disturb xmission
SpiaRegs.SPIPRI.bit.TRIWIRE= 0;
SpiaRegs.SPICCR.bit.SPISWRESET=1;
}
void spi_fifo_init()
{
// Initialize SPI FIFO registers
SpiaRegs.SPIFFTX.all=0xE040;
SpiaRegs.SPIFFRX.all=0x2044;//0x2044
SpiaRegs.SPIFFCT.all=0x0;
}
Thanks
Misha