Having a great deal of trouble with the clock on msp430fr5968. I have a 4MHz ceramic resonator which is oscillating on frequency.
However, when I set a timer for 4000 cycles, I end up with an interrupt about every 840 us. Also, the uart, set for 57.6k, seems to operate about 75k. I have done something wrong in the clock setup is my conclusion. I just can’t spot it.
Port J set up is:
PJSEL0 = 0xCF; // BITS 4 & 5 ARE IO are I/O
PJSEL1 = 0x00;
PJDIR = 0x00; // all outputs (not used)
PJOUT = 0x00; // initial output state all low
Followed by the clock setup which is:
//CLOCK
CSCTL0 = 0xA500; //set password to change clock registers
CSCTL4 = 0xC009; //HF ON, HIGH DRIVE, OTHE OSCS OFF
CSCTL2 = 0x0055; //HF USED FOR ALL CLOCKS
CSCTL3 = 0x0000; //DIV BY 1 ON ALL CLOCKS
int m = 0; //wait for clock to stabilize
while (m < 1000)
{
m++;
}
CSCTL5 &= ~HFXTOFFG; // RESET FAULTS
I’ve got to be doing something really dumb but I can’t find it – so any and all help will be greatly appreciated!!!
Bob Scott
214.673.1439