Fujitsu MB90390 Series Hardware Manual page 330

Table of Contents

Advertisement

CHAPTER 18 8/10-BIT A/D CONVERTER
Coding example
BAPL
BAPM
BAPH
ISCS
IOAL
IOAH
DCTL
DCTH
DDR6
ADER0
ICR10
ADCS0
ADCS1
ADCR0
ADCR1
;-----Main program---------------------------------------------------------------
START:
LOOP:
302
EQU
000100H
EQU
000101H
EQU
000102H
EQU
000103H
EQU
000104H
EQU
000105H
EQU
000106H
EQU
000107H
EQU
000016H
EQU
00000CH
EQU
0000BAH
EQU
000034H
EQU
000035H
EQU
000036H
EQU
000037H
CODE
CSEG
AND
CCR,#0BFH
MOV
ICR10,#00H
MOV
BAPL,#00H
MOV
BAPM,#02H
MOV
BAPH,#00H
MOV
ISCS,#18H
MOV
IOAL,#36H
MOV
IOAH,#00H
MOV
DCTL,#03H
MOV
DDR6,#11110001B
MOV
ADER0,#00001110B ;Sets P61/AN1 to P63/AN3 as analog inputs.
MOV
CTH,#00H
MOV
ADCS0,#0BH
MOV
ADCS1,#0A2H
MOV
ILM,#07H
OR
CCR,#40H
MOV
A,#00H
MOV
A,#01H
BRA
LOOP
;Lower buffer address pointer
;Intermediate buffer address pointer
;Upper buffer address pointer
2
;EI
OS status register
;Lower I/O address register
;Upper I/O address register
;Lower data counter
;Upper data counter
;Port 6 direction register
;Analog input enable register
;Interrupt control register for A/D Converter
;A/D control status register
;
;A/D data register
;
;Assumes that the stack pointer (SP) has already
;been initialized.
;Disables interrupts.
;Interrupt level:
0 (highest priority)
;Sets the address to which the conversion data is
;transferred and stored.
;(Uses 200
to 205
.)
H
H
;
;Transfers word data, adds 1 to the address,
; then transfers the data from I/O to memory.
;Sets the address of the analog data register as
;the transfer source address pointer.
2
;Sets the EI
OS transfer count to three, which is
;the same value as the conversion count.
;Sets P61 to P63 as input.
;
;Single activation. Converts AN1 to AN3.
;Software activation. Begins A/D conversion.
;Enables interrupts.
;Sets ILM in PS to level 7.
;Enables interrupts.
;Endless loop

Advertisement

Table of Contents
loading

Table of Contents