On 23/07/2014 12:20 PM, James Cameron wrote: > On Tue, Jul 22, 2014 at 12:20:10PM +0200, Jan-Erik Soderholm wrote: >> 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; > 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; > BTW, You can use CTRL+Space to show you the possible options after=20 typing up to the decimal point. David... --=20 ___________________________________________ David Duffy Audio Visual Devices P/L Unit 8, 10 Hook St, Capalaba 4157 Australia Ph: +61 7 38235717 Fax: +61 7 38234717 Our Web Site: www.audiovisualdevices.com.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 .