52832 SPI RX_buffer data

Hi, my slave will send 55 bytes to SPIM, if I check slave data when SPIM received all data, and it will spend 1.8ms, I think its long.

Can I check data when SPIM starts to receive? As SPIM receive one byte, I check one byte, not receive all 55 bytes, and then check it. I think this way can save more time. because when I check wrong data, I can drop rest of data.

thanks 

Parents
  • Hi,

    In theory you should be able to have a process that reads the RX buffer while you are receiving data, but I don't think we can guarantee that the data is there before the end event is generated. You can try and see if it works satisfactory.

    Or you could try doing multiple shorter transactions, and check between them. If your device needs to send 55 bytes at once you can keep the CS low between transactions by setting .cs in spi_config to 0 and controlling the CS pin manually.

    1.8ms for 55 bytes does sound a little slow though, are you running at a low clock frequency? If so would it be possible to increase it?

Reply
  • Hi,

    In theory you should be able to have a process that reads the RX buffer while you are receiving data, but I don't think we can guarantee that the data is there before the end event is generated. You can try and see if it works satisfactory.

    Or you could try doing multiple shorter transactions, and check between them. If your device needs to send 55 bytes at once you can keep the CS low between transactions by setting .cs in spi_config to 0 and controlling the CS pin manually.

    1.8ms for 55 bytes does sound a little slow though, are you running at a low clock frequency? If so would it be possible to increase it?

Children
Related