A important feature for CLA is that it can read the adc result "just in time" to minimize the current loop latency, how about the CPU? Are there any examples?
Thanks.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
A important feature for CLA is that it can read the adc result "just in time" to minimize the current loop latency, how about the CPU? Are there any examples?
Thanks.
Hi Howard,
There are a few methods to consider for 'just in time' control loop updates.
The method described in 2a is done in a number of the system-based evaluation kit examples, but I don't believe it is really documented that we are doing it.
Hopefully this helps!
Thank you,
Brett
Hi Howard,
Just to add a couple more bits of info to add to Brett's answer:
You can get the exact ISR context switch latency timings here (14 cycles for an internal interrupt):
processors.wiki.ti.com/.../Interrupt_FAQ_for_C2000
You can get the exact ADC timings out the F2837xD datasheet from Table 5-51. "ADC Timings in 12-Bit Mode (SYSCLK Cycles)" and Table 5-52. "ADC Timings in 16-Bit Mode". There are also accompanying diagrams. From this, you will notice that in the normal use case of SYSCLK = 200MHz and ADCCLK = 50MHz the timings are as follows:
12-bit mode: early INT occurs at 1 cycle, results latch at 44 cycles. Therefore if you use early interrupt mode you will need to wait or do setup operations for 44-1-14 = 29 cycles.
16-bit mode: early INT occurs at 1 cycle, results latch at 120 cycles. Therefore if you use early interrupt mode you will need to wait or do setup operations for 120-1-14 = 105 cycles.
For both modes, if you use late interrupt mode, you arrive in the ISR 14 cycles after the results have latched.
Now, on the F28004x device family we have added an additional feature that lets you delay the ISR generation in early interrupt mode by an arbitrary number of cycles. You do this by putting the device into early interrupt mode and then writing a value to ADCINTCYCLE.DELAY. In the 12-bit case above, you could write 29 to this register and then enter the ISR exactly on time. If you had 6 cycles of setup before you need to read the result, you could instead write 29-6 = 23 and still arrive at the read operation exactly on time.