I’m currently implementing the µDriver protocol on linux.
I don’t have a masterboard to compare what I send and what I should send. So I only use the followng description.
I don’t know if I missed it, but I don’t think that the document specified how the data is represented.
If I want to send an
uint16_t representing the
Mode field, should the 8 high value bits come first and in what order should they be sent to be correctly interpreted by the board ?
I tried different configurations, but the board always send the same message. (This might also come from the crc not being correctly interpreted).
It seems like, the mode specified in the document is not the right one.
In the masterboard firmware (spi_manager.c), the mode used is the spi mode 0.
.clock_speed_hz=SPI_MASTER_FREQ_80M / CONFIG_SPI_DATARATE_FACTOR, //Clock out
.mode=0, //SPI mode 0
.spics_io_num=GPIO_DEMUX_OE, //CS pin
.queue_size=10, //We want to be able to queue 10 transactions at a time
.pre_cb=spi_pre_transfer_callback, //Specify pre-transfer callback to handle D/C line
.post_cb=spi_post_transfer_callback, //Specify pre-transfer callback to handle D/C line
After some testing with the spi mode set 0, I found that the value are transmitted from high value bits to low value. The problem was more about the spi mode as this is the default way data was transmitted.