2024-10-20 06:57 AM
I'm trying to configure the ADC to read to values at a specific time in my system that uses the STM32G474.
I have two channels of peak current mode control using the HRTIMER. The outputs are reset from either a comparator event or max duty cycle compare value on each channel.
For each channel, I want to sample a voltage at a fixed delay time after the output is reset.
Any help is greatly appreciated.
Thank you
2024-10-22 01:14 PM - edited 2024-10-22 01:14 PM
Hello @DamageG ,
You can use the auto-delayed mode to introduce a fixed delay after the comparator event before triggering the ADC.
In auto-delayed mode, the CMP2 value will be added to the captured timer value when the comparator event occurs. This will generate a match event after the specified delay (e.g., 200ns).
Then, set the ADC to be triggered by the HRTIMER's compare match event (CMP2 match event). This ensures that the ADC conversion starts after the fixed delay from the comparator event.
For more detailed information on configuring the HRTIMER and Auto-Delayed Mode, refer to the STM32G4 reference manual (in HRTIM chapter) and the HRTIMER cookbook (AN4539),
2024-10-22 01:25 PM
Thank you!
It's going to take me a couple of days to be able to test it out. I'll let you know how it works.
2024-11-03 01:45 PM