27.5.6 Events

The PORT allows up to four input events to control individual I/O pins. These input events are generated by the Event System (EVSYS) module and can originate from a different clock domain than the clock domain of the PORT module.

Table 27-3. Event Users
User NameDescriptionInput DetectionChannel Path Type
PeripheralInput
PORTEV_nPORT Event n InputLevel/Rising EdgeAsynchronous

Writing a ‘1’ to an Event Input Enable bit in the Event Control register (EVCTRL.xxEI) enables the corresponding action on an input event. Writing a ‘0’ to this bit disables the corresponding action on input event.

The event users can trigger the following actions. Note that if connected to several events, the enabled action will be taken on any of the incoming events.

Table 27-4. Event Actions
Event InputEvent ActionDescriptionInput DetectionAsync/Sync
EV_nOUTThe Data Output Value bit of I/O pin PIDn will be set to the level of the eventLevelAsynchronous
SETThe Data Output Value bit of I/O pin PIDn will be setRising EdgeUp to three clock cycles after a rising edge. Not available in Standby sleep mode.
CLRThe Data Output Value bit of I/O pin PIDn will be cleared
TGLThe Data Output Value bit of I/O pin PIDn will be toggled

The event actions are configured in the Event n Action bit fields in the Event Control register (EVCTRL.EVACTn).

Each event input can address one I/O pin per PORT group. The selection of the pin is indicated by the Event n Pin Identifier bit fields in the EVCTRL register (EVCTRL.PIDn).

To avoid action conflict on the output value of the register (OUT) for a particular I/O pin, only one action is executed.
  • When only SET actions are triggered simultaneously, a SET action is executed
  • When only CLR actions are triggered simultaneously, a CLR action is executed
  • If any other combinations of actions are triggered simultaneously, a TGL action is executed

Because events are received asynchronously, the I/O pin may have unpredictable levels, depending on the timing of when the events are received. When several events are output to the same pin, the lowest event line will have access and all other events will be ignored.

Refer to the EVSYS - Event System chapter for details on configuring the event system.