2019-04-25 02:25 AM
There are multiple alternating functions for one peripherals. Why and what is the difference?
Solved! Go to Solution.
2019-04-25 11:11 AM
Angus,
You have to look at the specific entries of the "Port x alternate functions" tables in the datasheet (that Clive mentioned) in order to know the relation among SPI functions, the GPIO ports and pins that implement them, and the corresponding AF codes.
AF codes don't have a special meaning by themselves. They are just codes you use to configure the GPIO pins.
The STM32H743xx can use, for example, five GPIO pins as SPI2 slave selection (NSS) : PA11, PB4, PB9, PB12 and PI0. All alternate function codes are AF5, except for one: AF7 is used for PB4.
Any given GPIO pin can be used for many different functions under different AF codes. That is the kind of information one gets from the tables mentioned above.
2019-04-25 02:28 AM
You should tell the device you talk about!
2019-04-25 02:31 AM
sorry, forgot, it is the stm32h743zi
2019-04-25 02:39 AM
It means that for each pin you must look up if you should use GPIO_AF5_SPI2, GPIO_AF6_SPI2 or GPIO_AF7_SPI2.
2019-04-25 06:15 AM
Some of the newer STM32 have inconsistent muxing across multiple GPIO banks, especially when you get to higher pin counts/banks, The lower banks, with smaller packages get far more dense. Given me headaches on L0 devices.
You should look at the pin tables in the Data Sheet to confirm routing options. Choices aren't always ideal, and get locked in across new silicon as changing would be exceedingly disruptive, so badly thought out choices made early in the design get frozen in for a generation.
2019-04-25 11:11 AM
Angus,
You have to look at the specific entries of the "Port x alternate functions" tables in the datasheet (that Clive mentioned) in order to know the relation among SPI functions, the GPIO ports and pins that implement them, and the corresponding AF codes.
AF codes don't have a special meaning by themselves. They are just codes you use to configure the GPIO pins.
The STM32H743xx can use, for example, five GPIO pins as SPI2 slave selection (NSS) : PA11, PB4, PB9, PB12 and PI0. All alternate function codes are AF5, except for one: AF7 is used for PB4.
Any given GPIO pin can be used for many different functions under different AF codes. That is the kind of information one gets from the tables mentioned above.