2023-11-27 12:23 AM
Hi I m using STM32H7 for SPI transmit & receive, the code is working and able to transmit 2 byte successfully as seen from scope, but the inital CS pin was unable to set to high from .ioc. CS = PA4 and set to GPIO output level HIGH and max output speed to Very high, but waveform show low at start and then high to low again... why is this so. any one can advise how to set CS to high then low initally..
2023-11-27 06:21 AM
Ensure the .ioc configures the initial output level to HIGH and place a pull-up resistor (10K should be fine) on the signal to keep it high during the time the pin isn't yet configured (i.e., from reset until MX_GPIO_Init()).
2023-11-27 06:49 PM
Hi David, the SPI CPOL and CPHA was set to mode 2 i.e. high and edge1 but the clk waveform show start from low to high then low to init SPI ... why is this so? shouldn't it be showing starting high then low to init SPI?
2023-11-28 06:19 AM
Think of it this way: what's the nCS pin state prior to the SPI module taking control of the pin?
2023-11-28 08:00 AM
Hello @StanCosgrove
Which board are you using? Is it custom board?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-28 08:18 AM - edited 2023-11-28 08:20 AM
you should set : keep io state enable
and pullup on nss pin
+ dont set hi speed, try medium first . ( high speed giving lot of ringing...)
2023-11-28 05:45 PM
STM32H743
2023-11-28 05:47 PM
CS pin inital state should be high then low to initialise the SPI.....
2023-11-29 06:19 AM
Sigh. Did you even try the pull-up resistor?
2023-11-29 06:38 AM
yes, try already... same result...