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
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.