2023-04-25 09:12 AM
Hello,
For one of my projet, I need to use a Half Duplex SPI line in 8 bits in order to communicate with a sensor.
When receiving the data, the sensor need a certain amount of time between each group of 8 bits, so I can't just use a 16 bits line.
I tried to change the generated code from the HAL like *(__IO uint8_t *)&SPI->DR.
It works when sending data through SPI but when I switch to receiving mode, I get 16 ticks of clock, although I asked for 8 bits.
Do you have any idea how to receive only 8 bits ?
Regards,
2023-04-25 10:52 AM
Don't use Cube, enable the Rx mode only for a short time (a few NOPs or DSBs). Try to find an example.
JW