EEVblog Electronics Community Forum
Electronics => Microcontrollers => Topic started by: kgavionics on February 02, 2023, 06:29:36 pm
-
Hello guys
Sorry if this is a stupid question!
I want to generate a wave form using the output compare feature on Stm32F407 on timer3, but I'm a bit confused which pin do I have to choose, because if I look in the alternate function table, I find that TIM3_CH1 is assigned to the following pins:
-PA6
-PB4
-PC6
So, my question, can I use either one of them? Also, they don't mention if these channels are inputs or outputs! So, I guess I have to use the MODER register to set them there?
Thank you in advance
-
> can I use either one of them?
Yes.
> Also, they don't mention if these channels are inputs or outputs!
Once they are set to AF in GPIOx_MODER and assigned to timer in GPIOx_AFR[], it's the timer which determines the direction - through setting given channel to Input Capture or Output Compare (using TIMx_CCMRx.CCxS).
JW
-
unless you want to make things more difficult than necessary, just start with cubemx and go from there
-
Thank you for the heads up JW!
-
Thank you ! I installed CubeMx and I’ll use it in conjunction with Keil Arm uvision!