liegt das an MPLAB?
Ja (und auch am PIC selbst). TMR1H ist nicht das tatsächliche High-Byte des Timers, sondern nur ein Buffer-Register (wenn RD16 im T1CON Register gesetzt ist). Es dient dazu, den 16-Bit Wert des Timers gleichzeitig in einem Befehlszyklus auszulesen. TMR1H wird nur dann aktualisiert, wenn TMR1L im Code ausgelesen wird.
x = TMR1L; // kopiert gleichzeitig das High-Byte des Timers in TMR1H
y = TMR1H; // TMR1H enthält den Zählerstand zum Zeitpunkt des Auslesens von TMR1L
13.2 Timer1 16-bit Read/Write Mode
Timer1 can be configured for 16-bit reads and writes (see Figure 13-2). When the RD16 control bit (T1CON<7>) is set, the address for TMR1H is mapped to a buffer register for the high byte of Timer1. A read from TMR1L will load the contents of the high byte of Timer1 into the Timer1 high byte buffer. This provides the user with the ability to accurately read all 16 bits of Timer1 without having to determine whether a read of the high byte, followed by a read of the low byte, has become invalid due to a rollover between reads.
A write to the high byte of Timer1 must also take place through the TMR1H Buffer register. The Timer1 high byte is updated with the contents of TMR1H when a write occurs to TMR1L. This allows a user to write all 16 bits to both the high and low bytes of Timer1 at once.
The high byte of Timer1 is not directly readable or writable in this mode. All reads and writes must take place through the Timer1 High Byte Buffer register. Writes to TMR1H do not clear the Timer1 prescaler. The prescaler is only cleared on writes to TMR1L.
Viele Grüße
Bernd