The project is based on Motorola Microcontroller. The data base is intended to
show how to work with ADC module of M68HC11A8. An arrangement of
variable resistor and a DC voltage source is used as analog input. The analog voltage
value from the potentiometer is given to Port E (0), channel 0 of ADC
module. The peripheral is configured to use system clock, continuous single
channel conversion in channel 0, by placing appropriate value in ADC
control register - ADCTL. CCF flag bit in ADCTL goes high on
completion of conversion.
Corresponding digital value of analog input will be available in ADC
result register, ADR1, when CCF (7th bit of ADCTL) goes
high. For next conversion, CCF flag has to be reset. This can be done by
performing a write operation with ADCTL register. The converted value is copied Port B, which can be observed
with waveform viewer.
The program includes a general purpose ADC configuration function (initADC ())
and associated definitions for initializing ADC.
The source code written in C language and can be viewed from the
code editor window.
It can be compiled after making any modifications (editing) and also
debugged during simulation. ORTS.h"
The program is as shown:
#define CONT_M 0x30 //continuous conversion with multiple channelse LIM_M 0x10 //limited (4) conversion with multiple channels
#define LIM_S 0x00 //limited (4) conversion with single channel