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
Visitor brsmnc
Visitor
200 Views
Registered: ‎01-22-2019

Microblaze generates two gpio interrupts and sometimes stops working

Hello,

I'm working on AC701 Evaluation Board. I made a simple block design which uses microblaze with pushbuttons interrupt. I'have two issues with that design.

First one is, when I push the pushbuttons, two interrupts are generated everytime (one for pressing, one for releasing). Its not a bouncing problem. I configured axi interrupt controller with rising edge peripheral interrupts in my block design but I'dont have any idea why another interrupt is generated while releasing button. My vivado version is 2015.1 ( I've encountered this problem before with my arty board and vivado 2018.2) How can I get only one interrupt on rising edge?

My second issue is that, interrupt stops working at some random point. Sometimes stops at first press, sometimes 20. I can confirm that microblaze is still running at that time.  My code is simple.

void GpioBTNHandler(void *CallbackRef)
{
	IntrFlag = 1;
	XGpio_InterruptClear( (XGpio *)CallbackRef, BTN_CHANNEL);
}

while(1)
{
	if(IntrFlag)
	{
		IntrFlag=0;
		printf("%d INTERRUPT!\r\n",i++);
	}
}

I think I have to clear some registers. Do you have an idea?

0 Kudos
2 Replies
Visitor brsmnc
Visitor
171 Views
Registered: ‎01-22-2019

Re: Microblaze generates two gpio interrupts and sometimes stops working

When I add the following code to the loop, interrupt starts working again.

while(1)
{
	Data = XGpio_InterruptGetStatus(&GpioInput);
	if(Data == BTN_CHANNEL)
		XGpio_InterruptClear( &GpioInput, BTN_CHANNEL);

	if(IntrFlag)
	{
		IntrFlag=0;
		printf("%d INTERRUPT!\r\n",i++);
	}
}

Why the interrupt may not be cleaned in ISR handler?

 

0 Kudos
Xilinx Employee
Xilinx Employee
70 Views
Registered: ‎07-12-2018

Re: Microblaze generates two gpio interrupts and sometimes stops working

Hi @brsmnc 

This is a bouncing problem for the pushbuttons, there is no de-bouncing circuit for the pushbuttons on the board. So recommnedation is to use the level trigger sensitivity type to avoid the bouncing problem. 

Best Regards
Abhinay PS
------------------------------------------------------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------------------------------------------------------