Hi,
I was using external osc so timer was proper for 100ms and 1 sec delays.
now i changed to internal osc smclk . Timer looks not proper (slow) . how to calculate values for timer (smclk) ?
Thanks,
Akila.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Akila,
how did you initialize your DCO? When you do not set it to anything specific, it runs with roughly 1MHz, but the processor has four calibrated frequency settings in the info A memory. These are 1MHz, 8MHz, 12MHz and 16MHz. You set them by writing
BCSCTL1 = CALBC1_1MHZ; // CALBC1_8MHZ or CALBC1_12MHZ or CALBC1_16MHZ DCOCTL = CALDCO_1MHZ; // CALDCO_8MHZ or CALDCO_12MHZ or CALDCO_16MHZ
You can check the frequency by outputting it to pin 1.4 (SMCLK) when selecting the special function by writing
P1SEL |= 0x10; P1DIR |= 0x10;
When set to one of these known frequencies, you can easily calculate your 100ms timer value.
Dennis
**Attention** This is a public forum