SPI Master - Better performance

7 posts / 0 new
Last post
Matthieu ANTOINE
Offline
Last seen:4 years 3 months ago
Expert
加入:2014-01-14 14:51
SPI Master - Better performance

Hi,

I am using the DA14580 as SPÏ master to exchange data with an external controller.
It appears that performances are really bad (mainly due to the latency, around 4µs between each byte sent) with the spi driver. Is there another driver that would allow me to get an higher baudrate?

Thanks!
_Matthieu

Device:
MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
加入:2015-06-08 11:34
Hi Matthieu,

Hi Matthieu,

Sorry, but there is no better version of the spi driver, the approximatelly 4 us is the amount of time that the da waits until the transmition of the data is over. I assume that you dont use the FIFO. Try to use it in the mode you prefer in order to send data faster. The times between bytes will decrease.

Thanks MT_dialog

Matthieu ANTOINE
Offline
Last seen:4 years 3 months ago
Expert
加入:2014-01-14 14:51
Hi,

Hi,

你有一个例子,使用先进先出? The chip is acting as master.

Thanks.
_Matthieu

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
加入:2015-06-08 11:34
Hi Matthieu,

Hi Matthieu,

Sorry, but there is no example using the SPI with the FIFO. Please have a look at the datasheet in order to implement.

Thanks MT_dialog

Matthieu ANTOINE
Offline
Last seen:4 years 3 months ago
Expert
加入:2014-01-14 14:51
Hi,

Hi,

The datasheet does not give precise details about the way to use it. Do you have some guidelines?

Thanks.
_Matthieu

Matthieu ANTOINE
Offline
Last seen:4 years 3 months ago
Expert
加入:2014-01-14 14:51
Hi again,

Hi again,

The main thing is that I do not understand why the FIFO would decrease the timing wetween two bytes.

_Matthieu

MT_dialog
Offline
Last seen:1 week 4 days ago
Staff
加入:2015-06-08 11:34
Hi Matthieu,

Hi Matthieu,

Sorry but there is no documentation in how to use the FIFO in SPI.

But if you try to set your FIFO in TX_MODE for example like this: SetBits16(SPI_CTRL_REG1, SPI_FIFO_MODE, 0x02); and then call something like this:

spi_cs_low();
while(1)
{
if(GetBits16(SPI_CTRL_REG, SPI_TXH)==0)
{
SetWord16(SPI_RX_TX_REG0, (uint16_t)i); // write (low part of) dataToSend
}
i++;
}
spi_cs_high();

You will see that the time between each successive byte decreasing.

Thanks MT_dialog