The enclosed figure describes one cycle of our task.
We are triggered by a signal (i.e., CH4) being high (event 1 in the figure). Upon arrival of this signal, we have to acquire two channels CH1 and CH2, at 1MSample/s and 16bit per sample via 2 SPIs. We do not know for how long CH4 will be high but we know a maximum duration for which it is high (1 ms). Therefore we want to allocate two DMA channels that transfer the data in two sector of the memory, say S1 and S2, that are large enough. When, after CH4 turns low (event 3) we would like to deallocate the DMA channels and evaluate some statistics on the data in S1 and S2. At the same time we would like to allocate other two DMA channels that transfer the data on CH1 and CH2 in two different memory sectors, i.e., S3 and S4, via 2 SPIs. Then, we have to read a single value from a register (event 4) and put it in memory sector S5. CH1 and CH2 have to be read upon receipt of event 6 wherein CH4 is high again and some statistics have to be calculated from S3 and S4. The process is then repeated.
My question is the following:
How long does it take to stop the DMA transfer to S1 and S2 after event 3, and to allocate new DMA channels to transfer to S3 and S4? Are we supposed to loose any data around event 3? If so, how many?
Hope to hear from you soon.
Best
Daniele