STM32F767BI PWM

General discussion on mikroC PRO for ARM.
Post Reply
Author
Message
Mustafa Shadafna
Posts: 4
Joined: 11 Jan 2021 12:50

STM32F767BI PWM

#1 Post by Mustafa Shadafna » 24 Mar 2021 12:17

Hi,

I working with STM32F767BI and MikroC v6.2.0
I can't able to generate PWM on p4-p5, but I have been succeeded to generate on p1-p3.
when typing _GPIO_MODULE_TIM and pressing [Crtl]+[Space] I can't find appropriate module pinout for p4 and p5 in list available module pinouts, how can I find it?

here is the code I coded to generate pwm on p1 and p2.

Code: Select all

unsigned int current_duty, current_duty1;
void main() {
 current_duty = PWM_TIM1_Init(40000);
 current_duty1 = PWM_TIM2_Init(40000);
 
 PWM_TIM1_Set_Duty(current_duty/2,_PWM_NON_INVERTED,_PWM_CHANNEL1);
 PWM_TIM2_Set_Duty(current_duty1/2,_PWM_NON_INVERTED,_PWM_CHANNEL3);
 
 PWM_TIM1_Start(_PWM_CHANNEL1, &_GPIO_MODULE_TIM1_PE9);
 PWM_TIM2_Start(_PWM_CHANNEL3, &_GPIO_MODULE_TIM2_PB10 );
 
 while(1){
 }

}
thanks

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: STM32F767BI PWM

#2 Post by filip » 25 Mar 2021 15:01

Hi,

You may open __Lib_GPIO_32F76x_77x_Defs.c from the \mikroC PRO for ARM\Uses\ST M7\, locate the _GPIO_MODULE_TIM definitions and then manually add the wanted PWM pin definition.

Regards,
Filip.

Post Reply

Return to “mikroC PRO for ARM General”