Author Topic: STM32 Timers channels questions?  (Read 640 times)

0 Members and 1 Guest are viewing this topic.

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
STM32 Timers channels questions?
« 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
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 495
  • Country: sk
Re: STM32 Timers channels questions?
« Reply #1 on: February 02, 2023, 06:33:34 pm »
> 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
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 4430
  • Country: dk
Re: STM32 Timers channels questions?
« Reply #2 on: February 02, 2023, 06:48:47 pm »
unless you want to make things more difficult than necessary, just start with cubemx and go from there
 
The following users thanked this post: thm_w

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: STM32 Timers channels questions?
« Reply #3 on: February 03, 2023, 12:36:47 am »
Thank you for the heads up JW!
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: STM32 Timers channels questions?
« Reply #4 on: February 03, 2023, 12:38:26 am »
Thank you ! I installed CubeMx and I’ll use it in conjunction with Keil Arm uvision!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf