Tool/software:
Hi Forum,
I have two launch pads configured to run at 24Mhz connected via SPIsending a random 32 Byte packet from the master to the slave using half duplex transmit polling method, I think the code is falling victim to the USCI42 errata but not sure. I have tried a bunch of different ways to resolve it with no luck.
The master is configured as follows
e2e.ti.com/.../spi_5F00_master_5F00_config.c
The Transmit and receive is like this:
memset((void *)txbuff, 0, PACKET_BUFFER_MAX_SIZE); memset((void *)rxbuff, 0, PACKET_BUFFER_MAX_SIZE); randomizeData((void *)txbuff, PACKET_BUFFER_MAX_SIZE); spi_master_Transfer((void *)txbuff, PACKET_BUFFER_MAX_SIZE); __delay_cycles(120000); spi_master_Receive((void *)rxbuff, PACKET_BUFFER_MAX_SIZE); printf("\r\nTX Buffer:\r\n"); printBuffer((void *)txbuff, PACKET_BUFFER_MAX_SIZE); printf("\r\nRX Buffer:\r\n"); printBuffer((void *)rxbuff, PACKET_BUFFER_MAX_SIZE); send_receive_slave = false;
The SPI receive on the other board is setup using interrupts like this:
e2e.ti.com/.../spi_5F00_slave_5F00_config.c
The first transfer works correctly then all subsequent transfers error with an erroneous first byte as shown in the image below, I have the push button initiating the transfer.
After the first transfer the UCB0TXBUF has 0xFF in there and the next transfer gets that as the first byte. I haven't found a way to clear it, before the next transfer, resetting the peripheral didn't clear it? Is there a way to work around this issue or am I doing something incorrectly prior to subsequent transmissions? Any help would be greatly appreciated.
--- George