English
Language : 

EVLB001 Datasheet, PDF (20/35 Pages) ATMEL Corporation – Automatic microcontroller dimmable ballast
ATPWMX Demonstrator Software
6.1
Main_pwmx_fluo_de This file executes all the peripheral initialization and then schedules the different control
mo.c
tasks.
The ADC and the Command control state machines are also included in this file. The
ADC machine is controlled via interrupts.
6.1.1
COMMAND
CONTROL STATE
MACHINE
The Command Control state machine centralizes the SWITCH and DALI controls in
order to switch PFC operation On or Off and to set the lamp control instructions given by
the user.
The Command Control state machine functional diagram is shown below:
Figure 6-2. Control State Machine
WAIT_FOR_FIRST_COMMAND
gs_nbr_read_switch_shot_zero >= MIN_SHORT_TOUCH_SET
is_dali_running() == 1
SWITCH_CONTROL
update gv_pfc_state and gv_lamp_state
depending on gv_lamp_preset_current
DALI_CONTROL
update gv_pfc_state and gv_lamp_state
depending on gv_lamp_preset_current
The different states are outlined below:
WAIT_FOR_FIRST_COMMAND
The three control means are scanned and the first command caught sets the state
machine according to the command received. (SWITCH_CONTROL or
DALI_CONTROL).
SWITCH_CONTROL
Read the input pin.
Analyze the touch dim command.
Set the control variable values corresponding to the user request.
DALI_CONTROL
Read the DALI Command.
Answer the request or set the control variable values corresponding to the DALI
command.
ATAVRFBKIT / EVLB001 User Guide
6-18
7597B–AVR–10/07