#define uint unsigned int
#define uchar unsigned char
/
Function: void delay_1ms(void) void delay_nms(uint n)
Function: Delay 1ms Delay Nms
*/
void Delay_1ms(void) //1ms delay function
{
uint i;
for (i=0;i<80;i++);
}
void Delay_Nms(uint n) //N ms delay function
{
uint i=0;
for (i=0;i
}
/
Function: void P1_ISR(void)
Function: external interrupt service function
*/
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
uchar i;
for(i=0;i<10;i++)
{
P1OUT=0x01;
Delay_Nms(1000);
P1OUT=0x00;
Delay_Nms(1000);
}
P1IFG = 0x00; //Clear interrupt flag
}
/
Function: void P1_INIT(void)
Function: PORT1 port initialization
*/
void P1_INIT(void)
{
P1SEL = 0x00; //Set to normal I/O port
P1DIR |= 0X01; //Set I/O direction
P1IE = 0x80; //P1^7 interrupt enable
P1IES = 0x00; //Rising edge sets the corresponding flag bit
P1IFG = 0x00; //Clear interrupt flag
}
/
Function: void main(void)
Function: main function
*/
void main(void)
{
WDTCTL = WDTPW + WDTHOLD;
P1_INIT();
_EINT(); //Open total interrupt
while(1)
{
P1OUT=0x00;
}
}
Previous article:Time base interrupt timing for Sunplus 16-bit microcontroller
Next article:Reference IAR + Proteus7.6 simulation MSP430 microcontroller setting method
- 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
- In 2020, 5G has covered 1,336 cities around the world, with a growth rate of more than three times
- Understanding the Internals of ADCs
- 【micropython】The default frequency of ESP32 firmware has been changed to 160M
- Introduction to TI's GaN-based power solutions and reference designs
- Three-phase rectifier control
- Reverse switch single phase motor forward and reverse wiring diagram
- EEWORLD University ---- The most important components of the analog world - signal chain and power supply: DC/DC switching regulator
- [Zhongke Bluexun AB32VG1 RISC-V board "run into" RTT evaluation] Part 3: Use of ADC peripherals
- Add an iron red palette to thermal imaging
- I got the "quantum chip", and it really is true