3732 views|1 replies

3836

Posts

19

Resources
The OP
 

MSP430 default MCLK, SMCLK, ACLK clock frequency [Copy link]

Use the timer interrupt method to measure the frequency of each clock. The platform used in the experiment is MSP-EXP430G2 LaunchPad, and the MCU is MSP430G2553.
1. Check the datasheet.
  Original manual: After a PUC, MCLK and SMCLK are sourced from DCOCLK at ~1.1Mhz (see the device-specific data sheet for parameters) and ACLK is sourced from LFXT1CLK in LF mode with an internal load capacitance of 6pF.
  From the above, it is not difficult to find that the main clock MCLK and the sub-clock SMLK are generated by the internal digital control oscillator DCO, which is about 1.1MHz. It should be stated that the internal digital control oscillator is greatly affected by the power supply voltage and external temperature, ranging from 800kHz to 1.5MHz. At room temperature, the DCO frequency is measured at 3.5V to be 1.04Mhz. The auxiliary clock ACLK is generated by an external low-frequency crystal oscillator, generally 32.768kHz.


2. Determine by register default settings
Write the picture description here
  From the above picture, we can see that the initial values of these registers are not all 0, so we can check the corresponding meaning of the registers to determine the default values of each clock.


2.1. Determine DCO first.
  Write the picture description here.
Write the picture description here.
  From the above, we get RSELx = 7, DCOx = 3, MODx = 0, and then check the table below:

  From the table above, we get the default value of DCO around 1Mhz, which is consistent with what was said before, ranging from 800kHz to 1.5MHz.
2.2. Main clock MCLK, sub-clock SMCLK

  It is easy to find that the clock sources of MCLK and SMCLK are both from DCO and the frequency division coefficient is 1, so the default clock frequency of MCLK and SMCLK is DCO, which is about 1MHz.
  Similarly, the auxiliary clock ACLK can also be found by checking the manual that its clock source comes from an external low-frequency crystal oscillator, which is generally 32.768kHz. Moreover, the default clock source of most auxiliary clocks of the 430 series microcontrollers comes from an external low-frequency crystal oscillator.
3. Timer method
  You can also use the following code for verification, such as verifying ACLK.

#include <msp430g2553.h>

void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= BIT0;
P1OUT |= BIT0;
/* Clock source ACLK clear counter increment mode to enable timer A interrupt */
TACTL |= TASSEL_1 + TACLR + MC_1 + TAIE;
TACCR0 = 1024; //Frequency: 32768/1024/2=16Hz
_EINT(); //Open total interrupt

while(1)
{
LPM3; //Enter low power mode 3
}
}
#pragma vector = TIMER0_A1_VECTOR
__interrupt void Timer_A(void)
{
switch(TAIV)
{
case 2: break;
case 4: break;
case 10: P1OUT ^= BIT0; //Interrupt task
break;
}
}

  Compile and load the above code into the g2553 development board, and you can see the red LED flashing. After measuring the P1.0 port with an oscilloscope, we found that its frequency is 15.98Hz. From this, we can infer that the auxiliary clock used by timer A is indeed an external low-frequency crystal oscillator 32.768kHz.
Summary:
  Above, we introduced three methods to determine the default clock frequencies of the three clocks of the G2553 system. We try to practice the third method as much as possible, and we can see the clock frequency value of the system very intuitively.

This post is from Microcontroller MCU

Latest reply

Very good, the lecture is very high, the value is very high, I gained a lot   Details Published on 2020-9-19 11:16
 

77

Posts

0

Resources
2
 

Very good, the lecture is very high, the value is very high, I gained a lot

This post is from Microcontroller MCU
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list