> But OSCCON is a union, isn?t it? Shouldn?t that mean I can address its > structured bits? Or am I reading this part of the header file wrong? >=20 >=20 > ? > extern volatile unsigned int OSCCON __attribute__((__sfr__)); > __extension__ typedef struct tagOSCCONBITS { union { struct { > unsigned OSWEN:1; unsigned LPOSCEN:1; unsigned :1; unsigned CF:1; > unsigned :1; unsigned LOCK:1; unsigned IOLOCK:1; unsigned CLKLOCK:1; > unsigned NOSC:3; unsigned :1; unsigned COSC:3; }; struct { > unsigned :8; unsigned NOSC0:1; unsigned NOSC1:1; unsigned NOSC2:1; > unsigned :1; unsigned COSC0:1; unsigned COSC1:1; unsigned COSC2:1; > }; }; } OSCCONBITS; ? >=20 >=20 >=20 > It is always a good idea to look at the appropriate header file. >=20 > In most cases, what you want is something like >=20 > OSCCONbits.OSWEN =3D 1; >=20 > The symbol OSCCON itself refers to the entire register. If it were a > struct you wouldn' tbe able to say things like >=20 > OSCCON =3D 0x1234; >=20 > so the struct has a different name. Almost always the register name > followed by "bits". OSCCON itself isn't a union, OSCCONbits is a union to get at the individual= bit fields. Just like the PORT, LAT, and TRIS (and many other) registers i= t can be referred to either way - the complete register or the individual b= its. But looking at the bit you quoted, you probably need to refer to it as= OSCCONBITS.bit (not the capitals change). --=20 Scanned by iCritical. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .