Chapter 3
eSL/eSLS Series (+ eSLZ000) User’s Manual
Peripheral Control
••••
73
Timer1 Control
(
TCON1) Register Attributes and Definitions:
TCON1
Bit
DIR.
Description
Reset Value
TEN1
[15]
R/W
Timer Enable (this bit enables or disables
Timer function)
:
0
= Disable (Stop)
1
= Enable (Start)
0
TCS1
[2:0]
R/W
Clock divider of PLL clock source
:
000:
F
PLL
/32
001:
F
PLL
/64
010:
F
PLL
/128
011:
F
PLL
/256
100:
F
PLL
/512
101:
F
PLL
/1024
110:
F
PLL
/2048
111:
F
PLL
/4096
000
3.3.1.4 Examples
/* Set Timer0 to count and output a square waveform to PORTA7 */
…..
…..
.include "interruptvector.def"
POWERON:
R0 = #0x0080
IO[PORTA] = R0
;
Set PORTA7 output
R0=#0X0F
IO[TRL0]=R0
;
Set timer0 reload value
R0=#0x8007
IO[TCON0]=R0
;
Enable timer0,clock
source=Fpll/4096
BS IO[SR].GIE
;
Enable GIE
BS IO[INTE0].TIE0
;
Enable timer0 interrupt
Delay:
;
Main loop
JMP _Delay
/* Timer0 interrupt function */
Timer0INT:
PUSH IO[SR]
BTG IO[PORTA].7 /* PORTA7 Toggle output,plus wide
=(1/16384000)*4096*(0x0F+1)=4ms* /
BC IO[INTF0].TIF0
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...