2020-09-08 12:49 PM
The transmit command only clocks out the provided data and then the clock stops, I need it to continue for 8 dummy clocks before doing receive I think.
I bet there is a simple answer to this though, can you help me?
2020-09-08 01:13 PM
So the frame is 39 bits long? Or is it 40 and they just aren't showing the 39th pulse?
If it's 40, then you just send 0x9F followed by 4 zero bytes. Presumably having DI be 0 instead of high impedance is okay. And then ignore the first 2 bytes of data you get back.
uint8_t data[5] = {0x9F};
HAL_SPI_TransmitReceive(&hspi, data, data, 5, HAL_DELAY_MAX);
uint8_t mfr_id = data[2];
uint8_t devid = data[3] << 8 + data[4];
Did not test that code, should be close.
2020-09-10 02:26 AM
Thank you TDK, I'll give this a go today! RP
2020-09-10 03:18 AM
Great, that worked. I needed to disable NSSP mode also. :)
2020-09-10 11:39 AM
> I needed to disable NSSP mode also.
Why?
JW