I am using STM32L053R8 controller.
I want to generate 100MHz, with 50% duty cycle.
Can you please share the code?
Hello, Parthasarthi Malani,
I advise you to refer to the "TIM_PWMOutput" example provided in STM32CubeL0 package. It's found under the path below:STM32Cube_FW_L0_V1.10.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, 33.3, 50 and 75%.
You may take the example as a reference to correctly configure your peripheral.
I want to generate 100MHz, ...
Seems a bit out of spec, isn't it ?
Correct!STM32L0 core frequency: from 32 kHz up to 32 MHz.
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?
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.
If you see data sheet of STM32L053R8 page number 101 --> table 70 --> Timer resolution time --> they have mentioned 31.25ns
>>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?
That is what my question, is it typo in datasheet? or we are not thinking in different way?
The formula I use says 31.25 ns is the period of a 32 MHz cycle.
"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
And I would add Cycle-By-Cycle control to the 100MHz PWM requirement ...
Yeah. Most of those wanting MHz PWM have no clue of what they are doing. Hopelessly unhelpable .
you need a 200MHz T FlipFlop, not a processor.
I am pretty sure a 32GHz STM256G chip would work as well.
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.
Retrieving data ...