EasyManua.ls Logo

Intel 386

Intel 386
691 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Intel386™ EX EMBEDDED PROCESSOR USERS MANUAL
10-38
Returns:
Counter Value of specified timer
Assumptions:
This function assumes that the R/W format is configured to be LSB
first, then MSB
Syntax:
WORD Counter_Value;
Counter_Value = CounterLatch(TMR_1);
Real/Protected Mode:
No changes required
*****************************************************************************/
WORD CounterLatch( BYTE Timer )
{
BYTE control_word = 0;
BYTE CounterL, CounterH;
WORD Counter;
control_word = Timer << 6;
control_word &= 0xc0;
_SetEXRegByte(TMRCON, control_word); //Select which counter
switch (Timer) {
case TMR_0:
CounterL = _GetEXRegByte(TMR0);
CounterH = _GetEXRegByte(TMR0);
break;
case TMR_1:
CounterL = _GetEXRegByte(TMR1);
CounterH = _GetEXRegByte(TMR1);
break;
case TMR_2:
CounterL = _GetEXRegByte(TMR2);
CounterH = _GetEXRegByte(TMR2);
break;
}
Counter = (((WORD)CounterH << 8) + CounterL);
return(Counter);
}/* CounterLatch */

Table of Contents

Related product manuals