Other Parts Discussed in Thread: MSP430F5508
Hello to all,
i am facing a weird problem. I have build a can interface box with an MSP430F5508. As the external CAN-Controller supplies a 16 MHz clock signal, i decided to connect this clock signal to XT2IN and feed MCLK and SMCLK from it. This is what i have done so far:
P5SEL |= 4; // P5.2 (XT2IN), select alternative function XT2 for P52 and P5.3
P5DIR &= ~4; // may not be necessary
SetVCore(PMMCOREV_2); // core voltage has to be adjusted to run at 16 MHz
UCSCTL6 |= XT2BYPASS; // XT2BYPASS = 1 and XT2OFF select external clock on input pin
UCSCTL4 = SELA__XT2CLK|SELS__XT2CLK|SELM__XT2CLK;
UCSCTL5 = DIVA_0|DIVS_0|DIVM_0;
To make it switch over to the right clock source, i had to:
UCSCTL7 &= ~XT2OFFG;
SFRIFG1 &= ~OFIFG;
Why do i have to clear the bit in SFRIFG1?
cheers
Gunther