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
Posted on May 22, 2018 at 13:03

And I would add Cycle-By-Cycle control to the 100MHz PWM requirement ...

T J
Lead
Posted on May 22, 2018 at 15:10

you need a 200MHz T FlipFlop, not a processor.

Posted on May 22, 2018 at 13:38

The formula I use says 31.25 ns is the period of a 32 MHz cycle.

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 15:44

I am pretty sure a 32GHz STM256G chip would work as well.

Posted on May 22, 2018 at 15:45

Yeah. Most of those wanting MHz PWM have no clue of what they are doing. Hopelessly unhelpable .

David Instone
Associate II
Posted on May 24, 2018 at 12:07

Unfortunately you have not been very clear about what you want from a 100MHz PWM signal but here goes. As others have said, if you want a variable frequency signal about 100MHz from the chips onboard PWM then there is no way you can get it from a 32MHz core clock without external frequency multiplication but you do not mention any requirements for duty cycle control. So if you want a 100MHz clock I suggest you get a 100MHz crystal oscillator module and you can at least turn it on and off with a transistor circuit and a single I/O pin. If you however want a variable frequency at that rate then you might have to consider a VCO module with the control voltage driven by the PWM. Not too sure if they are still called the same but 'Mini Circuits' used to be a very good source for that sort of thing. However you will still have to contend with the available frequency range versus what your exact requirements are not to mention the question of resolution at that frequency and no control whatsoever over duty cycle. The last option would be to build your own VCO to your required specifications that does allow you full control of duty cycle (Unless you can find one of those) but at 100MHz these things can get very complex. If you are a student doing a one off project then you might just be able to tweak it but for production we usually employ an Engineer who does that sort of thing all the time.