• AVR Freaks

Hot!Multiple SPI job queues data loss at higher data rates

New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2011/01/25 17:58:31
  • Location: 0
  • Status: offline
2020/07/17 12:01:36 (permalink)

Multiple SPI job queues data loss at higher data rates

When sending SPI data between PIC32 microcontrollers at higher speeds (800+ kbps), multiple SPI jobs may be required to support the data transfers.  However, on the receiving microcontrollers, when one job is completed, the currentJob is set to NULL and the next job will not be queued until the following PolledTasks iteration.  In the intermediate time, data may enter the SPI buffer; however, when the next job is finally queued, the SPI Rx buffer is cleared.  This leads to data/pattern loss.
Solution:  (drv_spi_tasks.c)  DRV_SPI_PolledSlaveEBMxxxBitTasks() --8,16,32 bit verisons
Remove the call to PLIB_SPI_BufferClear(spiId) when pulling a job from the queue and setting it as the current job
Test Setup:  2 Separate PIC32MX795F512L dev boards, Fireberd BERC transmitting pseudorandom (QRSS, 2^23-1) patterns @ 2 Mbps
Jump to:
© 2020 APG vNext Commercial Version 4.5