2012-03-19 10:20 PM
Hi. Could You help me to understand somethink. In STM32 like STM32F103c8... there is a clock signal called RCC_APB2Periph_AFIO. When should be turned on this signal, always when I use peripherial, like Timmer, AD, USART or I2C or maybe when I used pins attached to this peripherial?
Why we turn on this clock and also we give clock to the peripherial like ADC, SPI, USART? Why not only to ADC, SPI, USART but also to AFIO?2012-03-19 10:32 PM
According to the manuals AFIO deals with Pin Remapping and EXTI
2012-03-19 11:17 PM
You've already asked exactly the same question on the Keil forum:
There, you have been pointed to the Reference Manual for the STM32F103c8. Have you studied that Reference Manual yet? You really need to take time to get familiar with that document! In particular, look at the System Architecture and Clock Tree descriptions - including the diagrams...2012-03-20 12:03 AM
Yes, I wrote there but they told me write on this forum.
Answering to next question, I read RM but I could not find nothing about clock signal called AFIO. If you could, please show me where I can find something about it? I do not know if this clock (to AFIO) should be turned on if I used remapped pins (I mean, instead of using dedicated pin for TIM3_CH1 like PA6 I used full remappig on PC6) or AFIO should be used if instead of GPIO I use I2S?2012-03-20 11:58 AM
The RM is a PDF document; it has a 'Search' facility - so just put ''AFIO'' into the 'Search' facility to find out about it...
2018-11-23 08:30 AM
From RM0008 - pag. 175/1132
"9.3 Alternate function I/O and debug configuration (AFIO)
To optimize the number of peripherals available for the 64-pin or the 100-pin or the 144-pin
package, it is possible to remap some alternate functions to some other pins. This is
achieved by software, by programming the AF remap and debug I/O configuration register
(AFIO_MAPR). In this case, the alternate functions are no longer mapped to their original
assignations."
other info:
7.3.7 APB2 peripheral clock enable register (RCC_APB2ENR)
on page 114/1132 you can see "AFIOEN: Alternate function IO clock enable".
From these info you should be understand what this means.
Best regards
Fabio
2021-01-19 10:56 AM
I understand the need for AF in order to share pins etc. But like the OP, is there a simple explanation as to why I have to call:
RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE);
as in why would I need to call a clock enable function?
2021-01-19 12:33 PM
Synchronous logic likes its clock to be ticking, CMOS consumes little when its not.