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 

  • 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?

  • ok, but I don't know how I can set MCU frequency for 64M, SDK demo default frequency is 64M?

    could you tell me how to set for 64M? 

  • I was referring to the SPI frequency, but if you haven't changed the frequency it should be the default 8M. I would need to know more about your application configuration and slave device to understand why it is only able to send 55 bytes in 1.8ms.

    In that case the previous suggestions regarding the transactions are a possible solution.

Related