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: 
Visitor gquan
Visitor
665 Views
Registered: ‎06-11-2018

Zedboard GPIO interrupt problem using interrupt mask

Jump to solution

I basically followed the gpio_intr_example.c to implement an interrupt triggered by the dip switches on zedboard using Vivado 2017.4 and it worked: flipping each of the switches can trigger the interrupt. Now I want to change the design such that only flipping certain switches can trigger the interrupt. Can I simply do this by changing the interrupt mask in the following function? 

 

...

XGpio_InterruptEnable(InstancePtr, IntrMask);

...

 

I tried setting IntrMask = 0x2 to make switch 2 the only one that can trigger the interrupt, but it failed. I also tried setting IntrMask = 0xF assuming only four switches can trigger the interrupt, but all eight switches can trigger the interrupt. Am I missing something here?

 

Also, what if I want to trigger the interrupt when flipping two dedicated switches simultaneously? Can I do this by setting up IntrMask somehow, and if yes, how can I set up the IntrMask? Thank you for the help! 

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
646 Views
Registered: ‎10-30-2017

Re: Zedboard GPIO interrupt problem using interrupt mask

Jump to solution

Hi @gquan,

 

I hope you were used AXI GPIO (single instance) in the block design and with 8/4-bit. Interrupts are produced when any of bit has changed on AXI GPIO bus. 

if you want to generate the individual interrupt for each switch then take different AXI GPIO instances for each switch (AXI GPIO width is 1 bit) then it is possible to generate individual interrupts for each AXI GPIO (each switch).

 

Best Regards,
Srikanth
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.

3 Replies
Explorer
Explorer
642 Views
Registered: ‎06-19-2015

Re: Zedboard GPIO interrupt problem using interrupt mask

Jump to solution

Hi @gquan

 

You have to use this function to disable the interrupt.

 

void XGpio_InterruptDisable(XGpio *InstancePtr, u32 Mask);

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution if solved.
-------------------------------------------------------------------------

 

Thanks

Madhu

 

0 Kudos
Xilinx Employee
Xilinx Employee
647 Views
Registered: ‎10-30-2017

Re: Zedboard GPIO interrupt problem using interrupt mask

Jump to solution

Hi @gquan,

 

I hope you were used AXI GPIO (single instance) in the block design and with 8/4-bit. Interrupts are produced when any of bit has changed on AXI GPIO bus. 

if you want to generate the individual interrupt for each switch then take different AXI GPIO instances for each switch (AXI GPIO width is 1 bit) then it is possible to generate individual interrupts for each AXI GPIO (each switch).

 

Best Regards,
Srikanth
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.

Visitor gquan
Visitor
611 Views
Registered: ‎06-11-2018

Re: Zedboard GPIO interrupt problem using interrupt mask

Jump to solution

Hi, Srikanth,

 

Thank you for the reply. I guess we just cannot block certain input bits in a GPIO from raising the interrupt by simply setting up the mask as we do when setting the input/output directions.

 

best regards,

 

gquan 

0 Kudos