Ballast Demonstrator User Guide
-17
7629A–AVR–04/06
5.1
Main_AT8xEB5114_fluo_demo.c
This file executes all the peripherals initializations and then schedules the different con-
trol tasks.
The ADC state machine is included in this file. The ADC state machine is controlled via
interrupts.
5.1.1
ADC STATE
MACHINE
The ADC state machine functional diagram is shown below:
Figure 5-2.
ADC state machine diagram
The different states are outlined below:
ADC_OFF
The ADC was previously off, this is the first conversion and is not necessarily valid.
Start the first V_HAVERSINE_CONV conversion.
V_HAVERSINE_CONV
Get back the v_haversine result.
Start the V_BUS_CONV next conversion.
V_BUS_CONV
Get back the v_bus result.
Start the V_HAVERSINE_CONV, the TEMPERATURE_CONV, or the V_LAMP_CONV
conversion depending on
g_time_waiting_since_latest_temperature_conv.
TEMPERATURE_CONV
Get back the temperature_result.
Start the V_LAMP_CONV conversion.
V_LAMP_CONV
Get back the v_lamp result.
V_HAVERSINE_CONV
TEMPERATURE_CONV
V_BUS_CONV
ADC_OFF
g_time_waiting_since_latest_temperature_conv >=
TIME_TO_WAIT_BETWEEN_TWO_TEMPERATURE_CONV
V_LAMP_CONV
I_LAMP_CONV