cancel
Showing results for 
Search instead for 
Did you mean: 

why STM32H743 SPI not working as good as TI MSP430G SPI

Emeipang
Associate

Using NUCLEO-H743ZI2, but SPI not working properly on my I/O board with chain of TPIC6B595 shift register from TI.

8 TPIC6B595s are daisy chain thru a buffer chip 74ACT244.

Master Mode on H743, 3 wire SPI, one GPIO LED1 on PB0

Init:

 /* Set the SPI parameters */

 SpiHandle.Instance        = SPIx;

  

 SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;

 SpiHandle.Init.Direction     = SPI_DIRECTION_2LINES;

 SpiHandle.Init.CLKPhase     = SPI_PHASE_2EDGE;

 SpiHandle.Init.CLKPolarity    = SPI_POLARITY_LOW;

 SpiHandle.Init.CRCCalculation  = SPI_CRCCALCULATION_DISABLE;

 SpiHandle.Init.CRCPolynomial   = 7;

 SpiHandle.Init.DataSize     = SPI_DATASIZE_8BIT;

 SpiHandle.Init.FirstBit     = SPI_FIRSTBIT_MSB;

 SpiHandle.Init.NSS        = SPI_NSS_SOFT;

 SpiHandle.Init.TIMode      = SPI_TIMODE_DISABLE;

  

#ifdef MASTER_BOARD

 SpiHandle.Init.Mode = SPI_MODE_MASTER;

#else

 SpiHandle.Init.Mode = SPI_MODE_SLAVE;

#endif /* MASTER_BOARD */

 if(HAL_SPI_Init(&SpiHandle) != HAL_OK)

 {

  /* Initialization Error */

  Error_Handler();

 }

calling:

 while(1)

  {

HAL_Delay(100);

bOutput[4] ^= 0x80;

HAL_SPI_TransmitReceive(&SpiHandle, (uint8_t*)bOutput, (uint8_t *)bInput, 8, 50);

BSP_LED_On(LED1);

HAL_Delay(1);

BSP_LED_Off(LED1);

  }

I tried 4 combinations of Clock Polarity and Phase, they did not working the same as TI MCU MSP430.

It is running the default system clock setting from STM32H7 demo package, 

Please advise why I have a problem on the SPI. Many thanks in advance.

0690X00000AQaonQAD.png0690X00000AQaoiQAD.png0690X00000AQaoTQAT.png0690X00000AQaoOQAT.png

2 REPLIES 2

Dupe https://community.st.com/s/question/0D50X0000BHyYWeSQN/stm32h743-spi-not-working-but-ti-msp430g2553-works?t=1567523206388

Reposted question THREE times

EDIT your posts if you need to add content

Driving the chip select signal where?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Emeipang
Associate

Hi Clive,

H743ZI2 to I/O

PB0 ---> RCK-3//5V

D11 ---> MOSI-3/5V

D12 ---> MISO

D13 ---> SCK-3/5V

GOUND ----> SOUT-3/5V

Thank you.