Skip to main content
Peter Mather
Associate III
Jun 21, 2019 7:22 AM UTC
Solved

SPI clock issue in modes 2 and 3: H743

The clock and data lines on SPI seem to go tri-state off when not in use even though the SPI channel is left open. Is this expected behaviour? It causes issues with some connected chips as they see the re-establishment of the driven clock signal as a clock pulse

Code is:

HAL_SPI_TransmitReceive(&hspi3, mybufft.cTxBuffer, mybuffr.cRxBuffer, 1, 5000);

0690X000008j2JBQAY.jpg

This topic has been closed for replies.
thomfischer
thomfischerBest answer
Senior
Jun 21, 2019 3:34 PM UTC

see

void MX_SPI1_Init(void)

{

...

...

 hspi1.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_ENABLE;

...

2 replies

waclawek.jan
Super User
Jun 21, 2019 7:28 AM UTC

> Code is:

> HAL_SPI_TransmitReceive(&hspi3, mybufft.cTxBuffer, mybuffr.cRxBuffer, 1, 5000);

That's no code. That's a call to a "library" function. Look at that what it does.

Or use bandaid a pullup.

JW

thomfischer
thomfischerBest answer
Senior
Jun 21, 2019 3:34 PM UTC

see

void MX_SPI1_Init(void)

{

...

...

 hspi1.Init.MasterKeepIOState = SPI_MASTER_KEEP_IO_STATE_ENABLE;

...