3. CPU running on crystal (32768Hz) and DCO clock:
The slowest frequency we can run the DCO at is about 1MHz (which is also the default speed).
Therefore, we will start by switching the MCLK to the DCO. In most systems, you will want ACLK to run on the VLO or 32768 Hz crystal.
Since ACLK in our current code is running on the crystal, we will turn on the DCO calculation.
#include
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
turn off watchdog timer
if (CALBC1_1MHZ == 0xFF || CALDCO_1MHZ == 0xFF)
{
while(1);
suspend
}
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
set DCO mode
P1DIR = 0x41;
and P1.6 configure output
P1OUT = 0x01;
turn on
BCSCTL3 |= LFXT1S_0;
while(IFG1 & OFIFG)
{
IFG1 &= ~OFIFG;
clear OSCFault flag
_delay_cycles(100000);
delay for visible flag
}
P1OUT = 0;
turn off
// __bis_SR_register(SCG1 + SCG0); turn off DCO
BCSCTL2 |= SELM_0 + DIVM_3;
while(1)
{
P1OUT = 0x40;
turn
on_delay_cycles(100);
P1OUT = 0;
turn
off_delay_cycles(5000);
}
}
Keywords:MSP430
Reference address:MSP430 Clock Settings (Part 4)
The slowest frequency we can run the DCO at is about 1MHz (which is also the default speed).
Therefore, we will start by switching the MCLK to the DCO. In most systems, you will want ACLK to run on the VLO or 32768 Hz crystal.
Since ACLK in our current code is running on the crystal, we will turn on the DCO calculation.
#include
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
turn off watchdog timer
if (CALBC1_1MHZ == 0xFF || CALDCO_1MHZ == 0xFF)
{
while(1);
suspend
}
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
set DCO mode
P1DIR = 0x41;
and P1.6 configure output
P1OUT = 0x01;
turn on
BCSCTL3 |= LFXT1S_0;
while(IFG1 & OFIFG)
{
IFG1 &= ~OFIFG;
clear OSCFault flag
_delay_cycles(100000);
delay for visible flag
}
P1OUT = 0;
turn off
// __bis_SR_register(SCG1 + SCG0); turn off DCO
BCSCTL2 |= SELM_0 + DIVM_3;
while(1)
{
P1OUT = 0x40;
turn
on_delay_cycles(100);
P1OUT = 0;
turn
off_delay_cycles(5000);
}
}
Previous article:MSP430 Clock Settings (V)
Next article:MSP430 Clock Settings (Part 3)
Recommended ReadingLatest update time:2024-11-16 15:01
MSP430 Tutorial 14: MSP430 MCU ADC12 Module
MSP430 analog-to-digital conversion module--ADC12
The ADC12 module of the MSP430 microcontroller is a 12-bit precision A/D conversion module, which has the characteristics of high speed and versatility. Most of them have built-in ADC modules. Some chips without ADC modules can also use the built-in analog comparator t
[Microcontroller]
A wireless charging circuit design using MSP430F2274
The MSP430F2274 ultra-low power microcontroller is used as the monitoring and control core of the wireless energy transfer charger. The charging speed is selected by the switch to realize the functions of fast charging and normal charging. When the power is full, a full prompt is given and charging is automatically
[Power Management]
MSP430G2553 WDT watchdog mode example
#include "io430.h" int main( void ) { int i; // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; P1DIR |= BIT0; P1OUT &= ~BIT0; // dark for(i=0;i 16000;i++); P1OUT |= BIT0; //on WDTCTL = WDT_ARST_1000; //Start the watchdog timer for 1000ms while(1) { for(i=0;i 100
[Microcontroller]
About the read and write operation method of MSP430-Flash exceeding 64K
About the read and write operation method of MSP430-Flash exceeding 64K #include "msp430xG46x.h" void WriteFlashErrorNum(void); //---------------------------------------------------------------------- //Function: Read data from flash, just need to give the first address and the number of data to be retrieved
[Microcontroller]
MSP430F5529 (I) General I/O port settings-1
I am a beginner. If there are any mistakes or inappropriate places, please correct me. Let's learn together.
I recommend a good place: TI's official MSP430 exchange community http://www.deyisupport.com/question_answer/microcontrollers/msp430/f/55.aspx
. Registration is required. Ask questions here and TI's engineers
[Microcontroller]
Implementation of wireless sensor network based on MSP430F149 and Si4432
The application field of wireless sensor network is very wide. Wireless sensor nodes are generally powered by batteries, with simple hardware structure, small communication bandwidth, and short point-to-point communication distance. Therefore, limited working time and short communication distance become two major bo
[Industrial Control]
MSP430 learning notes 7-4*4 keyboard corresponding digital tube display
This routine is also a classic routine on the development board. I modified the framework of the program to make it more suitable for future calls. The specific 4*4 keyboard scanning principle is relatively basic and will not be repeated here. Here I think it is more important to develop a good habit of writing progra
[Microcontroller]
Methods to improve the flash erase and write life of MSP430G series microcontrollers
1. Comparison of the main features of embedded Flash storage media and EEPROM
Electrically Erasable and Programmable Read-Only Memory (EEPROM) is a key device used in most embedded applications to store non-volatile data. It is used to save data during program execution. Flash Memory (Flash for short) is a
[Microcontroller]
- Popular Resources
- Popular amplifiers
- MSP430 series single chip microcomputer system engineering design and practice
- oled multi-chip calling program
- Microcontroller Principles and Applications Tutorial (2nd Edition) (Zhang Yuanliang)
- Getting Started and Improving MSP430 Microcontrollers - National Undergraduate Electronic Design Competition Training Course
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- Four-axis source code
- [Help] Hardware IIC slave problem of stm8s103f3p6
- The conducted spurious signals of the RF with shielding cover are 5-6dB worse than those without shielding cover.
- EEWORLD University Hall----Shijian KOL: Who protects the source of life--ADuCM355 one test five!
- How to configure EPI mode on TI microcontroller?
- The reverse connection protection circuit will also be turned on. Please help me see
- Is there anyone who is good at inverter power supply?
- EEWORLD University Hall----Live Replay: ADI - Noise Generation in Switching Power Supplies and How to Reduce Power Supply Noise
- Battery power collection
- How to set up PCB routing like this?