Do I need pull up resistor for SPI and GPIO port ? thanks
The setting is :
/**SPI1 GPIO Configuration PA5 ------> SPI1_SCK PA6 ------> SPI1_MISO PA7 ------> SPI1_MOSI */ GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_6; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
Push pull doesn't need pull up resistor, but correct me if I'm wrong
The I2C bus does need pull-ups because it switched the direction of the lines, but SPI has only unidirectional lines.
how about CS of this interface ? do I need 3.3V pull up 10K resistor ?
You don't need pull up or down on SPI bus, unless the SPI bus can be cut between master and slave (ribbon cable).
What you need to be careful is the choise for the GPIO SPEED value for best signal shape on oscilloscope.
Retrieving data ...