User manual
Atmel AT02657: XMEGA-E5 Xplained Software User Guide [APPLICATION NOTE]
42085A−AVR−04/2013
8
2.3
Sampling task
The schedule and the ADC conversions are done only by interrupt (RTC and ADC) to guarantee a constant acquisition.
The FIFO service is used to save value, thus the sampling task can read FIFO, send values through USART and
display values without timing constraint. The implementation is available in app_sampling.c/.h files.
Figure 2-3. Sampling task behavior.
RTC ADC
RTC alarm
Sampling task
app_sampling_task()
app_sampling_start()
adc_start_conversion()
Light sensor
conversion done
app_sampling_handler()
adc_start_conversion()
rtc_get_time()
FIFO
fifo_push()
app_sampling_task()
fifo_pull()
Display values
printf() (stdio on USART)
rtc_set_alarm_relative()