0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Zybo > Chronicles blog 38 > Interrupt from PL > Vivado上の作業 / XSDK上の作業 / Interrupt設定

Last updated at Posted at 2016-06-09

MicroZed Chronicles リスト http://adiuvoengineering.com/?page_id=285
@ Adam Taylor blog
https://forums.xilinx.com/t5/Xcell-Daily-Blog/Adam-Taylor-s-MicroZed-Chronicles-Part-38-Answering-a-question/ba-p/479978

In this example, I show how to use the private interrupt. However the general concept is the same regardless of interrupt used. For this example, I will be using an EMIO GPIO pin connected via the PL, looped back and connected to the processor’s interrupt pin. A simple software program can then demonstrate how an interrupt from the PL works.

Vivado上の作業

The first stage of this example is to enable the interrupts between the PL and PS and to enable the specific interrupt you wish to use.

blogの画像においては Re-customize IP > Interruptにて PL-PS Interrupt > Core0_nRQ にチェックをつけているようだ。

The second step is to enable a single-bit GPIO using the EMIO option.

Re-customize IP > MIO Configuration > GPIO > EMIO GPIO (Width) を1にしている。

XSDK上の作業

  1. Declare the following header files: Platform.h, xparameters.h, Xscugic.h, Xil_Exceptions.h and xgpio.h. These header files will provide functions and macros that enable us to generate the example.
  1. Define the generic interrupt controller and GPIO device ID and interrupt numbers along with the FPGA interrupt and pin numbers for the EMIO and push-button switch.
  2. Declare and write a number of required functions:

xgpio.hはないのでxgpiops.hを代わりにincludeする。

Interruptの設定

When setting up an interrupt in the Zynq we need to do the following things:

  1. Initialize the Interrupt controller.
  1. Connect the exception ID to the associated handler so that when an event occurs it can be run correctly.
  2. Connect the FPGA interrupt to the generic interrupt controller. This requires the pre-defined interrupt ID, the call-back handler (which is defined to identify the source of the interrupt), and the interrupt service routine to be run when the interrupt occurs.
  3. Enable the interrupt on the interrupt controller.
  4. Enable interrupts on the processor.

短いサンプルコードがあるようなので時間が確保できた時に実施してみよう。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?