In the documentation it states: (with regard to the CLA)
Software Trigger
Tasks can also be started by the main CPU software writing to the MIFRC register or by the IACK
instruction. Using the IACK instruction is more efficient because it does not require you to issue an
EALLOW to set MIFR bits. Set the MCTL[IACKE] bit to enable the IACK feature. Each bit in the
operand of the IACK instruction corresponds to a task. For example IACK #0x0001 will set bit 0 in the
MIFR register to start task 1. Likewise IACK #0x0003 will set bits 0 and 1 in the MIFR register to start
task 1 and task 2.
The question is: If I have one CLA servicing 2 ADCs, the way I see it the best I can do is have each ADC generate it's own interrupt, which results in two tasks in the CLA. If the data I am reading from both ADCs is actually from an array, so I wish to process them together, I would have to do something like having task 1 copy the ADC registers, then check a self created flag if task 2 has occurred. If not, then return.
In task 2 I would copy it's ADC result registers to a common location (creating an array of ADC1 and ADC2 result registers... so if I'm reading 6 results on each ADC this creates 12 ADC result registers (Vector of data). Now in task 2 I can check the flag if task 1 is complete, in this example it is, so then I can call my processing to process the data, and clear the flags for the next iteration. Similarily, if task 2 happened to occur furst, then task 1 is checking the flags and it would call the processing if task 2 occurred first.
Now in the interest of having only one interrupt to the CPU, one idea would be to have task 1 or 2 of the CLA initiate a software TASK interrupt which would then process the combined vector of data, so task 1 and 2 essentially just do a 6 memory moves and test flags and return without generating a CPU inttrupt... but if the alternate task is complete, then either task will initiate the software task interrupt, which will process the data, and it will generate a CPU interrupt. In this way the CPU has no knowledge of this 'combination' of tasks occurring at the CLA.
The idea is, if later I put all 4 or 3 ADCs to be processed by the CLA I have isolated that from the CPU, so it only knows about servicing a 'complete' interrupt.
So the question is:
1. Can the CLA initiate it's own software inttrupt? I assume with the MEALLOW and MEDIS? but baed on the above documentation it only talks about it in the context of doing this from the main CPU, not from the CLA. I just want ot verify this is an allowed process? will it cause any issues?
2. Is there any other way to combine ADC End of Conversion interrupts, so that no EOC is created unitl two or 3 or 4 ADCs are complete? So I can collect the results from all read values from any number of ADCs in one CLA task?
Thanks.