2011-01-18 01:58 AM
Configuring ADC1 with five continuous and one injected channels
2011-05-17 05:21 AM
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.