当前位置:网站首页>Basic operation of external interrupt (keil5)
Basic operation of external interrupt (keil5)
2022-07-05 07:18:00 【After reading thousands of books, you can pick them up and put 】
I didn't press s5, Always execute the main program (L1 Keep flashing ), Press down s5, The main program is suspended , Execute the contents of the interrupt service function (L2 bright ,L2 After extinction ), Continue the main program just now (L1 Keep flashing ).
#include <STC15F2K60S2.H>
#include <intrins.h>
sbit L2=P0^1;
sbit L1=P0^0;
void initsystem()
{
P2=0xbf&(P2|0xe0);
P0=0x00;
P2=0x1f&(P2|0xe0);
P2=0x9f&(P2|0xe0);
P0=0xff;
P2=0x1f&(P2|0xe0);
}
void Delay500ms() //@11.0592MHz
{
unsigned char i, j, k;
_nop_();
_nop_();
i = 22;
j = 3;
k = 227;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
void LED()
{
L1=0;
Delay500ms();
L1=1;
Delay500ms();
}
void Init_Timer()
{
IT0=1;
EX0=1;
EA=1;
}
void Iterrupt1() interrupt 0
{
L2=0;
Delay500ms();
Delay500ms();
Delay500ms();
Delay500ms();
L2=1;
}
void main()
{
Init_Timer();
initsystem();
P2=0x9f&(P2|0xe0);
while(1)
{
LED();
}
}
边栏推荐
- ORACLE CREATE SEQUENCE,ALTER SEQUENCE,DROP SEQUENCE
- Application of MATLAB in Linear Algebra (4): similar matrix and quadratic form
- An article was opened to test the real situation of outsourcing companies
- list. files: List the Files in a Directory/Folder
- Tshydro tool
- [idea] efficient plug-in save actions to improve your work efficiency
- 小米笔试真题一
- 【软件测试】06 -- 软件测试的基本流程
- [vscode] prohibit the pylance plug-in from automatically adding import
- What if the DataGrid cannot see the table after connecting to the database
猜你喜欢

Mathematical analysis_ Notes_ Chapter 8: multiple integral

IPage能正常显示数据,但是total一直等于0

IPage can display data normally, but total is always equal to 0

Jenkins reported an error. Illegal character: '\ufeff'. Class, interface or enum are required
![[vscode] prohibit the pylance plug-in from automatically adding import](/img/a7/d96c0c4739ff68356c15bafbbb1328.jpg)
[vscode] prohibit the pylance plug-in from automatically adding import

Ros2 - install ros2 (III)

Docker installs MySQL and uses Navicat to connect

Solve tensorfow GPU modulenotfounderror: no module named 'tensorflow_ core. estimator‘

Machine learning Seaborn visualization
![[software testing] 03 -- overview of software testing](/img/1e/0b6458160e34e43f021ea4797de70a.jpg)
[software testing] 03 -- overview of software testing
随机推荐
Powermanagerservice (I) - initialization
mingling
Concurrent programming - deadlock troubleshooting and handling
GPIO port bit based on Cortex-M3 and M4 with operation macro definition (can be used for bus input and output, STM32, aducm4050, etc.)
Literacy Ethernet MII interface types Daquan MII, RMII, smii, gmii, rgmii, sgmii, XGMII, XAUI, rxaui
Ros2 - function package (VI)
【软件测试】06 -- 软件测试的基本流程
Docker installs MySQL and uses Navicat to connect
Matlab在线性代数中的应用(四):相似矩阵及二次型
SOC_SD_CMD_FSM
The difference between new and malloc
2022.06.27_每日一题
Don't confuse the use difference between series / and / *
程序中的负数存储及类型转换
Matrix and TMB package version issues in R
Database SQL practice 3. Find the current salary details of the current leaders of each department and their corresponding department number Dept_ no
Concurrent programming - how to interrupt / stop a running thread?
Brief description of inux camera (Mipi interface)
Do you choose pandas or SQL for the top 1 of data analysis in your mind?
Ros2 - first acquaintance with ros2 (I)