On Tue, Jul 22, 2014 at 12:20:10PM +0200, Jan-Erik Soderholm wrote: > James Cameron wrote 2014-07-22 08:20: >=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; > > >=20 > 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: >=20 > 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; Yes, I guessed that both were possible, and for multiple bit fields there is some advantage, but apart from that is there any other reason for using the longer form over the shorter form? Is there a form where this can be written: T1CKPS =3D 0b11; --=20 James Cameron http://quozl.linux.org.au/ --=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 .