EM73201
4-BIT MICRO-CONTROLLER FOR GENERAL PURPOSE PRODUCT
LDIA #01H;
STATAM;
LDIA #0FH;
STATAH;
LDIA #1000B;
OUTA P28; enable timerA with internal pulse rate: XIN/210 Hz
NOTE: The preset value of timer/counter register is calculated as following procedure.
Internal pulse rate: XIN/210 ; XIN = 4MHz
The time of timer counter count one = 210 /XIN = 1024/4000=0.256ms
The number of internal pulse to get timer overflow = 60 ms/ 0.256ms = 234.375 = 0EAH
The preset value of timer/counter register = 1000H - 0EAH = 0F16H
PULSE WIDTH MEASUREMENT MODE
For the pulse width measurement mode, the counter only incresed by the rising edge of internal pulse rate as
external timer/counter input (P8.3/TRGA ), interrupt request will be generated as soon as timer/counter
overflow.
P8.3/TRGA
Internal pulse
n
n+1
n+2
n+3
n+4
n+5
TimerA value
PROGRAM EXAMPLE: Enable timerA by pulse width measurement mode .
LDIA #1100B;
OUTA P28; Enable timerA with pulse width measurement mode.
INTERRUPT FUNCTION
There are 4 interrupt sources, 2 external interrupt sources, 2 internal interrupt sources . Multiple
interrupts are admitted according the priority .
Type
Interrupt source
Priority Interrupt
Latch
Interrupt
Program ROM
entry address
Enable condition
External External interrupt(INT0)
Internal Reserved
1
2
IL5
IL4
IL3
IL2
IL1
IL0
EI=1
002h
004h
006h
008h
00Ah
00Ch
EI=1, MASK3=1
EI=1, MASK2=1
EI=1, MASK1=1
Internal TimerA overflow interrupt (TRGA) 3
Internal Reserved
4
5
6
Internal Time base interrupt(TBI)
External External interrupt(INT1)
EI=1,MASK0=1
* This specification are subject to be changed without notice.
15
7.20.1999