PIC C compiler config bits set/reset option dspic30f4011
Posted: Mon Apr 30, 2018 3:10 pm
I am using PIC C compiler. I am using a dspic30f4011 Microcontroller.
I want to ask if I could set/reset configuration bits of a specific module/function register??? or I am bound to use predefined functions in PIC C??
T1CONbits.TON = 0; // Turn off timer 1
T1CONbits.TSIDL = 0; // Continue operation during sleep
T1CONbits.TGATE = 0; // Gated timer accumulation disabled
T1CONbits.TCS = 0; // use Tcy as source clock
T1CONbits.TCKPS = 0; // Tcy / 1 as input clock
Can I do this in PIC C????
Joined: 24 Jun 2004 Posts: 1555 Location: Edmonton, Alberta
Posted: Mon Apr 30, 2018 6:15 pm
Unless the PIC is relatively new, the compiler features built-in functions that do this sort of thing for you. In your example,
I want to ask if I could set/reset configuration bits of a specific module/function register ?
The answer is yes, if want to, you can do it that way.
The IDE version of the CCS compiler can generate a header file like this:
I assume you want this because you're translating code to CCS from
another compiler, and it sets the bits to configure peripherals.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum