/*
External interrupt 0 interrupt, the effect is that the lower four bits are lit, and the upper four bits are lit when the interrupt occurs.
After the interruption, the program returns to the main program and continues to light up the lower four bits.
*/
#include
#include
//To interrupt, you need to set some parameters
void center1()
{
EX0 = 1; //Interrupt enable switch
IT0 = 0; // Falling edge trigger mode
EA = 1; // Main switch
}
void main(void) //Main function
{
zhongduan1();
//Low level lights up
while(1) //Large loop
{
P0 = 0xf0; //light up the lower four bits 1111 0000
}
}
//Now create an interrupt, when the interrupt occurs, the high four bits are lit
void zhongduan() interrupt 0
{
P0 = ~0xf0; //The content to be executed after the interrupt occurs is the high four bits are lit
}
Previous article:Timer/Counter 0 (Counter)
Next article:LCD with character display I LOVE YOU
- 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 does it prompt me that the download frequency is too high? Please try again later.
- [Shanghai Hangxin ACM32F070 development board + touch function evaluation board] 05. How to configure the CAN communication baud rate
- BlueNRG Series Storage Analysis (Flash and RAM)
- How to start power supply design
- When learning high-speed circuit design, you must know these things!
- EEWORLD University Hall----Live Replay: The Use of SOI Level Shift Driver IC in LLC Topology
- June 4 live broadcast review: TI wireless training live broadcast (including video, PPT)
- What is the difference between TI's DSP2812 and 28335?
- Ended -- Microchip Live Broadcast [Implementing MultiZone Security in RISC-V Applications]
- CPLD driving small lamp simulation problem