Close

Code - main ideas

A project log for Raspberry Pi Pico Super Simple Oscilloscope

Raspberry PI and ADC10080, works decently for a 24 Mbps signal and has 100 k input impedance

sciencedude1990sciencedude1990 06/17/2023 at 03:170 Comments

Please see the github site for the code.

The main idea is to use the PIO to clock the ADC10080, and grab data from it.  So, you use the "sideset" to set the clock line to 1, then set it to 0 as you grab the values on the 10 pins.  Do this three times, and push the data out on the FIFO.

@asm_pio(in_shiftdir=PIO.SHIFT_LEFT, autopush=True, push_thresh=30, sideset_init=(PIO.OUT_LOW))
def sideset_test():
    nop()          .side(1)    
    in_(pins, 10)  .side(0)
    
    nop()          .side(1)
    in_(pins, 10)  .side(0)
    
    nop()          .side(1)
    in_(pins, 10)  .side(0)

The data from the FIFO goes to the DMA.  The DMA saves the data into an array, and just loops around and around.  Then, you carefully stop the DMA, and then read out the array and process it in your favorite program.

Discussions