To use events, both the event system, the generating peripheral and
peripheral(s) using the event must be set up appropriately.
- 1.Configure the generating peripheral
appropriately. As an example, if the generating peripheral is a timer, set the
prescaling, compare register, etc. so that the desired event is generated.
- 2.Configure the
event user peripheral(s) appropriately. As an example, if the ADC
is the event user, set the ADC prescaler, resolution, conversion
time, etc. as desired, and configure ADC conversion to start on
the reception of an event.
- 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
EVSYS.CHANNEL0. Configure the ADC to listen to this channel, by writing to
EVSYS.USERn, where n is the index allocated to the ADC.