English
Language : 

EM73866 Datasheet, PDF (19/39 Pages) ELAN Microelectronics Corp – 4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
EM73866
4-BIT MICRO-CONTROLLER FOR LCD PRODUCT
PROGRAM EXAMPLE: To generate TRGA interrupt request after 60 ms with system clock LXlN=32KHz
LDIA #0100B ;
EXAE
; enable mask 2
EICIL 110111B ; interrupt latch ←0, enable EI
LDIA #0AH ;
STATAL
;
LDIA #00H ;
STATAM
;
LDIA #0FH ;
STATAH
;
LDIA #1000B ;
OUTA P28 ; enable timerA with internal pulse rate: LXIN/23 Hz
NOTE:
The preset value of timer/counter register is calculated as following procedure.
Internal pulse rate: LXIN/23 ; LXIN = 32KHz
The time of timer counter count one = 23 /LXIN = 8/32768=0.244ms
The number of internal pulse to get timer overflow = 60 ms/ 0.244ms = 245.901= 0F6H
The preset value of timer/counter register = 1000H - 0F6H = 0F0AH
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.1/TRGB, P7.0/TRGA ), interrupt request will be generated as soon as
timer/counter count overflow.
P8.1/TRGB(P8.3/TRGA)
Internal pulse
TimerB(TimerA) value
n n+1 n+2 n+3 n+4 n+5
PROGRAM EXAMPLE: Enable timerA by pulse width measurement mode.
LDIA #1100b ;
OUTA P28 ; Enable timerA with pulse width measurement mode.
HIGH SPEED TIMER/COUNTER
EM73866 has one 8-bit high speed timer/counter (HTC). It supports three special functions : auto load timer,
melody output and pulse width measurement modes. The HTC is available for the NORMAL and SLOW
operation mode.
The HTC can be set initial value and send counter value to counter registers (P11 and P10), P31 is the
command port for HTC, user can choose different operation mode and different internal clockrate by setting
the port. The timer/counter increase one at the rising edge of internal pulse. The HTC can generate an overflow
interrupt (HTCI) when it overflows. The HTCI cannot be generated when the HTC is in the melody mode
or disabled.
* This specification are subject to be changed without notice.
12.29.1999 19