cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring ADC1 with five continuous and one injected channels

infoinfo978
Associate II
Posted on January 18, 2011 at 10:58

Configuring ADC1 with five continuous and one injected channels

1 REPLY 1
picguy2
Associate II
Posted on May 17, 2011 at 14:21

This looks like two separate issues.

1) How to do full auto ADC/DMA

I have done that.  Buffer size for n channels: n*2 bytes.  Then always the most recent ADC value for each channel is always in the same place.  No interrupts required.

2) How to do injected ADC

I tried to use injected channels because I was disappointed that ST’s normal channels did not have dedicated buffers for each conversion.  After I setup auto ADC/DMA I stopped using injected channels.  

But here is what I would do:

a) Setup injected channel ADC as a standalone program using software trigger.  Get it to work.

b) Interrupt on end of injected channel.  Get that to work.

c) Look for an internal trigger (perhaps using the same timer used for PWM) for injected channel.  Interrupt saving the value before it gets overwritten.  Read the PWM output pin to save result in the proper place.  If all else fails, use external hardware to route your PWM pin back into something that will start injected channel ADC.