Fujitsu MB90460 Series Hardware Manual page 584

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

ADCR0
EQU
ADCR1
EQU
;-------Main program------------------------------------------------------------------------------------------------------
CODE
CSEG
START:
AND
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
OR
LOOP:
MOV
MOV
BRA
;-------Interrupt program--------------------------------------------------------------------------------------
ED_INT1:
MOV
RETI
CODE
ENDS
;-------Vector setting------------------------------------------------------------------------------------------------------
VECT
CSEG
ORG
DSL
ORG
DSL
DB
VECT
ENDS
END
000036H
;A/D data register
000037H
;
;Assumes that the stack pointer (SP) has already
been initialized
CCR,#0BFH
;Disables interrupts
ICR00,#00H
;Interrupt level: 0 (highest priority)
BAPL,#00H
;Sets the address to which the conversion data is
transferred and stored
BAPM,#02H
;(Uses 200H to 205H.)
BAPH,#00H
;
ISCS,#18H
;Transfers word data, adds 1 to the address, then
transfers the data from I/O to memory
IOAL,#36H
;Sets the address of the analog data register as the
IOAH,#00H
;transfer source address pointer
DCTL,#03H
;Sets the EI
DDR5,#11110001B
;Sets P51 to P53 as input
ADER,#00001110B
;Sets P51/AN1 to P53/AN3 as analog inputs
DCTH,#00H
;
ADCS0,#0BH
;Single activation. Converts AN1 to AN3
ADCS1,#0A2H
;Software activation. Begins A/D conversion.
ILM,#07H
;Sets ILM in PS to level 7
CCR,#40H
;Enables interrupts
A,#00H
;Endless loop
A,#01H
LOOP
I:ADCS1,#00H
;Stops A/D conversion. Clears and disables the
interrupt flag
;Returns from interrupt
ABS=0FFH
0FFD0H
;Sets vector for interrupt #11 (0BH)
ED_INT1
0FFDCH
;Sets reset vector
START
00H
;Sets single-chip mode
START
CHAPTER 20 8/10-BIT A/D CONVERTER
2
OS transfer count to three, which is the
same value as the conversion count
Enables interrupts
565

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents