#include "io430.h"
/*
There are two ways to control the on and off of the LED light.
Method 1: Interrupt function. Method 2: Use if(P4IN&BIT2) to judge.
When writing code, try to follow the steps to avoid wasting a lot of time looking for bugs due to negligence.
*/
int main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
P4DIR |= BIT5;
P4REN |= BIT2;
P4OUT |= BIT2;
P4IES |= BIT2;
P4IFG &= ~BIT2;
P4IE |=BIT2;
__bis_SR_register(LPM4_bits+GIE);
return 0;
}
#pragma vector=PORT4_VECTOR
__interrupt void Port_4(void)
{
//P4OUT &= ~BIT5; //If it is off, it can't light up again.
P4OUT ^= BIT5; //on and off cycle
P4IFG &= ~BIT2;
}
Previous article:MSP430G2553 1602 display characters
Next article:MSP430G2553 electronic clock experiment
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Definition of waveform overshoot on sampling resistor in constant current source application
- How to generate such waveform using Verilog?
- Environmental Monitoring System
- Are only foreign companies exempt from overtime work?
- 【micropython】Improved reset to bootloader
- 06 Make GD32L233C expansion board
- The names, wavelengths, characteristics and application fields of each band in the electromagnetic spectrum
- [TI Course] How is the anti-interference ability of TI millimeter-wave radar?
- The ampere-second product of capacitance and the volt-second product of inductance
- Regarding the distinction between NMOS tubes and PMOS tubes