Hi all,
Recently in uni we are messing with the MSP430 Launchpad from TI, when setting registers there,
we look up the registers in the included header file, setting the individual bits was quite intuitive.
Say I wanted to set Bits TASSEL1 and MC0 of the TA0CTL register I could just write
TA0CTL |= MC0 + TASSEL1;
I want to try do the same with a PIC micro, but it's header file is different, can anyone show what the syntax is for setting individual and multiple bits in here..?
The way I found was like this, if i wanted to set a couple bits in this OSCCON register, this seems to work.
OSCCONbits.SCS1 = 1;
OSCCONbits.IRCF1 = 1;
OSCCONbits.IRCF2 = 1;
OSCCONbits.IRCF3 = 1;
OSCCONbits.SPLLEN = 1;
But surely there is a way similar to the MSP430 one.
Also, what does the _t at the end mean? OSCCONbits_t. SCS1 = 1; seems to not work.
Any advice is appreciated, I can insert more of the header file if its needed.
Recently in uni we are messing with the MSP430 Launchpad from TI, when setting registers there,
we look up the registers in the included header file, setting the individual bits was quite intuitive.
Say I wanted to set Bits TASSEL1 and MC0 of the TA0CTL register I could just write
TA0CTL |= MC0 + TASSEL1;

I want to try do the same with a PIC micro, but it's header file is different, can anyone show what the syntax is for setting individual and multiple bits in here..?
The way I found was like this, if i wanted to set a couple bits in this OSCCON register, this seems to work.
OSCCONbits.SCS1 = 1;
OSCCONbits.IRCF1 = 1;
OSCCONbits.IRCF2 = 1;
OSCCONbits.IRCF3 = 1;
OSCCONbits.SPLLEN = 1;
But surely there is a way similar to the MSP430 one.
Also, what does the _t at the end mean? OSCCONbits_t. SCS1 = 1; seems to not work.

Any advice is appreciated, I can insert more of the header file if its needed.