How to read adc data when I use custom Overlay

I am using PYZQ-Z1 for my project.
I’ve made a custom overlay with my HDL and basic xADC block, but when I want to read adc data on jupyter notebook I just got 0.
(I’ve upload .hwh .tcl .bit file to jupyter notebook)

Thank you for your help!

1 Like

Can you post the code or block image for your overlay?

Here is my block design, hope this can be of assistance.
Thank you for your response!

1 Like

Sorry for the delay. I was just doing the same thing. The easiest is to map the registers to an array with

adc = ol.xadc_wiz_0.mmio.array

This will create a HUGE np array, which is indexed by 32-bit word (ie, no need for the *4 thing). The status registers start at 128 (I learned this entirely by trial and error). You can find their definitions here:
https://docs.xilinx.com/r/en-US/ug480_7Series_XADC/Status-Registers

So temp is at 128+0x00, VP/VN is at 128+0x03, VnauxN is at 128+0x10+N, etc

The 12-bit ADC value is left shifted by 4, so you can treat it like 16-bit, and all the external inputs have a 1V full range, but note that six of the AUX pins are tied to the Arduino analog inputs via a resistor divider, given them a 3.3V range.

I hope this helps.

Hello, ejon.
I will try the method you provided and share the results later.
I appreciate your help very much.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.