I have an application similar to an oscilloscope, where I am capturing signals that exceed a set threshold. The application requires a sample-rate of 60MSps or above to be feasible.
The operation of my code:
[*]The samples are moved into a segmented circular buffer using a GPDMA LLI.
[*]The HSADC throws an interrupt if the trigger threshold is exceeded.
[*]The interrupt queries the current GPDMA next LLI address and destination address to determine where in the circular buffer the trigger has occurred.
[*]The interrupt modifies the LLI so that the GPDMA switches to a second circular buffer once it has filled the required number of post-trigger samples. The GPDMA is also set to throw an interrupt signaling the post-fill completion.
The problem is that the transfer is dropping chunks of samples. The samples are most regularly being lost around the time the trigger interrupt is running, i.e. the samples I am most interested in! I have attached a plot of a captured burst of 4 MHz Sine waves. The trigger point, measured during the interrupt by querying the GPDMA destination address, is 400 Samples. Samples are regularly lost occur in the following 100 HSADC cycles (~1 us).
The effect is present when sampling at 80, 60 and 40 MSps. I have also attached CSVs containing captured signals. The traces are aligned with the trigger point at the 398th samples.
As the sample drops occur around the time of the trigger interrupt, am I doing something to upset the HSADC or GPDMA transfer in my handler code? The handler runs from RAM, otherwise it fails to stop the GPDMA before the circular buffer loops around. The FIFO trigger and GPDMA burst size for the transfer is set to 8 words.
Any advice/experience would be much appreciated! Has anyone had success with triggered acquisition at 80MSPS?
For anyone starting with the LPC4370 HSADC, I found the following links most helpful:
Original Attachment has been moved to: 4MHz_SineBurst_40MSps_Triggered.txt.zip
Original Attachment has been moved to: 4MHz_SineBurst_60MSps_Triggered.txt.zip
Original Attachment has been moved to: 4MHz_SineBurst_80MSps_Triggered.txt.zip