UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
1,510 Views
Registered: ‎12-24-2017

GPIO interrupt and processes

Jump to solution

I want to create an interrupt on 4 buttons that are on the board that has Zynq processor.

I have a code that always executes and I want those buttons to control the behavior of the main process.I thought to put all the code in a while loop but that would be bad because it will execute some parts of code that are not needed.

I found tutorials just for petalinux and this article https://www.xilinx.com/support/answers/51138.html but in zynq_main file the example is not clear enough and at the end it waits 15 seconds for interrupt,isn't this a bad behavior? 

 

Also is there an example for putting the code in a process and running it so that it can be set how much resources does it use ?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Contributor
Contributor
2,034 Views
Registered: ‎12-24-2017

Re: GPIO interrupt and processes

Jump to solution

Worked,the header files didn't got included for some reason

0 Kudos
5 Replies
Explorer
Explorer
1,494 Views
Registered: ‎03-28-2016

Re: GPIO interrupt and processes

Jump to solution

I am not sure I completely follow what you are trying to do, but here is one possible option:

  1. Connect the 4 buttons to an AXI_GPIO.
  2. Connect the Interrupt output of the AXI GPIO to the Zynq's interrupt controller.
  3. Set up the AXI_GPIO to generate an interrupt anytime one of the buttons is active
  4. Create an interrupt routine on the Zynq that is tied to that interrupt.
  5. In the interrupt routine, check to see which button was pressed and set control flags that are then used to control the operation of your main program.

 

Ted Booth - Tech. Lead FPGA Design Engineer
www.designlinxhs.com
Contributor
Contributor
1,487 Views
Registered: ‎12-24-2017

Re: GPIO interrupt and processes

Jump to solution

I added the GPIO leds and buttons,connected the interrupt output to concat block and added the code for the interrupts but it doesn't trigger.I put a simple text in the trigger code and it is never displays and the leds never turn on.

0 Kudos
Contributor
Contributor
2,035 Views
Registered: ‎12-24-2017

Re: GPIO interrupt and processes

Jump to solution

Worked,the header files didn't got included for some reason

0 Kudos
Explorer
Explorer
1,469 Views
Registered: ‎03-28-2016

Re: GPIO interrupt and processes

Jump to solution

Check out Chapter 3 of UG1165:

 

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_4/ug1165-zynq-embedded-design-tutorial.pdf

 

Hopefull that will help.

 

Ted Booth - Tech. Lead FPGA Design Engineer
www.designlinxhs.com
Contributor
Contributor
1,460 Views
Registered: ‎12-24-2017

Re: GPIO interrupt and processes

Jump to solution

So if I want to run parallel processes I have to make interrupts without trigger?

0 Kudos