
Page 1
XC886/888
Getting Started
V1.0
DAvE
V1.0 May 2006
XC886/888CLM
Getting Started on MCAN - ADC

Page 2
XC886/888
Getting Started
V1.0
DAvE
We will use DAvE to create a project to demonstrate the feature of
interrupt, MCAN, and ADC.
ADC will be configured to the parallel conversion mode with
autoscan.
ADC will constantly scan the analog input channel 7 (thru P2.7).
Interrupt will be generated every time the conversion is done. In
the interrupt routine, the conversion result will be transmitted thru
CAN NODE1.
CAN NODE0 is configured with Message Object 16, to be able to
received any frame in the CAN Bus. When the valid frame is
received, the interrupt will be generated. In the interrupt routine,
the received data will be send to PORT3.
CAN NODE1 is configured with Message Object 1, to be able to
transmit a frame, which consist of 1 data byte (the result of ADC
conversion).
DAvE Setup and Code Generation

Page 3
XC886/888
Getting Started
V1.0
DAvE
Step1: Creating the new project
File
Æ
New
Step2: Select 8-bit Microcontroller
XC886CLM
and then click the “Create” button.
Step3: Inspecting General Settings
Click the “Global Setting” tab.
Select the “Enable Global Interrupt”
checkbox.
(If it is not yet selected)
Close the interface by clicking
DAvE Setup and Code Generation

Page 4
XC886/888
Getting Started
V1.0
DAvE
Step 4.1: Configuring ADC Module
Click “ADC” bubble.
On the ADC menu that appears,
Click “General” tab and do the
following:
-) In the Analog Clock Divider field:
Select “fADC / 3”
-) Select “8 bit resolution”
-) Select “Enable arbitration slot 1”
Step 4.2: Configuring ADC Module
Click “Channels” tab.
Click “Configure Channel 7” button.
New pop up window will appear.
Select “Enable Channel 7”.
Close the new pop up window by
clicking
DAvE Setup and Code Generation

Page 5
XC886/888
Getting Started
V1.0
DAvE
Step 4.3: Configuring ADC Module
Click “Parallel” tab.
Select the following:
“Gating line is permanently 1”
and
“Enable autoscan”
Step 4.4: Configuring ADC Module
Click “Result Register” tab.
Select the following under the “Settings
for Result Register 0 (RCR0)”
“Enable interrupt”
and
“Reset valid flag register by read
access”
DAvE Setup and Code Generation
- 1
- 2
前往页