Hi
I have very basic questions on clocks and crystals.
1. Iam using MSP430FG4618 controller.For a particular application ihave to give delay of 30usec.The default crystal connected to the controller is 32KHz. But I have a 12MHz crystal which I want to connect externally at XT2. Ihave connect and used the following piece of code for configuring that.
WDTCTL=WDTPW+WDTHOLD;
_BIS_SR(0x0000);
FLL_CTL0=0xB0;
FLL_CTL1=0x14;
P1DIR=0xFF;
P1SEL=0x10; // To take SMCLK out.
while(1);
When i run this code i could see 12MHz frequency in oscilloscope at SMCLK pin. But when i remove the wjhile loop i dont see anything. Are there aby other registers missing or do I have to add any delay loop? Please guide me. And is there any way i can use this as main clock system I mean the code execution time is in such a way that it depends on the external crystal frequency.
2. Of three clocks, SMCLK and ACLK is used as clock sign als for timers and MCLK is used by CPU and system. Does it mean that MCLK is the default clock using which instructions run, I mean if we toggle a pin using "for" loop, the time for the pin toggling depends on MCLK. If so how can i configure MCLK with XT2 for toggling pins using for loop.
Please guide me and if possible please share me some sample codes if u have any.