当前位置:网站首页>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();
}
}
边栏推荐
- Do you choose pandas or SQL for the top 1 of data analysis in your mind?
- Application of MATLAB in Linear Algebra (4): similar matrix and quadratic form
- golang定时器使用踩的坑:定时器每天执行一次
- Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
- Implementation of one-dimensional convolutional neural network CNN based on FPGA (VIII) implementation of activation layer
- DelayQueue延迟队列的使用和场景
- Hdu1231 maximum continuous subsequence (divide and conquer or dynamic gauge or double pointer)
- Negative number storage and type conversion in programs
- [OBS] x264 Code: "buffer_size“
- arcpy. SpatialJoin_ Analysis spatial connection analysis
猜你喜欢

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

1290_ Implementation analysis of prvtaskistasksuspended() interface in FreeRTOS

Ros2 - install ros2 (III)

【软件测试】06 -- 软件测试的基本流程

What if the DataGrid cannot see the table after connecting to the database

Don't confuse the use difference between series / and / *

U-Boot初始化及工作流程分析

【软件测试】02 -- 软件缺陷管理

2022年PMP项目管理考试敏捷知识点(7)

Machine learning Seaborn visualization
随机推荐
Use of Pai platform
Logical structure and physical structure
网易To B,柔外刚中
Machine learning Seaborn visualization
golang定时器使用踩的坑:定时器每天执行一次
Ros2 - install ros2 (III)
Word import literature -mendeley
HDU1231 最大连续子序列(分治or动规or双指针)
2022.06.27_每日一题
Chapter 2: try to implement a simple bean container
【Node】npm、yarn、pnpm 区别
[vscode] search using regular expressions
Xiaomi written test real question 1
Mid 2022 documentary -- the experience of an ordinary person
611. 有效三角形的个数
Using GEE plug-in in QGIS
Implementation of one-dimensional convolutional neural network CNN based on FPGA (VIII) implementation of activation layer
Ros2 - node (VII)
HDU1232 畅通工程(并查集)
【软件测试】05 -- 软件测试的原则