Chapter 3
122
••••
Peripheral Control
eSL/eSLS Series (+ eSLZ000) User’s Manual
3.9.2 Examples
/* Set MIC input with ADC Channel 5 (PC5) */
…..
…..
.DATA
BUF
_
PD .DS 1
.CODE
POWERON:
R0 = #0
BUF
_
PD = R0
R0 = IO[PCONC]
R0 = R0 OR #0x0C00
IO[PCONC] =R0
;
set portc.5 = ADC input
BS IO[SR].GIE
;
GIE active
BS IO[INTE1].ADIE
;
ADC Interrupt active
MIC
_
ON 1,2
;
MIC ON, AGC ON, Gain = 3
DA
_
CON 0,0,7
;
Set DAC Un-Sign mode, always pass
mode, vol=3mA max.
AD
_
SINGLE 5,1
;
Set ADC Single mode, ch5, clk1
(=FPLL/16)
BC BUF
_
PD.0
_
ADC
_
WAIT5:
NOP
NOP
NOP
;
Wait ADC interrupt
BTEST BUF
_
PD.0
IF TC JMP
_
ADC
_
WAIT5
R0= BUF
_
PD
;
ADC trans OK, Read data
IO[PORTA]= R0
;
Out read data to PORT A
DA
_
OUT R0
;
Out data to DAC
_
Delay :
JMP
_
Delay
; Main loop
ADCINT: /* ADC interrupt function */
PUSH IO[@
_
LIB
_
BSR]
PUSH IO[@
_
LIB
_
SR]
PUSH R0
AD
_
READ
;
ADC trans OK, read date to R0
BS R0.0
;
Set Flag
BUF
_
PD = R0 (L)
;
Save to data_buffer
POP R0
POP IO[@
_
LIB
_
SR]
POP IO[@
_
LIB
_
BSR]
BC IO[INTF1].ADIF
RETI
Summary of Contents for eSL Series
Page 8: ...Contents viii Contents eSL eSLS Series eSLZ000 User s Manual...
Page 11: ...Contents eSL eSLS Series eSLZ000 User s Manual Contents xi...
Page 12: ......
Page 28: ......
Page 110: ...Chapter 3 98 Peripheral Control eSL eSLS Series eSLZ000 User s Manual BC IO INTF1 ADIF RETI...
Page 115: ...Chapter 3 eSL eSLS Series eSLZ000 User s Manual Peripheral Control 103...
Page 148: ......
Page 154: ...Chapter 4 142 Electrical Characteristics eSL eSLS Series eSLZ000 User s Manual...