458
CHAPTER 16 8/10-BIT A/D CONVERTER
MB90560 series
16.9 Sample Program 2 for Continuous Conversion Mode Using
EI2OS
This section contains a sample program for A/D conversion in continuous conversion
mode using EI2OS.
I
Sample program for continuous conversion mode using EI2OS
G
Processing
Analog inputs AN3 to AN5 are converted twice. Two conversion data items are obtained for
each channel.
The conversion data is sequentially transferred to addresses 600
H
to 60B
H
.
A resolution of 10 bits is selected.
The conversion is activated by 16-bit reload timer 1.
Figure 16.9-1 shows a flowchart of the program using EI2OS (continuous conversion mode).
Figure 16.9-1 Flowchart of program using EI2OS (continuous conversion mode)
G
Coding example
BAPL
BAPM
BAPH
ISCS
IOAL
IOAH
DCTL
DCTH
DDR5
ADER
ICR00
ADCS0
ADCS1
ADCR0
ADCR1
TMCRL1
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
000100H
000101H
000102H
000103H
000104H
000105H
000106H
000107H
000015H
000017H
0000B0H
000034H
000035H
000036H
000037H
000086H
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;Lower control status register 1
Lower buffer address pointer
Middle buffer address pointer
Upper buffer address pointer
EI2OS status register
Lower I/O address register
Upper I/O address register
Lower data counter
Upper data counter
Port 5 direction register
Analog input enable register
Interrupt control register for A/DC
A/D control status register
A/D data register
AN3
Interrupt
Transfer by EI
2
OS
Interrupt
Transfer by EI
2
OS
Interrupt
After a total of
six transfers
Interrupt sequence
End
Transfer by EI
2
OS
AN4
AN5
Start conversion