Chapter 3
eSL/eSLS Series (+ eSLZ000) User’s Manual
Peripheral Control
••••
65
3.1.3 Examples
Example A:
/* Set WDTCON register to reset your system*/
……
……
POWERON:
R0 = #0x0002
IO[WDTCON] = R0
;
Clear WDT timer
R0 = #0x8004
;
Enable WDT, enable overflow,
clock source=32768/4
IO[WDTCON] = R0
;
Reset time=(32768/4)*256=31.2ms
_Delay:
;
Main loop
JMP _Delay
Example B:
/* Set watchdog as general 8bit timer (no reset) and output square
waveform to PORTA7 */
…..
…..
.include "interruptvector.def"
POWERON:
R0 = #0X0080
;
Set PORTA7 output
IO[PDIRA] = R0
R0 = #0X0002
IO[WDTCON] = R0
;
Clear WDT timer
R0 = #0x8000
IO[WDTCON] = R0 /* enable WDT, Disable overflow(no reset),
clock source=32768/4 */
BS IO[SR].GIE
;
Enable GIE
BS IO[INTE1].WDTIE
;
Enable WDT interrupt
Delay:
;
Main loop
JMP _Delay
/* Watchdog interrupt function */
WDTINT:
PUSH IO[SR]
BTG IO[PORTA].7 /* PA7 Toggle output , plus wide
=1(32768/4)s=122us */
BC IO[INTF1].WDTIF
POP IO[SR]
RETI
Содержание eSL Series
Страница 8: ...Contents viii Contents eSL eSLS Series eSLZ000 User s Manual...
Страница 11: ...Contents eSL eSLS Series eSLZ000 User s Manual Contents xi...
Страница 12: ......
Страница 28: ......
Страница 110: ...Chapter 3 98 Peripheral Control eSL eSLS Series eSLZ000 User s Manual BC IO INTF1 ADIF RETI...
Страница 115: ...Chapter 3 eSL eSLS Series eSLZ000 User s Manual Peripheral Control 103...
Страница 148: ......
Страница 154: ...Chapter 4 142 Electrical Characteristics eSL eSLS Series eSLZ000 User s Manual...