Electronics > Microcontrollers

STM32 Timers channels questions?

(1/1)

kgavionics:
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

wek:
> 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

langwadt:
unless you want to make things more difficult than necessary, just start with cubemx and go from there

kgavionics:
Thank you for the heads up JW!

kgavionics:
Thank you ! I installed CubeMx and I’ll use it in conjunction with Keil Arm uvision!

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod