Dear Sirs,
I'm trying to start with VLO as a source for MCLK. I wrote the code for LaunchPad:
#include "io430.h"
int main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P1DIR = 0x40; // P1.6 output (green LED)
P1OUT = 0; // LED off
BCSCTL3 |= LFXT1S_2; // LFXT1 = VLO
IFG1 &= ~OFIFG; // Clear OSCFault flag
__bis_SR_register(SCG1 + SCG0); // Stop DCO
BCSCTL2 |= SELM_3 + DIVM_0; // MCLK = VLO
asm("bic.b #040h,&P1OUT");
asm("bis.b #040h,&P1OUT");
asm("bic.b #040h,&P1OUT");
asm("bis.b #040h,&P1OUT");
asm("bic.b #040h,&P1OUT");
asm("bis.b #040h,&P1OUT");
asm("bic.b #040h,&P1OUT");
asm("bis.b #040h,&P1OUT");
return 0;
}
The series of asm directives is used to produce 4 square waveforms on P1.6 (LED is connected there in LaunchPad).
As each instruction's execution lasts (as I hope :) ) 1 cycle = 1/F_MCLK = 1/F_VLO, period of waveform on P1.6 will be 2*cycle. [UPDATED: It looks to be wrong. MOV command for immediate addressed source and absolute addressed destination should use 5-1=4 cycles, according to p.150 of slau144i.pdf : MOV #N,&EDE , see note 1. Nevertheless, please explain me the correct way of measuring VLO frequency] For a typical value of VLO frequency near 12kHz, it should be around 6kHz waveform.
But my oscilloscope shows 4 periods 906uS length each. Also my frequency meter shows me around 1kHz.
So it looks like my VLO operates at frequency about 2kHz. %