cancel
Showing results for 
Search instead for 
Did you mean: 

Hello All, I am using STM32f105rbt, issue is comming when i am using Ethernet and PWM using TIM1 simualteniously. individually both are working. please any one can help me?

Shail
Associate II

If i am generating PWM pulse by uing TIM1 (PA8) my ethernnet not worming?

for ethernet config i m using CMSIS lib provided by ST

Pwm configuration is s follows

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);

 RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE);

 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;

 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 

 GPIO_Init(GPIOA, &GPIO_InitStructure);

 TIM_TimeBaseStructure.TIM_Prescaler = (uint16_t)(Prescaler);

 TIM_TimeBaseStructure.TIM_Period = (uint16_t)(Period);

 TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; 

 TIM_TimeBaseStructure.TIM_ClockDivision = 0; // Not used

 TIM_TimeBaseStructure.TIM_RepetitionCounter = 0; // Not used

 TIM_TimeBaseInit(TIM1, &TIM_TimeBaseStructure);

 TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;

 TIM_OCInitStructure.TIM_Pulse = (uint16_t)(duty_cycle); // 50% /2

 TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;

 TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Enable;

 //TIM_OCInitStructure.TIM_OCPolarity  = TIM_OCPolarity_High;

 //TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_Low;

 //TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Set;

 //TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset;

 TIM_OC1Init(TIM1, &TIM_OCInitStructure);

 TIM_Cmd(TIM1, ENABLE);

 TIM_CtrlPWMOutputs(TIM1, ENABLE);

1 REPLY 1
Piranha
Chief II

STM32F105xx doesn't have Ethernet peripheral:

https://www.st.com/en/microcontrollers-microprocessors/stm32f105-107.html

There is no such thing as "CMSIS lib". Your code looks to be using the older SPL library.