This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I've configured 2, 39c controllers. one as master and other as slave and I'm trying to send data with SPI.
MASTER: -
Slave: -
DATA is gettting sent but not received, Please clarify what I'm missing in the configuration
Hi Tejas,
Can you send your SPI configurations and their corresponding GPIO selections for the 2 devices?
You mentioned data is not getting received, so I'm assuming you are probing the pins of the receiving SPI. Are you not seeing any reading at all on the PICO pin, or are you seeing incorrect signals? Also, are you able to see the correct signals on the CLK pin? If not, it might be a connection issue.
Thanks,
Arnav
I've getting the expected readings on the PICO pin but it is not reflecting in the RXBUFF of SLAVE.
But No Data at the RXBUFF.
Hi Tejas
A couple more things to rule out -
1. Apologies for the repetition, but can you once again ensure that the pins as well as the SPI instance (A/B) selected in the SPI -> Pinmux tab in your Sysconfig match the configuration in your attached pictures.
2. Reading the SPIRXBUF register will clear the interrupt flag (More details on this in section 24.6.2.5 of the F280039C TRM). You can use the SPIRXEMU buffer for monitoring incoming data and retry the process.
Let me know if this resolves your issue. If not, I can take a look at your application code and help debug further.
Thanks,
Arnav
This is the state of registers at the slave side when I'm running the SPI_EX4_EXTERNAL_LOOPBACK_FIFO_INTERRUPTS on 2 controllers(39C) where master is sending and SLAVE is receiving the data. where I'm using the same code just removed receive code from MASTER side and removed Sending code from SLAVE side. Please help me debug the issue!
Looks like data is being received into the RX buffer, which wasn't happening before, is that right?
Can you attach the projects for the 2 devices to this thread in ZIP file format. I will check them out and get back to you.
Thanks,
Arnav
When I took the snapshots, receiver was not connected to the MASTER still the RXBUFF and TX buff got updated.
Hi Tejas,
I have tried out your project, and I am able to successfully receive correct data on the Peripheral SPI. I haven't been able to replicate the issue you seem to be facing. Can you change the GPIO Pinmux choice for all the pins and rerun with the new connections, just to make sure it's not an issue with the GPIO pins?
Thanks,
Arnav
Yes I'll try that and revert, One more doubt I have, I am first flashing the master Controller then just connecting it to power supply and then flashing the SLAVE controller in debug mode to check weather Data is receiving, is this setup correct?
And whileI'm flashing the slave controller the spi pins are connected to the MASTER, can this impact on not working of SPI?
Hi Tejas,
There shouldn't be any issue with this setup, especially since you're able to see the correct waveforms while probing. Were you able to fix the RX issue? Can you attach a picture of the waveform output from the controller SPI?
Also, the initial data in RXBUF can occur during setup time and can be ignored.
Thanks,
Arnav
Hey Arnav,
Thanks, by changing the PinMux the SPI is working now, I have one doubt in the mode 0,
when I'm sending data from the master the data is received by the slave but if I'm sending 0x0800, 0x100, 0x00 I'm receiving 0x0810 0x0C1 0x0600, why is that, configured for bit width of 8.
Also, when data is sent from master the data is received by the slave, but slave is not sending anything still Master's Rx buffer is getting updated continuously.
Hi Tejas,
Good to hear it's working.
With char length <16, writes to transmit buffer need to be left justified, and incoming data will be right justified in the receive buffer. So, if you mask out the corresponding 8 bits, you should be able to see the correct data TX/RX. More info on this can be found in the TRM.
According to SPI protocol, whenever SPI Controller transmits any data on SPIPICO pin, it will parallelly strobe for data on SPIPOCI pin. It doesn't matter if SPI Peripheral device is connected (or) not. So, if not expecting incoming data, the RX buffer contents are unpredictable, and can be considered invalid.
Thanks,
Arnav