One Pulse Generation after N interrupts have occured.
I have an application implemented with the NUCLEO STM32L552 board, in which I need to generate a sinewave of a known frequency (Period=T) and a single short pulse per cycle at a known phase angle say A.
I have divided the time period of the signal say T into 360 steps, with each step representing a degree, and run a timer in Interrupt mode with the ARR value equal to T/360. In the Interrupt SR, I output the sine value from a pre-calculated source at a given degree, increment it, and reset the counter to 0 as it equals 360. This way the DAC successively outputs values from 0-360 and continues to output the sinewave which is working perfectly fine.
Now I have to generate a single pulse of a short fixed duration at a given degree in each cycle. I am not able to find the right way to do it. Could anyone guide me please.
