9.2.21 READTIMERx Macros

A macro that reads the timer peripheral.

Include

<xc.h>

Prototype

unsigned short READTIMERx(void);

Return Value

The value of the relevant TMR register.

Remarks

The READTIMERx() macro is available for PIC18 projects and returns the value held by the TMRx register, where x is one of the digits 0, 1 or 3.

Example

#include <xc.h>

int main(void)
{
  while(READTIMER0() != 0xFF)
    continue;
}