I assume this is an 8 bit part, I haven't seen quite so much redundancy on the 16/32 bit parts. My guess is that it has to do with compatibility with other compilers. Microchip has had relationships with a number of compiler vendors over the years, tho they now seem to have settled on an 8 bit standard. The 16/32 bit compilers have always been gcc, so you don't see all that history. Sometimes compiler and assembler developers have a "better idea" and feel like they can somehow improve things by, for example, calling .TRISA7 .RA7 instead. Since Microchip supported a number of these compilers over the years, I suspect they feel obligated to make an attempt at retaining some degree of source compatibility. Just my guess --McD On Mon, 2015-04-20 at 13:59 -0400, Nathan House wrote: > Hi, >=20 > The main.pre file in my MPLAB X project seems to show the definitions for > the configuration registers. One example is this: >=20 > typedef union { > struct { > unsigned TRISA0 :1; > unsigned TRISA1 :1; > unsigned TRISA2 :1; > unsigned TRISA3 :1; > unsigned TRISA4 :1; > unsigned TRISA5 :1; > unsigned TRISA6 :1; > unsigned TRISA7 :1; > }; > struct { > unsigned RA0 :1; > unsigned RA1 :1; > unsigned RA2 :1; > unsigned RA3 :1; > unsigned RA4 :1; > unsigned RA5 :1; > unsigned RA6 :1; > unsigned RA7 :1; > }; > } TRISAbits_t; > extern volatile TRISAbits_t TRISAbits @ 0xF92; >=20 > What is the point of making the same bits accessible through more than on= e > name? >=20 > I.e. the following lines of code are identical, correct? >=20 > TRISAbits.RA0 =3D 1; > TRISAbits.TRISA0 =3D 1; >=20 > The LATAbits definition is even more convoluted: >=20 > typedef union { > struct { > unsigned LATA0 :1; > unsigned LATA1 :1; > unsigned LATA2 :1; > unsigned LATA3 :1; > unsigned LATA4 :1; > unsigned LATA5 :1; > unsigned LATA6 :1; > unsigned LATA7 :1; > }; > struct { > unsigned LA0 :1; > }; > struct { > unsigned :1; > unsigned LA1 :1; > }; > struct { > unsigned :2; > unsigned LA2 :1; > }; > struct { > unsigned :3; > unsigned LA3 :1; > }; > struct { > unsigned :4; > unsigned LA4 :1; > }; > struct { > unsigned :5; > unsigned LA5 :1; > }; > struct { > unsigned :6; > unsigned LA6 :1; > }; > struct { > unsigned :7; > unsigned LA7 :1; > }; > } LATAbits_t; > extern volatile LATAbits_t LATAbits @ 0xF89; >=20 > I don't know why they union'd a separate struct for each of the bits > instead of putting them all in one struct like with TRISAbits, but the sa= me > question applies to this as well. >=20 > What's the point of all that redundancy? >=20 > Thanks, >=20 > Nate >=20 > ----- >=20 > I'm a college student, take it easy on me ;-) >=20 > Check out my small hobby electronics business! > www.foxytronics.com --=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 .