Other Parts Discussed in Thread: MSP430FR5969
Hi folks,
Using the new CCSv6 release edition, I'm trying a Wolverine test program I wrote during the Beta phase.
It no longer compiles, as it can't find the various SFRs (e.g. P4OUT). My program uses:
#include <msp430.h>
up top, which worked before. Now I have to use #include <msp430fr5969.h> for it to compile correctly.
I'm puzzled how/why, because according to the CDT build console, CCS is using -D__MSP430FR969__ in the build command and msp430.h checks for that define before including msp430fr5969.h on its own. Can't figure out why that's not working right...
Judging by the fact that it does compile with "#include <msp430fr5969.h>" I have to assume it has its search pattern correct for the include files.
This is CCSv6 on Windows 7 (32-bit) FYI.
Code:
/*
* main.c
*/
#include <msp430.h>
int main(void) {
WDTCTL = WDTPW | WDTHOLD;
// GPIO Setup
P1OUT = 0;
P1DIR = 0xFF;
P2OUT = 0;
P2DIR = 0xFF;
P3OUT = 0;
P3DIR = 0xFF;
P4OUT = 0;
P4DIR = 0xFF;
PJOUT = 0;
PJSEL0 = BIT4 | BIT5; // For XT1
PJDIR = 0xFFFF;
// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
// Clock System Setup
CSCTL0_H = CSKEY >> 8; // Unlock CS registers
CSCTL1 = DCOFSEL_6; // Set DCO to 8MHz
CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers
CSCTL4 &= ~LFXTOFF; // Enable LFXT1
do
{
CSCTL5 &= ~LFXTOFFG; // Clear XT1 fault flag
SFRIFG1 &= ~OFIFG;
} while (SFRIFG1&OFIFG); // Test oscillator fault flag
CSCTL0_H = 0; // Lock CS registers
WDTCTL = WDT_ADLY_16;
SFRIE1 |= WDTIE;
_EINT();
while (1) {
__delay_cycles(4000000);
}
return 0;
}
void __attribute__((interrupt(WDT_VECTOR))) wdtisr()
{
P4OUT ^= BIT6;
__bic_SR_register_on_exit(LPM3_bits);
}