当前位置:网站首页>Blue Bridge Cup SCM module code (external interrupt) (code + comment)
Blue Bridge Cup SCM module code (external interrupt) (code + comment)
2022-06-25 06:44:00 【tuygre】
/* The explanation in the previous chapter will not be repeated */
#include "STC15F2K60S2.H"
typedef unsigned char u8;
typedef unsigned int u16;
void close()
{
P0=0;
P2=P2&0X1F|0XAF;
P2=P2&0X1F;
P0=0XFF;
P2=P2&0X1F|0X8F;
P2=P2&0X1F;
}
void open()
{
EA=1;
/* Open total interrupt */
EX1=1;
EX0=1;
/* Allow external interrupts 0,1 Trigger */
IT1=1;
IT0=1;
/* Select falling edge trigger mode */
}
/* This function is the open interrupt function */
void main()
{
close();
open();
while(1)
{
}
}
void stop1() interrupt 0
{
P0=~1;
P2=P2&0X1F|0X80;
P2=P2&0X1F;
}
/* Press down S5 Light on */
void stop2() interrupt 2
{
P0=~0;
P2=P2&0X1F|0X80;
P2=P2&0X1F;
}
/* Press down S4 The light goes out */
/* In the user manual 1.1.10 in , It can be found P3.2,P3.3 Can be used to trigger external interrupts ,interrupt The last number can be found in the user manual 6.4 Query at other places */Official schematic diagram , The download address of the user manual is as follows :
link :https://pan.baidu.com/s/1y8lRYHxLKojL4_r0PZPYRw
Extraction code :19so
Note cannot insert picture , Relevant information readers themselves look for in the folder .
Study notes for undergraduate students of Nanjing University of Information Engineering , For your reference .
If there is a mistake , contact QQ3182097183.
边栏推荐
猜你喜欢

使用OpenGL绘制shp文件

sin(a+b)=sina*cosb+sinb*cosa的推导过程

Direct select sort and quick sort

【2022黑马程序员】SQL优化
![[轻松学会shell编程]-5、计划任务](/img/6f/8067d4201f0c2e7a692d89885e3ad9.png)
[轻松学会shell编程]-5、计划任务
![[learn shell programming easily]-5. Plan tasks](/img/6f/8067d4201f0c2e7a692d89885e3ad9.png)
[learn shell programming easily]-5. Plan tasks

Understand what ICMP Protocol is

How to realize the stable output of 3.3v/3.6v (1.2-5v) voltage of lithium battery by using the voltage rise and fall chip cs5517

Sophomores majoring in mechanics build a manipulator by hand -- full of compromise

Non-contact infrared temperature measurement system for human body based on single chip microcomputer
随机推荐
Understand what MSS is
Keil debug view variable prompt not in scope
sin(a-b)=sina*cosb-sinb*cosa的推导过程
Cannot activate inspection type when SAP retail uses transaction code mm41 to create commodity master data?
Query process of MySQL secondary index
How to deploy locally developed SAP ui5 applications to ABAP servers
In a single-page app, what is the right way to deal with wrong URLs (404 errors)?
父爱的表达方式
レレ / 蕾蕾
[learn FPGA programming from scratch -43]: vision chapter - technology evolution of chip design in the post Moore era -2- evolution direction
2022 biological fermentation Exhibition (Jinan), which is a must read before the exhibition. The most comprehensive exhibition strategy will take you around the "fermentation circle"
Entry level use of flask
Navicat防止新建查询误删
[ACNOI2022]王校长的构造
SAP QM executes the transaction code qp01, and the system reports an error -material type food is not defined for task list type Q-
Sleep quality today 67 points
'how do I create an enumeration with constant values in rust?'- How can I create enums with constant values in Rust?
Ctfhub web information disclosure directory traversal
ACWING2013. 三条线
Comparison test of mono 120W high power class D power amplifier chip cs8683-tpa3116