2017-07-08 01:35 PM
On page 34 of the STM32F030 datasheet there is a table of Alternate Functions that I think contains an error.
If you look at the GPIOA_AFR registers for port A and select column AF4 you will see that TIM14_CH1 is mentioned twice. The first time in connection with PA4 and the second time with PA7.
Either I do not quite understand how it works or the second instance of TIM14_CH1 should be in another column.
Besides that, why isn't this table in the Reference Manual (RM0360)?!
(btw. AF4 does connect TIM14_CH1 to PA4 )
Solved! Go to Solution.
2017-07-08 04:10 PM
It's a pin level mux, so the same signal can technically appear at multiple pins, you'd want to avoid doing that in practice, and PICK ONE, but the purpose is to allow signal escape and routing options across a wide range of parts sharing the same die, and in different packages.
The RM is a family level document, which might cover multiple die, the Data Sheet is more specifically die/package related. ie a model with more FLASH and RAM might well have additional peripherals (TIM, USART, etc).
2017-07-08 04:10 PM
It's a pin level mux, so the same signal can technically appear at multiple pins, you'd want to avoid doing that in practice, and PICK ONE, but the purpose is to allow signal escape and routing options across a wide range of parts sharing the same die, and in different packages.
The RM is a family level document, which might cover multiple die, the Data Sheet is more specifically die/package related. ie a model with more FLASH and RAM might well have additional peripherals (TIM, USART, etc).
2017-07-08 06:15 PM
The pin table calls out PA4 connecting to TIM14_CH1 as well as the AF table.
You'd want to make sure the GPIOA clock is enabled before setting the mux, and confirm TIM14 is supported in the specific part, although there is not a note to suggest otherwise from a quick skim of the table. Sorry, not a part I'm using, if on a DISCO/NUCLEO board confirm the pin doesn't have some external conflict.
2017-07-09 01:02 AM
TIM14 is supported, and I have no problems using it. I'm using the bare STM32F030 chip in the TSSOP20 version, no development board.
What I didn't understand is how TIM14_CH1 could be redirected to PA4 or PA7 via the same AF4 setting. I missed the fact that this setting is placed on either AFR4 (PA4) or AFR7 (PA7) location in the AFRL register. I understand it now.
(It never occurred to me that one could do both, I'll give it a try :-))
Thanks for explaining.