James Cameron wrote 2014-07-22 08:20: >> T1CON =3D 0x31; > > This is where you have set the prescaler, though it is not obvious > that you have done so, because it is hiding in the register. Another > way to put it would be: > > T1GINC =3D 0; > TMR1GE =3D 0; > T1CKPS1 =3D 1; > T1CKPS0 =3D 1; > T1OSCEN =3D 0; > T1SYNC =3D 0; > TMR1CS =3D 0; > TMR1ON =3D 1; > Note that XC8 also has definitions in the device header files for "multiple bit fields" (like the prescaler in the case of T1CON) in control registers. The above can also be written: T1CONbits.T1GINC =3D 0; T1CONbits.TMR1GE =3D 0; T1CONbits.T1CKPS =3D 0b11; T1CONbits.T1OSCEN =3D 0; T1CONbits.T1SYNC =3D 0; T1CONbits.TMR1CS =3D 0; T1CONbits.TMR1ON =3D 1; Now, the multipble bit fields needs the "T1CONbits." and I added them for all above for clearity. This makes of course a bigger difference where there are longer and/or more of these fields like in this example (from a 16F1938): OSCCONbits.IRCF =3D 0b1110; OSCCONbits.SCS =3D 0b00; Instead of: OSCCONbits.IRCF0 =3D 0; OSCCONbits.IRCF1 =3D 1; OSCCONbits.IRCF2 =3D 1; OSCCONbits.IRCF3 =3D 1; OSCCONbits.SCS0 =3D 0; OSCCONbits.SCS1 =3D 0; Jan-Erik. --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .