I have been trying to catch events from CTU where the origin in PWM and I want o start ADC conversion as following below. The model is attached.
1. Read PWM ABC and Fire PWM @ 20kHz => T = 1/20000 = 50μs
a. Fire an interrupt (1) with delay of T/2 (for Centrally aligned PWM), using CTU (I cannot find Delay block or option for firing interrupt in CTU)
2. Catch the interrupt (1), start ADC conversion for Phase Currents
a. Fire an interrupt for End of Conversion (2)
3. Catch Interrupt (2) and Trigger Calculation to update PWM A B C
To see if the CTU is firing the Interrupt I made a counter to see how many times the interrupt were fired, and a GPIO to see what is the delay between PWM Edge and Start of conversion of ADC.
Also, I was end able to find End of Conversion Interrupt in ADC which was there in previous version.
I have attached the model for you.
I have checked the model in Samples and was not clear for me, so I try to build my own to understand it better.