Other Parts Discussed in Thread: PGA280, CONTROLSUITE
Hi,
I am using SPI-A on the C2000 launchpad ,To test my chip i have used the spi_lopback_interrupts example code with a little modification (disabling loopback and data check in receive function) ,
which has the following SPI-FIFO init function,
A few questions
1>> How does the interrupt get generated first time automatically since the example code doesnt write anything to SPIBUF
2>> I find that this code continuously transmits data without a delay ,I wish to send 2 bytes , a delay and then 2 bytes .How do i do this
please help!!!
void spi_fifo_init()
{
// Initialize SPI FIFO registers
SpiaRegs.SPICCR.bit.SPISWRESET=0; // Reset SPI
SpiaRegs.SPICCR.all=0x001F; //16-bit character, Loopback mode
SpiaRegs.SPICTL.all=0x0017; //Interrupt enabled, Master/Slave XMIT enabled
SpiaRegs.SPISTS.all=0x0000;
SpiaRegs.SPIBRR=0x0063; // Baud rate
SpiaRegs.SPIFFTX.all=0xC022; // Enable FIFO's, set TX FIFO level to 2
SpiaRegs.SPIFFRX.all=0x0022; // Set RX FIFO level to 2
SpiaRegs.SPIFFCT.all=0x00;
SpiaRegs.SPIPRI.all=0x0010;
SpiaRegs.SPICCR.bit.SPISWRESET=1; // Enable SPI
SpiaRegs.SPIFFTX.bit.TXFIFO=1;
SpiaRegs.SPIFFRX.bit.RXFIFORESET=1;
}
Regards
Abhay