2019-09-03 07:28 AM
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.
2019-09-03 08:10 AM
Reposted question THREE times
EDIT your posts if you need to add content
Driving the chip select signal where?
2019-09-03 09:42 AM