229
32117D–AVR-01/12
AT32UC3C
14.6
Functional Description
14.6.1
PEVC Channel Operation
PEVC routes incoming events to users by means of one channel per user. Channels operate in
parallel, allowing multiple users to listen to the same generator.
14.6.1.1
Channel Setup
The Channel Multiplexer Register (CHMXn) is written to allocate a generator to a given channel.
The Event Multiplexer field (EVMX) selects between the different generators, while the Software
Event Multiplexer bit (SMX) selects Software Events.
The channel is then enabled by writing a one to the appropriate bit in the Channel Enable Regis-
ter (CHER). It is disabled by writing a one to the appropriate bit in the Channel Disable Register
(CHDR).
To safely program a channel, user software must:
disable the channel by writing a one to CHDR
program CHMXn
enable the channel by writing a one to CHER
14.6.1.2
Channel Operation
When the channel is enabled, the user signals its busy/ready state to the channel, to determine
how an incoming event will be handled:
If the user is ready, an incoming event is forwarded. The corresponding Trigger Status
Register (TRISR) flag is set allowing an interrupt to be generated for tracking PEVC
operations.
If the user is busy (because of a previous event, or for some other cause), the new event is
not forwarded. The corresponding Overrun Status Register (OVSR) flag is set allowing an
interrupt to be generated.
The Busy Register (BUSY) is used to determine the current activity of a channel/user. A busy
status has one of two causes:
A peripheral event is being relayed by the channel and handled by the user,
No event relayed, but user is not ready (e.g. not initialized, or handling some other request).
14.6.1.3
Software Event
A Software Event can be initiated by software writing to the Software Event Register (SEV). This
is intended for application debugging.
The channel must first be programmed by writing a one to the Software Event Multiplexer bit
(SMX) of CHMXn.
Writing a one to the appropriate bit of SEV will then trigger a Software Event on the channel.