MSP430 MCU controls IO port operation - LED flashes

Publisher:梦幻之光Latest update time:2017-01-03 Source: eefocusKeywords:MSP430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

//*******************************************************************************
// D13x Demo - Change the system clock based on the previous section and observe the blinking frequency of the LED light
//
// Description: Change the blinking frequency by changing the system clock; invert P1.5 through P1 XOR; software loop delay
// ACLK= n/a, MCLK= SMCLK= default DCO ~ 800k
//
// MSP430F13x
// -----------------
// /|\| XIN|- 
// | | |
// --|RST XOUT|-
// | |
// | P1.5|-->LED
//
//
// Hardware circuit: MSP430F135 core experiment board-I type
// Hardware connection: 
//
// Debugger: MSP430FET full series JTAG emulator
// Debug software: IAR Embedded Workbench Version: 3.41A Compile
//*******************************************************************************

#include

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog

P1DIR |= 0x20; // Set P1.5 as the output port

// BCSCTL1= 0x80; // Select the frequency division resistor to be 0 (the flashing frequency is slower at this time)
// BCSCTL1= 0x87; // Select the frequency division resistor to be 7 (the flashing frequency is faster at this time)

// BCSCTL2= 0xc0; // Select an external 32768 low-frequency crystal oscillator as MCLK (the flashing frequency is extremely slow at this time)
// BCSCTL2= 0x10; // Select an external 8M high-frequency crystal oscillator as MCLK (the flashing frequency is faster at this time)

for (;;) 
{
unsigned int i;
i = 50000; // Loop
do i--; while (i);
P1OUT ^= 0x20; // Invert P1.5 by XOR
}
}


Keywords:MSP430 Reference address:MSP430 MCU controls IO port operation - LED flashes

Previous article:MSP430 Functional Module Detailed Explanation Series - System Clock
Next article:MSP430 Functional Module Detailed Explanation Series - ADC12

Recommended ReadingLatest update time:2024-11-16 21:37

Design of MSP430 single-chip microcomputer application system based on I2C bus
Introduction Serial expansion bus technology is a significant feature of the development of the new generation of single-chip microcomputer technology. Among them, the I2C bus launched by PHILIPS is the most famous. It includes a two-terminal interface. Through an interface with a buffer, data can be sent or rec
[Microcontroller]
Design of MSP430 single-chip microcomputer application system based on I2C bus
MSP430F1611 Periodogram Correction FFT
   introduction   The spectrum analysis method based on FFT can extract useful information from signals containing noise, and has important application value in the data processing of instruments and meters. In order to ensure the accuracy of spectrum analysis, multi-point FFT operations are often performed, for exa
[Microcontroller]
MSP430F1611 Periodogram Correction FFT
MSP430 MCU ADC analog-to-digital conversion operation
//****************************************************************************** // D13x Example 4 - 12-bit AD conversion // // Description: The system is in sleep state LPM0 // If the AD sampling value is greater than or equal to 7FF, the small light is on; if it is less than 7FF, the small light is off. // ACLK= n/a
[Microcontroller]
Smart Home System Based on MSP430
0 Introduction With the rapid development of digital information technology and network technology, as well as the continuous improvement of people's material living standards, people's work, life, communication and information are becoming increasingly closely related. It can be said that the information societ
[Microcontroller]
Smart Home System Based on MSP430
Design of multifunctional blood glucose meter based on MSP430 series microcontroller
Introduction There are many types of blood glucose meters on the market, with various shapes and structures, but the prices and accuracy are very different; and it is difficult to have both price and accuracy. The reason is that there is no suitable microprocessor. In addition, due to the limitation of scr
[Microcontroller]
Design of multifunctional blood glucose meter based on MSP430 series microcontroller
msp430 drives 74hc595 (program + circuit) I2C serial communication
#include "msp430G2553.h" int tab ={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,           0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71}; int temp; //毫秒延迟函数 void delay(int ms) {   int i;   while(ms--)    for(i=0;i 120;i++); } //纳米延迟函数 void delayns(int ns) {   while(ns--); } void display(temp)//现实位置P2.0=SH;P2.1=ST;P2,2=DS {   in
[Microcontroller]
msp430 drives 74hc595 (program + circuit) I2C serial communication
Macro definition of MSP430 MCU IO pins
I believe many people have the experience of porting programs between different CPUs. In the process of porting, the porting of IO pins occupies most of the porting work. So, can a better method be used in the coding process to reduce the workload in the future porting? Assume that P40, P41, and P42 of the MSP430 micr
[Microcontroller]
Design of wireless data transmission system based on MSP430 and nRF905
In data measurement and control applications in special environments, wireless data transmission has been increasingly used. The combination of MSP430+nRF905 is particularly suitable for low-power, short-distance (100-200 m), small-data-volume wireless data transmission systems. The MSP430 CPU has great advanta
[Microcontroller]
Design of wireless data transmission system based on MSP430 and nRF905
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号