cancel
Showing results for 
Search instead for 
Did you mean: 

How to use ADC both in external triggered and regular conversion mode?

GenuineDeveloper
Associate III

I am using STM32F031 family microcontroller and want to configure the ADC.

My application requires current sensing and voltage sensing. For critical measurement like current during PWM ON time, I am using the ADC in external trigger mode, triggered by the PWM timer channel.

However, for voltage sensing, I do not want the ADC to be externally triggered during the PWM ON time, instead, want to use it in regular conversion mode.

How can I achieve this, since I cannot see an option to combine both triggered and regular conversion modes of ADC? Any inputs will be helpful.

Regards,

GD

1 ACCEPTED SOLUTION

Accepted Solutions
S.Ma
Principal

You would need a.richer ADC which has injected (high prio) channels edge triggered with dedicated data registers, with normal channels in continuous loop mode, as the STM32L4 probably has. Otherwise, run continuously and use EXTI to sw capture the adc channel you need, with a bit of sw jitter.

View solution in original post

2 REPLIES 2
S.Ma
Principal

You would need a.richer ADC which has injected (high prio) channels edge triggered with dedicated data registers, with normal channels in continuous loop mode, as the STM32L4 probably has. Otherwise, run continuously and use EXTI to sw capture the adc channel you need, with a bit of sw jitter.

Auto code generation only provides for basic boilerplate templates of how things can work.

The HW may be capable of more exotic modes, but you'd need to read and understand the manuals, and experiment with switching modes, or using injected methods.

Other STM32 have multiple ADC allowing each to operate in different ways, with different channels.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..