9.2.24 WRITETIMER Macros

A macro that writes the timer peripheral.

Include

<xc.h>

Prototype

void WRITETIMERx(int n);

Remarks

The WRITETIMERx() macro is available for PIC18 projects and writes the 2-byte argument to both bytes of the TMRx register, where x is one of the digits 0, 1 or 3. It ensures that the registers are written in the correct order, which cannot be guaranteed when accessing the entire TMR SFR directly.

Example

#include <xc.h>

int main(void)
{
  WRITETIMER0(0x4A);
}