English
Language : 

SAM4L Datasheet, PDF (844/1185 Pages) ATMEL Corporation – ATSAM ARM-based Flash MCU
ATSAM4L4/L2
31.6 Functional Description
31.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.
31.6.1.1
Channel Setup
The Channel Multiplexer Register (CHMXi) 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 configure a channel, user software must:
• disable the channel by writing a one to CHDR
• configure CHMXi
• enable the channel by writing a one to CHER
31.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) bit is set to one 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).
31.6.1.3
Software Event
A Software Event can be initiated by writing to the Software Event Register (SEV). This is
intended for application debugging.
The channel must first be configured by writing a one to the Software Event Multiplexer bit
(SMX) of CHMXi.
Writing a one to the appropriate bit of SEV will then trigger a Software Event on the channel.
42023C–SAM–02/2013
844