2021-06-27 09:53 AM
I want to transfer binary data (not character) without having to worry about character conversion, so directly:
uint8_t data = 0xBF;
HAL_SPI_Transmit(&spi1handle, (uint8_t *) data, 1, 1000);
But I get something else at the receive end, specifically I get for example 0xDC so not the same data that I send. As a beginner I would like to know how I can make the above work.
2021-06-27 10:48 AM
This was the correct approach.
You need to double check clocking and phase options at both ends.
>>But I get something else at the receive end.
Unfortunately you don't state what. Perhaps shifted one bit left or right?
2021-06-27 11:37 AM
Note that SPI needs a method to synchronize bytes, typically through use of a CS pin.
2021-06-27 02:37 PM
@Community member @TDK Do I need to do something with the bits at the receive ends? I expect that if I send 8 bits which is 0xBF , I receive those 8 bits (configured it for 8 bits data). I will try again, how can I best debug this kind of problem?