Provided below is basic o-scope demo, operating in hardware triggered mode. It can be used for acquiring fast transients using PSoC5 SAR_ADC.
Two modes of operation are shown:
1. ADC is operating in free-running mode, while DMA is set to "Ready" mode, waiting for a hardware trigger. Once external trigger is detected, DMA transfers pre-defined number of points (N=200) into RAM buffer, and fires interrupt once completed.
2.. ADC is operating in clocked mode. ADC clock is first set to "Ready" mode, waiting for a hardware trigger. Once external trigger is detected, ADC starts acquiring data, which is transferred to RAM buffer by DMA. Once pre-defined number of points (N=200) has been transferred, DMA fires interrupt.
Acquired data is then being transferred by UART and plotted by external charting tool SerialPlot (by Yavuz Ozderya).
In this example, the device under test (DUT) is simply a KIT-059 onboard 2.4nF capacitor (C4), which is being charged/discharged through the digital output pin configured in Resistive Pull Up/Down mode.
As shown, ADC sampling rate is 1MHz, resolution 8-bit, N acquired points = 200. The ADC can be overclocked to about 1.7 MHz using clocked mode.
This project uses several custom Community components and libraries:
SerialPlot: SerialPlot: interface to real-time data charts
PSoC Annotation Library: PSoC Annotation Library v1.0
Yavuz Ozderya, Serial PLOT v0.10.0, https://hasanyavuz.ozderya.net/?p=244
Figure 1. ADC in free-running mode. DMA is h/w triggered.
Figure 2. ADC in clocked mode. DMA is clocked by ADC's end-of-sampling (eos).
Figure 3. Pulse train generator for testing. Pulse delay - 20us, pulse length - 20us, repetition - 100Hz. The DUT is KIT-059 onboard capacitor C4 (2.4nF), driven by the digital Pin_150, configured for Resistive Pull Up/Down.
Figure 4. SerialPlot custom component for plotting acquired data. configured for Simple Binary, 1-channel, uint8 data.
Figure 5. Project annotation using PSoC Annotation Library 1.0.
Figure 6. Oscilloscope traces: Yellow - DUT, Cyan - PWM pulse, Fuchsia - ADC trigger pulse.
Figure 7. SerialPlot output and DataFormat window.