1 Reply Latest reply on Oct 15, 2020 10:24 PM by VasanthR_91

    Basic oscilloscope demo using ADC_SAR and KIT-059

    BoTa_264741

      Hi,

      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

       

      /odissey1

       

      Figure 1. ADC in free-running mode. DMA is h/w triggered.

      ADC_DMA_RAM_8bit_02a_A2.png

       

      Figure 2. ADC in clocked mode. DMA is clocked by ADC's end-of-sampling (eos).

      ADC_DMA_RAM_01_A1.png

       

      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.

      ADC_DMA_RAM_8bit_02a_B.png

       

      Figure 4. SerialPlot custom component for plotting acquired data. configured for Simple Binary, 1-channel, uint8 data.

      ADC_DMA_RAM_8bit_02a_C.png

      Figure 5. Project annotation using PSoC Annotation Library 1.0.

      ADC_DMA_RAM_8bit_02a_KIT-059.png

       

      Figure 6. Oscilloscope traces: Yellow - DUT, Cyan - PWM pulse, Fuchsia - ADC trigger pulse.

       

      ADC_DMA_RAM_8bit_02a_D1.png

       

      Figure 7. SerialPlot output and DataFormat window.

      ADC_DMA_RAM_8bit_02a_E1.png