To utilize events, the Event System, the generating peripheral, and the peripheral(s) using the event must be set up accordingly:

  1. 1.Configure the generating peripheral appropriately. For example, if the generating peripheral is a timer, set the prescaling, the Compare register, etc., so that the desired event is generated.
  2. 2.Configure the event user peripheral(s) appropriately. For example, if the ADC is the event user, set the ADC prescaler, resolution, conversion time, etc., as desired, and configure the ADC conversion to start at the reception of an event.
  3. 3.Configure the Event System to route the desired source. In this case, the Timer/Compare match to the desired event channel. This may, for example, be Channel 0, which is accomplished by writing to the Channel 0 Generator Selection (EVSYS.CHANNEL0) register.
  4. 4.Configure the ADC to listen to this channel by writing to the corresponding User x Channel MUX (EVSYS.USERx) register.