2022-01-12 02:28 AM
Things that have tried.
Kindly requesting to sent the procedure or sample code to sent 24 bit of data through STM32 SPI
2022-01-14 06:48 AM
TDK,
while I agree with everything you wrote, but, even if clock is 16MHz and Cube/HAL is used, isn't cca 10us for pulse generated by two consecutive HAL_GPIO_WritePin() calls too much? That's like 160 clock cycles...
This is 'F7, can AXI be the reason? I don't use 'F7...
[EDIT]
From the bus structure it appears that in 'F7 GPIO (and both AHB buses going to peripherals) don't go through the AXI attachment, but directly through AHBP. Pity the RM does not deal with this in details...
But then the "slowness" is a mystery to me...
[/EDIT]
JW
2022-01-14 07:08 AM
The hardware NSS of SPI in master mode is mostly useless.
One way to make SPI timing more deterministic and avoid "manual" wiggling of NSS is to generate the clock signals using cascaded timers, and connect them externally to SPI set as a slave. Not trivial.
JW
2022-01-14 07:10 AM
> even if clock is 16MHz and Cube/HAL is used, isn't cca 10us for pulse generated by two consecutive HAL_GPIO_WritePin() calls too much?
Yes, seems like too much. I can't really explain that either, but could be the OP simplifying code. I don't use F7 either.
> HAL_SPI_Transmit(&hspi1,(uint8_t *) &EEPROM_WRDI , 1, 100);
Actually, since the word size is limited to 16 bits, I don't see how the exact code presented (which sends 1 word) could have produced the scope screenshot (which shows 24 bits). Could be missing something.
2022-01-17 10:37 PM
Hi All,
I tried the advice from TDK ,
With clock frequency change ,got significant improvement on the timing. ( Oscilloscope screen shot attached) .
If you have any more suggestion to improve the timing , kindly advice me.
Regards,
Rahul S
2022-01-17 10:38 PM