int main( void ) { // Stop watchdog timer to prevent time out reset WDTCTL = WDTPW + WDTHOLD; P1DIR |= 0x01; //Set P1.0 port to output P1IE |= 0x08; // Enable P1.3 interrupt P1IES |= 0x08; //P1.3 port falling edge triggers interrupt P1IFG &= ~0x08; // Clear the interrupt flag _EINT(); //Open the general interrupt //_BIS_SR(LPM4_bits + GIE); while(1) { } } /*Interrupt service routine*/ #pragma vector = PORT1_VECTOR __interrupt void PORT_1(void) { P1OUT ^= 0x01; //P1.0 status flip P1IFG &= ~0x08; // Clear the interrupt flag }
Previous article:Reference IAR + Proteus7.6 simulation MSP430 microcontroller setting method
Next article:Microcontroller learning notes external interrupt, timer, serial port interrupt
- 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
- Why is the output filter capacitor of the WM8918 audio decoding DAC so large?
- DLP projection face changing mask
- Become a Xilinx FPGA Design Expert (Basics)
- A brief history of channel coding
- Connected cars, where is the future?
- What PCB design practice materials are there?
- EEWORLD University ---- Live playback: The most important component of the analog world - Signal chain and power supply: USB Type-C? PD special session
- Problems connecting Bluetooth module with CC2541
- microchip zero-drift operational amplifier
- Matter Development Guide (VI): Network Configuration and Lighting-App Examples