Adam Taylor Microzed Chronicles: Combining XADC and Inerrupts with Real World Signals

Continuing with Adam Taylor's tutorials in his MicroZed Chronicles on the XADC. This post relates to issue 107, which can be found using the link at the bottom of the page.

What I learned from Adam's Tutorial:
This tutorial is a continuation of issue 105 and 106.

We can now define the hardware we want to pull into SDSoC from Vivado.
Knowing and designing for latency has ensured that we will never miss an XADC sample. Recall from Issue 104 that we can sample at 961.54 ksamples/sec (ksps) using a 100MHz AXI clock frequency. So, a new sample and corresponding interrupt will occur every 1.04 microseconds.

Vivado
Modifying our Vivado design from the interrupt latency posts. We will remove axi_timer_0 and replace it with the xadc_wiz. Be sure to save this as a new project so you don't lose the old design. 

1. Delete axi_timer_0
2. Add xadc_wiz > Run Connection Automation
3. Right Click on Vp_Vn and make external
4. Connect (xadc_wiz) ip2intc_irpt to (PS) core0_nIRQ
    This means the interrupt is only seen by the first core and not the second         because it is connected to a private peripheral interrupt.
5. Save > Validate > HDL > Generate Bitstream > Export > Launch SDK

Your block design should look similar to this:


SDK
1. File > New > Board Support > Finish
2. File > New > Application Project > Hello World > Finish
3. Copy and paste in main_part107.c from Adam Taylor's Github (https://github.com/ATaylorCEngFIET/MicroZed-Chronicles) to replace helloworld.c
***Note: If you receive an error after pasting in new code, check capitalization
4. Program FPGA and Run
5. If you haven't downloaded and installed Waveforms yet then you need to do it before you can run the program. Refer to Emily's post 'Installing Waveforms' for help.
6. Once you have Waveforms installed, open it while the FPGA is running
Note: When Waveforms launches it may say your device is not connected hit ok and the device manager window should appear. At the top next to Discovery you should see a serial number, this is our device. Click Select and Wavegen on the left. you should see something similar to the signal below:

To change the scale choose the settings icon on the left and change the scale to manual. Then change the time length (we changed the time length to 200 nsec/division).
Now the signal should look something like this:



Comments

Popular posts from this blog

Adam Taylor MicroZed Chronicles: Interrupt Latency

Using the XADC Header to Read Voltages

Github