Hello,
I use PYNQ Z2 board.
I build custom overlay (not BASE OVERLAY) with xADC block inside.
How I can read the ADC value on pin A0, A1 (Adruino Analog pins) on Jupyter notebook (like the base overlay in the picture)?
Thank you.
1 Like
You need to load your overlay first.
Try:
from pynq import overlay
ol =Overlay(“your bit file”)
For more information , please read the doc
1 Like
I do not know if there is an official xADC ip support in PYNQ library…
I use AXI Interface with MMIO to get the raw data.
In FPGA, use AXI to send the xADC value, and in PYNQ, use MMIO lib to get the AXI value, like this:
from pynq import Overlay
ol=Overlay('XXXX.bit') #load your own Overlay
from pynq import MMIO #Access AXI with MMIO
AXIbus_addr = ol.ip_dict['axi_bus']['phys_addr'] #you may need to change this to your own AXI IP
AXIbus_addrange = 128 #Address range
AXI_mmio = MMIO(AXIbus_addr, AXIbus_addrange) # Create MMIO object
XADCVALUE=AXI_mmio.read(3*4, 4) #3*4 is the offset address, set to your own address offset, 4 is read lenth
Thank you so much Xyin.
I will try it.