User manual

V850E2/MN4 A/D Converter Control
R01AN0923EJ0100 Rev.1.00 Page 6 of 26
Feb 13, 2012
4. Sample Application
This section explains the A/D conversion of this sample program.
4.1 Flow Charts
The flow charts of this sample program are given below.
4.1.1 Main Processing
The main processing sets up and then starts A/D conversion. The A/D conversion is repeated and its state is indicated
by the LEDs. When A/D conversion ends, the signal for LED1 is inverted.
Overwriting of a result of A/D conversion before it is read leads to the generation of an error interrupt
(INTADCAnTERR) indicating this, and LED2 is turned on in response.
See section 4.1.2 for the details of the individual transfer processing.
START
DI
SYSTEM_INITIAL
APPLICATION_INITIAL
ADC_INITIAL
EI
ADC_START
DISPLAY
Infinite loop
Start program
Disable maskable interrupts
Initialize system
Initialize software
Initialize A/D converter
Enable maskable interrupts
Start conversion
Control LEDs according to
conversion state
InitializationMain processing
Figure 4.1 Main Processing Flowchart