Fujitsu MB90390 Series Hardware Manual page 336

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
TMCSR1L EQU
TMCSR1H EQU
TMRL1L
TMRL1H
;-----Main program---------------------------------------------------------------
START:
LOOP:
308
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
000068H
000069H
EQU
003902H
EQU
003903H
CODE
CSEG
AND
CCR,#0BFH
MOV
ICR10,#08H
MOV
BAPL,#00H
MOV
BAPM,#06H
MOV
BAPH,#00H
MOV
ISCS,#19H
MOV
IOAL,#36H
MOV
IOAH,#00H
MOV
DCTL,#0CH
MOV
DDR6,#00000000B
MOV
ADER0,#00001000B ;Sets P63/AN3 as analog input.
MOV
ADCS0,#0DBH
MOV
ADCS1,#0A8H
MOVW
TMRL1L,#0320H
MOV
TMCSR1H,#00H
MOV
TMCSR1L,#12H
MOV
TMCSR1L,#13H
MOV
ILM,#07H
OR
CCR,#40H
MOV
A,#00H
MOV
A,#01H
BRA
LOOP
;Lower buffer address pointer
;Middle 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
;
;Lower control status register 1
;
;16-bit reload register 1
;
;Assumes that the stack pointer (SP) has already
;been initialized.
;Disables interrupts.
;Interrupt level:
0 (highest priority) + EI
;Sets the address to which conversion data is stored.
;(Uses 600
to 617
.)
H
H
;
;Transfers word data, adds 1 to the address,
;transfers from I/O to memory, then ends by a
;resource request.
;Sets the address of the analog data register as the
;transfer source address pointer.
;Transfers only channel 3 twelve times by
;Sets P60 to P67 as input.
;Stop conversion mode. Converts AN3 CH.
;Activates the 16-bit timer, starts A/D conversion,
;and enables interrupts.
;Sets the timer value to 800 (320
;Sets the clock source to 125 ns and disables
;external trigger.
;Disables timer output, disables interrupts, and
;enables reload.
;Activates the 16-bit timer.
;Sets ILM in PS to level 7.
;Enables interrupts.
;Endless loop
2
OS.
2
EI
OS
), 100 ?s.
H

Advertisement

Table of Contents
loading

Table of Contents