2015-08-31 06:38 AM
Hi.
I make 4 ADCs on ADC1 and other 4 on ADC2. I'm using DUAL mode, so the results are transferred in 32-bit word (one half for ADC1 and another half for ADC2). Thus I need 4 conversion times for all 8 conversions. The destination address for DMA is an array of 8 16-bit words and it works. Let's call this as one sequence. Now, I would like to make more than one sequence with single trigger for AD start. Let say, I would like to make 10 sequences (for 80 conversions), which would take time equal to 40 conversions (because of DUAL mode). If I am correct, I should define a destination array for DMA as 80 16-bit words and set the number of DMA tranfers to 40 (40 times of 32-bit). ADC should be configured in SCAN mode as well. But now, I am not sure how should be ''number of conversions'' configured? As I said, I have 4 channels on each ADC and each ADC should go 10 times over the same channel (for ADC1: CH0 - CH1 - CH2 - CH3 - CH0 - CH1 - CH2 - CH3 - CH0 - ... 10x like this). And same for ADC2. Would this work if I set number of conv. to 4 (for both ADCs), and DMA transfers to 40? Would ADC go throug all 40 (10x 4) conversions automatically? Thanks #adc #dma2015-08-31 07:53 AM
Well I'm not sure you can trigger multiple sets of samples. Basically in non-continuous mode it's going to do your 4x2 samples every time it gets a trigger.
You could try continuous mode, but problem is that it might not stop. You could try using a trigger, and experiment.2015-08-31 08:21 AM
Is possible to start AD in CONTINUOUS mode by software at certain moment and then also
interrupt
(finish) AD conversions when you want? If that is possible, then I would start AD in continuous mode when I want and wait for TCIF (transfer complete) flag for DMA. This would be configured to 40 transfers. Then in ISR I would stop ADC.2015-08-31 09:33 AM
You'd have to do what I do, experiment.
You can limit the sampling with the DMA TC, with the DMA in Normal mode. The problem that I see is getting the ADC reinitialized, because when the DMA stops servicing the ADC will over-run. Restarting it, and resynchronizing the scan, might take some effort.2015-09-01 03:35 AM
I agree with clive1, the cleanest way is having the ADC run continuously looping on a sequence of 4 conversions, and let the DMA stop it (by overrun) when the buffer is full, then fire an IRQ and reset the DMA and ADC units.
2015-09-01 12:00 PM