Electrical – Configuring events on Xmega

atxmegaavrxmega

Is it necessary to enable the interrupt for a given event source in order for the event to fire, or is it only necessary to select the source from the event system?

To clarify, I am asking about the Xmega Event System, not the interrupt system.

Best Answer

Is it necessary to enable the interrupt for a given event source in order for the event to fire

No. One of the features of the XMEGA event system is that it specifically doesn't need interrupts. Programs for other architectures which would need to use interrupts to cause X to be detected and then trigger Y, can in some cases (depending on X and Y) use the event system on XMEGA without using interrupts.

I remember reading that all events that cause interrupts can also generate events, although I didn't try to prove that myself. Also a situation (say a timer overflow) can be programmed to generate both an event and an interrupt. Again, that advanced usage isn't something I have proved myself, but I don't doubt the claim.

is it only necessary to select the source from the event system

Using events requires more than just selecting the source. In broad terms, you have to decide on the event source (event generator); the event target (event user); the event channel (mux number); and configure all three in the setup code. Of course there are lots of details "below" that overview, depending on the peripherals involved and the system design.

The event system is described in section 6 of the Atmel XMEGA A Manual.

Related Topic