2022-06-05 06:40 AM
Hi Team,
Currently I am working on the STM32h745ZIQ-nucleo boards.
In my project I am working on timers in 2 individual controllers. I am generating OnePluse in first controller using OnePulse mode. I want to capture the falling edge of the pulse (generated by the first controller) and generate onePulse using the 2nd controller of the other timer. and again I want to capture the falling edge of the Pulse (generated by the 2nd controller) and generate one Pulse using the 1st controller.
I want this continuously. so I enabled the OnePulse mode through the cube MX and generates the code for the 2 timers of 2 individual controllers.
After writing all the Input capture interrupt code and flashed in the controllers. Once I click on the RESET button I am getting only the high Pulse and of OnePulse. It is not coming to the 0V. Could you please help me out the configurations and all to get the complete OnePulse?
Best Regards
sm.
2022-06-05 08:54 AM
If I understand it correctly you are generating complementary pulses on two outputs (when one output is in High, other output is in Low). That can be done much easier by using any timer with complementary outputs (TIM1,TIM8, TIM15, TIM16, TIM17) in (complementary) PWM mode. By adjusting period and duty cycle you can independently control pulse widths for both outputs. Moreover that can be also done by "general purpose timers" (using two independet PWM outputs, one "left aligned" and second "right aligned").
Two mutually cascaded timers in one-pulse mode should do the same, but it is a more complicated way. Procedure for set up one-pulse mode is in paragraph 41.3.13 in reference manual:
2022-06-05 09:37 AM
Hi @Michal Dudka
As we are doing safety related project it has to generate only one pulse so we planned to achieve this by using One-Pulse mode.
Please help me out in the One-Pulse mode configurations. Which call back we will get and what are the mandatory things we need to do.
I am getting only high pulse It is not coming to 0V to get complete One-Pulse.
Please share me the example Of One-Pulse mode as well as complimentary Output PWM mode.
Regards
Sm.
2022-06-05 09:52 AM
Two "mutually triggered" timers in one-pulse mode is probably not safer then one timer in complementary mode. Examples are in STM32Cube_FW_H7_V1.9.1... package. Search for folder/example "TIM_ComplementarySignals" and "TIM_OnePulse".
https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H743I-EVAL/Examples/TIM
2022-06-05 10:00 AM
Yes @Michal Dudka
you are right it is more better and safer one timer in complementary mode. But we have two individual controllers. 1 CM4 timer should be low the other CM4 timer should be high like same as you said.
But How can We achieve the same thing (Complementary mode) in 2 different timers of 2 different controllers.
2022-06-05 11:50 AM
I did not realize that you have two cores with separated timers. I have no experiences with dualcore STMs. Is it not possible to use one timer and change its parameters by both cores ?
2022-06-05 12:24 PM
In my final hardware i have 2 separate controllers …. So for that I am trying now in 2 stm32h745ZIQ development boards and taken one one timer for each controller and doing by the Input capture by giving the external connection between 2 boards.
Hope you are clear now @[Michal Dudka] . Please give inputs about the configuration to generate one pulse mode correctly or you can give some info about complimentary output based on my above scenario to achieve this.
In Advanced timers like TIM1 …we have an option to select PWM_GENERATION_ CH1 option and PWM_GENERATION_ CH1N separately. Can we select one timer of one controller PWM_GENERATION_ CH1 and other timer of 2 nd controller PWM_GENERATION_ CH1N and we can connect by the input capture by giving the external connection between these two boards …. !
Is it possible ?
Can we do like this to achieve my task ?
Regards
Sm.
2022-06-05 01:13 PM
Ok if you are using two separated MCUs forgot about one timer with complementary outputs. Use your original way with one-pulse mode timers. Find and adapt example in Cube Firmware Library (from link above).
If your output does not generate pulse there can be multiple mistakes like