Generate single pulses based on capture event
Hello
In my project I want to use timer4 of STM32G474RET6 MCU. I want to generate single pulses with programmable width on CH2-CH4. These output pulses from MCU should be with programmable delay from input pulse connected to CH1. Pulses on CH2-CH4 should be with negative polarity ('0'). Output pulse must have enable/disable option (when disabled the output from the disabled channel should be '1'). Delay of each pulse from input pulse should be in resolution of uSec's (delay can be also 0 -> immediate output at the same time as input signal). Width of the pulses should be also in uSec's resolution. The output pulses from CH2-CH4 should be always single (if enabled) - 1 output pulse after each input pulse. Each pulse from CH2-CH4 should have own independent delay/width/enable/disable values. Input pulse polarity can be changed dynamically during the work from rising (default) to falling edge.
I think that the basic configuration should be capture (for CH1) and compare modes (for CH2-CH4)?
I tried to define different configurations generated by MX environment integrated in ST32CubeIDE. But it never worked as expected and what is more disturbing that after starting of any channel of CH1 it caused to stack (or crashes) after reset events (like pressing on hardware reset button, generation SW reset like NVIC_SystemReset(); or toggling between flash banks).
1. Can someone provide me any example how to do it (I was unable to find such example based on HAL on evaluation board environment).
2. What can be wrong in my system that causing such reset problems just by enabling channels of timer 4 ?
Thank you.
Alex
