Chapter 3
eSL/eSLS Series (+ eSLZ000) User’s Manual
Peripheral Control
••••
97
3.6.4 Examples
/* Set ADC Single mode from Channel 0 and output the read data
to PORTA */
….
.DATA
BUF_PD .DS 1
.CODE
POWERON:
R0 = #0
BUF PD = R0
;
Clear data_buffer
BS IO[SR].GIE
;
GIE active
BS IO[INTE1].ADIE
;
ADC Interrupt active
AD_ON ; Enable ADEN
R0 = #64
RPT R0
NOP
AD SINGLE 0,3
;
Set ADC Single mode, ch0, clk
;
(=FPLL/64)
ADC_WAIT:
NOP
NOP
NOP
;
Wait ADC interrupt
BTEST BUF PD.0
;
Check ADC conver end ?
IF TC JMP ADC WAIT
R0 = BUF PD
;
ADC trans OK, Read data
IO[PORTA]= R0
;
Out read data to PORT A
BC IO[SR].GIE
;
Disable GIE
BC IO[INTE1].ADIE
;
Disable ADC Interrupt
AD OFF
;
ADC OFF
Delay:
;
Main loop
JMP Delay
/* ADC interrupt function */
ADCINT:
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_bufer
POP R0
POP IO[@_LIB_SR]
POP IO[@_LIB_BSR]
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...