SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By SSK
#65574
Hello forum members,

I am using MSP430F2418 with CrossStudio. I am outputting all the three clocks - MCLK, SMCLK and ACLK. When I use DCO, I am able to output MCLK and SMCLK as ACLK is not available for DCO. But when I use external XTAL (LFXT1), I am able to output only MCLK and ACLK. There is no output on SMCLK pin. Has anyone experienced this issue with SMCLK? Here I am giving the code used, please suggest the modifications in this if any for SMCLK.

__SelectCrystalOsc proc
BIC #OSCOFF+SCG1+SCG0+CPUOFF,SR // Turn on osc.
BIS.B #XTS+DIVA_1+XT2OFF,BCSCTL1 //ACLK Divide by 2
BIC.B #LFXT1S1,&BCSCTL3
BIS.B #LFXT1S0,&BCSCTL3
BIC.B #XCAP1+XCAP0,&BCSCTL3
L1 BIC.B #OFIFG,&IFG1 // Clear OFIFG
MOV #0FFh,R15 // Delay
L2 DEC R15
JNZ L2
BIT.B #OFIFG,&IFG1 // Re?test OFIFG
JNZ L1 // Repeat test if needed
BIS.B #SELM1+SELM0,&BCSCTL2 // Select LFXT1CLK for MCLK
BIS.B #DIVM_2,&BCSCTL2 // Mclk divide by 4
BIS.B #SELS,&BCSCTL2 // Select LFXT1CLK for SMCLK
BIS.B #DIVS_3,&BCSCTL2 // SMClk divide by 8
ret
endproc

Thanks in advance.