2-4 A 8-bit 16-bit timer, a peripheral initial
/* A port 0 is set as TM0IO (input). */
TM0BR = TM0_COUNT4; /* cycles/min ratio setup */
data |= TM0MD_LOAD1;
TM0MD = data; /* count source setup input TMIN0*/
data |= TM0MD_START1;
TM0MD = data; /* initialize timer LDE=1 */
data &= ~TM0MD_START1;
TM0MD = data; /* Timer start LDE=0 */
data |= TM0MD_ENABLE1;
TM0MD = data; /* Timer permission CNE=1 */
}
The sample of a 8-bit timer is recorded on attached CD-ROM.
Inclusion directory:program\initial\timecounter\timer8\
program :timer8evt.c
2-39