cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L053R8 PWM for 100MHz

Parthasarthi Malani
Associate II
Posted on May 22, 2018 at 08:38

Hi,

I am using STM32L053R8 controller.

I want to generate 100MHz, with 50% duty cycle.

Can you please share the code?

#stm32l053r8 #stm32l053r8-nucleo
15 REPLIES 15
Khouloud GARSI
Lead II
Posted on May 22, 2018 at 09:18

Hello,

parthasarthimalani

‌,

I advise you to refer to the 'TIM_PWMOutput' example provided in

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-mcu-packages/stm32cubel0.html

package. It's found under the path below:

STM32Cube_FW_L0_V1.0\Projects\STM32L053R8-Nucleo\Examples\TIM

The examples shows how to configure the TIM peripheral in PWM mode: It is configured to generate 4 PWM signals with 10 KHz frequency and duty cycles equal to 25, 3, 50 and 75%.

You may take the example as a reference to correctly configure your peripheral.

Khouloud.

AvaTar
Lead
Posted on May 22, 2018 at 10:03

I want to generate 100MHz, ...

Seems a bit out of spec, isn't it ?

AvaTar
Lead
Posted on May 22, 2018 at 11:21

I consider the 100Mhz as typo.

Even fast M7 do not support such high PWM frequencies - this is no use-case, for good reasons.

Try first to find switching elements (MOSFETs) that support such short cycle times. Magnetic losses in ferrite cores are substantial, with quite small permeability values. And not to mention the EMI issues, switching in the RF range.

Posted on May 22, 2018 at 10:18

Hi

meyer.frank

‌,

Correct!

STM32L0 core frequency: from 32 kHz up to 32 MHz.

Khouloud.

henry.dick
Senior II
Posted on May 22, 2018 at 13:00

'

Any way I can do it?'

Two ways to do it.

1. The easy way: come back in 148 years. By then ST would have produced a chip capable of 100MHz.

2. The hard way : understand what you are trying to do 

Posted on May 22, 2018 at 11:51

Hi , this is not typo, that is what my task.

I want to generate 100MHz PWM from same microcontroller.

Any way I can do it?

Posted on May 22, 2018 at 12:06

If you see data sheet of STM32L053R8 page number 101 --> table 70 --> Timer resolution time --> they have mentioned 31.25ns

Posted on May 22, 2018 at 12:34

>>If you see data sheet of STM32L053R8 page number 101 --> table 70 --> Timer resolution time --> they have mentioned 31.25ns

Ok, but in my part of the universe 100 MHz implies 5ns high, 5ns low

What part of your manual quote supports an argument for working at 100 MHz?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on May 22, 2018 at 12:38

That is what my question, is it typo in datasheet? or we are not thinking in different way?