
DocID13284 Rev 2
373/564
UM0404
Analog / digital converter
The analog input channels AN16...AN23 are alternate functions of Port1L which is an 8-bit
bidirectional port. The Port1L lines may either be used as analog input or digital
input/output. The additional register XP1DIDIS can be used to further protect ADC input
analog section disabling the digital input section. Refer to
inputs disturb protection on page 144
for details on register XP1DIDIS.
In order to configure the Port1L lines as analog inputs it is first of all recommended to
properly set register XP1DIDIS; next it is necessary to set bit ADCMUX of register XMISC:
in this way all analog input channels of Port5 are disabled, and the analog signal to the
Converter is provided through the Port1L pins.
Both XMISC and XP1DIDIS registers can be accessed only after bit XMISCEN of register
XPERCON and bit XPEN of register SYSCON have been set.
XMISC (EB46h)
XBUS
Reset Value: 0000h
The functions of the A/D converter are controlled by the bit-addressable A/D Converter
Control Register ADCON.
Its bit-fields specify the analog channel to be acted upon, the conversion mode, and also
reflect the status of the converter.
ADCON (FFA0h / D0h)
SFR
Reset Value: 0000h
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
-
-
-
-
-
-
-
-
-
-
-
-
VREG
OFF
CAN
CK2
CAN
PAR
ADC
MUX
RW
RW
RW
RW
Bit
Function
ADCMUX
Port1L ADC Channels Enable
‘0’: Analog inputs on port P5.y can be converted (default configuration)
‘1’: Analog inputs on port P1.z can be converted. Only 8 channels can be managed
CANPAR
CAN Parallel Mode Selection
‘0’: CAN2 is mapped on P4.4/P4.7, while CAN1 is mapped on P4.5/P4.6
‘1’: CAN1 and CAN2 are mapped in parallel on P4.5/P4.6. This is effective only if
both CAN1 and CAN2 are enabled through setting of bits CAN1EN and CAN2EN in
XPERCON register. If CAN1 is disabled, CAN2 remains on P4.4/P4.7 even if bit
CANPAR is set.
CANCK2
CAN Clock divider by 2 disable
‘0’: Clock provided to CAN modules is CPU clock divided by 2 (mandatory when
f
CPU
is higher than 40 MHz)
‘1’: Clock provided to CAN modules is directly CPU clock
VREGOFF
Main Voltage Regulator disable for Power Down mode
‘0’: Default value after reset and when Power Down is not used.
‘1’: On-chip Main Regulator is turned off when Power Down mode is entered.
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
ADCTC
ADSTC
AD
CRQ
AD
CIN
AD
WR
AD
BSY
ADST
AD
OFF
ADM
ADCH
RW
RW
RW
RW
RW
R
RW
RW
RW
RW