2021-08-31 06:55 AM
Hello!
How can I configure only the MISO pin in the mode falling edge triggered interrupt input? It's not possible to do it on CubeMX. I tried to change the spi.c file like follows:
/**SPI3 GPIO Configuration
PA15 ------> SPI3_NSS
PC10 ------> SPI3_SCK
PC11 ------> SPI3_MISO
PC12 ------> SPI3_MOSI
*/
GPIO_InitStruct.Pin = GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF6_SPI3;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12;
GPIO_InitStruct.Mode = I replaced GPIO_MODE_AF_PP; by GPIO_MODE_AF_PP|GPIO_MODE_IT_FALLING|GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF6_SPI3;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
But it doesn't work. Any help, please?
Solved! Go to Solution.
2021-09-27 05:32 AM
thank you all for your help so far. I realized that only setting on Cube a pin as Alternate Function Push Pull is enough to allow you to use this pin as falling edge triggered interrupt input (as this was need for the ADC ads1118). The problem was actually with the spi3 configuration on Cube: I misconfigured the CPAH. This was the key to solve the issue!