01-22-2021 01:32 AM
I am studying the interrupt in ZYNQ. In forum, an interrupt request number is mentioned oft. I didn’t find information about it in the technical manual.
What is the interrupt request number? Does it use for an initialization interrupt? How to determine it? Where is it given?
01-22-2021 04:20 AM
Can I have an interrupt inside the other interrupt?
For example, using a push button on a board as interrupt. If the button is pushed, leds start blinking. If I push the second time, the Led stop blinking
01-22-2021 11:02 AM - edited 01-22-2021 11:33 AM
[EDIT: Removed static variable advice.]
It's hard to interpret what your system looks like, so here's a really basic way to do what you want (or at least what I think you want):
You just need one interrupt handler for what you're doing. Every time it is called, it can toggle a global variable called (for example) "g_blink_status".
Put your LED code in your main() loop. If the main loop sees that g_blink_status is "1", it should toggle the LED(s). If it sees that g_blink_status is "0", it should keep the LED(s) off.
Basically what you have here is a foreground-background architecture. The main loop runs continually in the background. The interrupt handler runs intermittently in the foreground. See Lesson 21 in this video series for an introduction to the foreground-background architecture.
Eventually you will come across a serious flaw in what you are trying to do: the button press is not being debounced. To do that you shouldn't be using the button press as an interrupt trigger. Instead, you need to use a timed interrupt solution to debounce the button press. See http://www.ganssle.com/debouncing-pt2.htm
I think you are trying to learn, so perhaps you should keep on with your current design to see the problem in switch/button bouncing. Then try to fix it using the timed interrupt. I could write the code for you, but it would be a waste of time for both of us.
01-25-2021 11:40 AM
Primarily in the Generic Interrupt Controller (GIC), which is in the Arm Cortex-A9 MPCore. The GIC takes interrupt events from all over the system and forwards the interrupt requests to one or both cores in the MPCore unit, where the interrupt is handled. However, interrupts from peripherals in the Processing System can also be routed to the programmable logic (so technically interrupts can be used in two locations, which is what you asked).
See Chapter 7 of the Zynq-7000 TRM (UG585).
Also, the GIC, spec v1.0.