Afternoon All!
I may have stumbled upon a new TM4C123 silicon erratum with the ADC module that does not appear to be documented thus far. There *IS* a workaround.
The application required burst sampling, for about 1ms at full speed (1MS/s), to this end it was decided to use the TRIGGER_ALWAYS setting, in order to avoid having to re-trigger 125 thousand times per second. The init code set up SS0 to TRIGGER_PROCESSOR in the first instance whilst waiting to go, then set to TRIGGER_ALWAYS when it needed to go. Data was handled by uDMA with an interrupt on completion.
The ISR set the trigger mode back to TRIGGER_PROCESSOR and then proceeded to try to drain the FIFO of the last samples that had been scheduled but were now surplus to requirement. The issue was that the FIFO FULL flag could not be cleared. The FIFO OVERFLOW flag was set and could not be cleared. The ADC BUSY flag was set and could not be cleared. In short, you could only do this burst once before needing to power cycle the MCU.
The solution came in the form of disabling SS0 in the Interrup Handler. This allowed the FIFO to be drained, there was no more OVERRUN flag, the ADC unit would cease being BUSY and it was possible to do as many bursts as desired - once the FIFO was drained, it was possible to re-enable SS0 and it would work again.
It seems as if it is impossible to exit TRIGGER_ALWAYS once it has been set without disabling the Sequencer. Now the code initialises SS0 to TRIGGER_ALWAYS and gating is done by enabling and disabling the sequencer. Problem fixed, but I guess it should also work by toggling the trigger mode with the sequencer enabled (it definitely works going TRIGGER_PROCESSOR -> TRIGGER_ALWAYS). There is an erratum about re-triggering an already running sequencer causing continuous triggering, but this is a little different.
Hope this info is of benefit to someone out there.
Best regards,
Pat.