2020-08-06 12:29 AM
STM32 and IC are connected by SPI.
Tx is connected to SPI2, Rx is connected to SPI3, and communication is successful.
However, since the IC outputs 1NSS per 32bits, the first 16bits can be received, but the latter 16bits are not.
After receiving the first 16bits, the contents of the later 16bits cannot be received because it has not entered the DR.
Is there any setting or way to get this?
STM32's Rx Signal is shown below.
The SPI of STM32 Rx is set as follows.
hspi3.Instance = SPI3;
hspi3.Init.Mode = SPI_MODE_SLAVE;
hspi3.Init.Direction = SPI_DIRECTION_2LINES_RXONLY;
hspi3.Init.DataSize = SPI_DATASIZE_16BIT;
hspi3.Init.CLKPolarity = SPI_POLARITY_HIGH;
hspi3.Init.CLKPhase = SPI_PHASE_2EDGE;
hspi3.Init.NSS = SPI_NSS_HARD_INPUT;
hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB;
hspi3.Init.TIMode = SPI_TIMODE_ENABLE;
hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
hspi3.Init.CRCPolynomial = 10;
Thank you for your help.
2020-08-06 12:43 AM
Who can answer without knowing which of the 300+ part numbers of the portfolio is used? SPI has no TX or RX. Master, slave, MISO, MOSI,....
2020-08-06 03:08 AM
There aren't 32 bits after the NSS toggle. There's only 28. You need to send 4 more bits to get a multiple of 16.
2020-08-06 04:28 AM
> hspi3.Init.TIMode = SPI_TIMODE_ENABLE;
Is this intentional?
JW
2020-08-06 04:41 PM
Communication is made by setting the SPI Direction to TxOnly and RxOnly.
2020-08-06 04:43 PM
If TI Mode is Disable, data before NSS Toggle is read. So I set it to Enable. In the current setting, the first 16 bits are read normally.