2020-06-05 09:49 AM
I'm using low level commands to send SPI data to a flash part. I'm in master mode and am using the following 3 commands(just testing) and see 16 clock pulses for each of these.
WRITE_ENABLE_CMD = 0x06 and using the 8bit routine I see 0x06 sent on the upper 8 bits, 0 on the lower but still 16 clock pulses.
Using 16 bit command I see 0x06 on the upper 8 bits and 0x06 on the lower 8 bits.
Using spi.Instance->DR = 0x06 it's on the lower 8 bits and if I set it to 0x0600 it's on the upper 8 bits. My part, to send a write enable command, has to have 0x06 in 8 clocks (1 byte) and then CS needs to go high or the part will ignore the command.
LL_SPI_TransmitData8(spi.Instance,WRITE_ENABLE_CMD);
LL_SPI_TransmitData16(spi.Instance,WRITE_ENABLE_CMD);
spi.Instance->DR = WRITE_ENABLE_CMD;
Is there any way to just send 8 bit bytes one a a time even though the DR register is 16 bits?
Thanks
2020-06-05 09:53 AM
If you use a 8bit transmit data and SPI configurated to work with 8 bit data, SPI send only 8 bit
2020-06-05 10:13 AM
Great. I set the config in init to 16 bit and forgot it. Thanks a lot.