User manual

V850E2/MN4 A/D Converter Control
R01AN0923EJ0100 Rev.1.00 Page 8 of 26
Feb 13, 2012
4.2 Register Setup
This section explains how to set up the relevant registers according to the flow charts shown in section 4.1. The
registers described below must be configured to control the A/D converter.
4.2.1 Port Setup
The LEDs are connected to port 13. The pertinent control registers must be set up as shown in the table below. The
P13_7 pin is used for LED1. The P13_6 pin is used for LED2.
Macro Pin PMC PFCE PFC PM Corresponding function
P13_6 0 0 0 0 Port mode, output PORT
P13_7 0 0 0 0 Port mode, output
Setting examples
/* P13_6: LED2; port mode; output*/
/* P13_7: LED1; port mode; output*/
PFCE13 = 0x0000;
PFC13 = 0x0000;
PMC13 = 0x0000;
PM13 = 0x0000;
4.2.2 A/D Converter Stabilization Counter Register (ADCAnCNT)
This register specifies the stabilization time of the A/D converter.
Figure 4.3 ADCAnCNT Register Format
Setting example
ADCA0CNT = 0xff; /* stabilization counter */