Phase shifted pulses using pwm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-04 5:32 AM
Hi, I have a b-l4s5i-iot01a board. I want to generate 2 different pulses with a phase difference from different output channels. I have my desired pulses using TIM15 channel 1 and 2 but I cannot delay one of them. TIM1 and TIM8 pins are not accesible on the discovery kit and I want pulses to have 10ms so I used slave trigger mode but CubeMX says for combined channels you must not use slave mode. Below are my configurations. I use TIM1 as a 10MHz trigger for TIM15.
- Labels:
-
STM32L4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-04 5:37 AM - edited ‎2025-03-04 5:40 AM
https://community.st.com/t5/stm32cubemx-mcus/how-to-generate-a-phase-shifted-pwm-in-asymmetric-pwm-mode/td-p/248894
What you need to dig deeper is a name: this functionality is called Asymetric mode.
Or use a mcu with HRTIM then is easy, STM32L4S5VIT6 doesnt have HRTIM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-04 6:01 AM
First of all thank you. Maybe I did not dig enough but TIM15 doesnt seem to have asymmetric mode, other timers have it but they do not have RCR for multiple pulse creation. Should I try another pulse generation methods to use the asymmetric mode of the other timers?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-04 7:01 AM
I tried these configurations in TIM8 CH1N and CH3N, I configured them like this, initialized TIM2(Trigger source) then Started One_Pulses of all 4 channels but there is nothing at the output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-04 7:23 AM
If your requirements are a tad bit more complex than trivial, clicking in CubeMX is not likely to produce the desired result.
Maybe you could start with stating your exact requirements, together with a timing diagram (sketch).
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-04 7:58 AM
I basically want to generate something like this. I generated it without the phase difference using TIM15 in pwm multiple pulses mode by setting it as a slave and triggering it with a 10Hz timer. I just want to add phase difference to this. I think I used complementary channels of TIM8 because no other channel pins of TIM1 and TIM8 are available on the discovery kit board, therefore using complementary channels TIM8 CH1N and CH3N may not be working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-04 8:17 AM - edited ‎2025-03-04 8:18 AM
This appears to be trivial, but it is not, and can't think of any simple trick to pull this off using two channels of one timer with no software intervention.
I would perhaps try to output this from two different timers, triggering one from the other; and having triggered the former by the slow-running third timmer.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-05 1:13 AM - edited ‎2025-03-05 1:14 AM
Derailing from the question , but, why do you need 2Mhz burst pulses?
Are you doing radio or LCR measurement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-06 2:29 AM
Actually, I was trying to drive some transducers and wanted to test some different pulses and their effects but I decided not to try this method for now. I can give an update if I manage to do it with a single timer on stml4s5. Thank you all.
