Intel 386 User Manual page 279

Embedded microprocessor
Table of Contents

Advertisement

Intel386™ EX EMBEDDED PROCESSOR USER'S MANUAL
if(!Enable)
TmpByte |= 0x80;
TmpByte |= (Inputs << (Unit*2));
_SetEXRegByte(TMRCFG,TmpByte);
/* Set Timer Control Register */
TmpByte = Unit << 6;
TmpByte |= (0x30 | Mode);
_SetEXRegByte(TMRCON,TmpByte);
/* Set Initial Counter Value */
TmpByte = HIBYTE(InitCount);
_SetEXRegByte(TmrCntPort, LOBYTE(InitCount));
_SetEXRegByte(TmrCntPort, TmpByte);
return E_OK;
}/* InitTimer */
/*****************************************************************************
SetUp_ReadBack:
Description:
This routine configures the Control Word for a Read Back Command.
After calling this function, the latched status and counter values
can be read from the TMRn registers. Example code of how to do
this for Timer2 is included after this function.
Parameters:
Timer0
Timer1
Timer2
GetStatus
GetCount
Returns:
None
Assumptions:
No assumptions have been made for this set-up function. However, if
a user were to latch only the counter value, the configured R/W
Format would have to be known. The setting of the R/W format can be
read from the Status Byte if this value is latched. An example of
this is included after the SetUp_ReadBack function.
Syntax:
#define ENABLE
10-36
// Set counter select
// Set R/W low then high byte and Mode bits
Cleared if Timer0's values are not to be latched
Cleared if Timer1's values are not to be latched
Cleared if Timer2's values are not to be latched
Cleared if Status Byte is not to be latched
Cleared if Count Byte(s) is not to be latched
1
// Set Timer Disable Bit
// Set CKnCON and GTnCON bits

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Intel386 exIntel386 extbIntel386 extc

Table of Contents