I am failing to set MSP430 to it's maximum speed of 16MHz
I am only getting 1.3MHz. I use CCS and the following code. As you see in the comments I have already tried a lot:
#include <msp430.h>
int main(void) {
WDTCTL = WDTPW | WDTHOLD;
// Stop watchdog timer
BCSCTL1 = CALBC1_16MHZ;
// Set range
//DCOCTL = 0x00; // Set DCO step and modulation
//BCSCTL2 =0;
DCOCTL = CALDCO_16MHZ;
// Set DCO step and modulation
// raising SMCLK freq to abou 10Mhz
//BCSCTL1 = RSEL3 + RSEL2 + RSEL1 + RSEL0;
//DCOCTL = DCO0 + DCO1 + DCO2;
// BCSCTL1 = 0xFF; // RSEL3 + RSEL2 + RSEL1 + RSEL0;
//DCOCTL = DCO0 + DCO1 + DCO2;
//CSCTL1 |= (DCORSEL|DCOFSEL0); // select 20 MHz
//CSCTL3 &= ~(DIVM0|DIVM1|DIVM2|DIVS0); // divider
P1DIR |= (BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5);
P2DIR |= (BIT0 + BIT3);
P1OUT &= ~(BIT0 + BIT1 + BIT2 + BIT3 + BIT4 + BIT5);
while(1){
P1OUT ^= BIT5; // I can't get a higher pin oscillation than 1.3MHz on the oscilloscope ; I expected around 8 MHz for one cycle on, one cycle off , am I wrong?
}
return 0;
}