in sdcc/non-free/include/pic16/pic18f14k22.h TMR3 is 8 bit sfr, same as TMR3L
...
extern at(0x0FB2) sfr TMR3;
extern at(0x0FB2) sfr TMR3L;
...
but TMR3 is 16 bit timer/counter
may be in this header should be
extern __at(0x0FB2) volatile unsigned short int TMR3;
?
same problem in all other 16bit timers/counters in pic16 headers
The SDCC not able to deal well with the timer registers. This it is because the reading and writing of two half-register work well in a different order. Example:
read:
write:
See: PIC18(L)F1XK22 Data Sheet page 110
Molnár Károly