当前位置:网站首页>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.
边栏推荐
- How do I check swift if two arrays contain the same elements, regardless of the order in which they appear?
- Cve-2022-23131 - bypass SAML SSO authentication
- Why can't GC () free memory- Why does gc() not free memory?
- 原子Alpha开发板--SD卡和emmc烧录工具
- Drawing shp files using OpenGL
- Analysis on the output, market scale and development status of China's children's furniture industry in 2020 and the competition pattern of children's furniture enterprises [figure]
- Usage of STL map
- Understand what ICMP Protocol is
- Comparison test of mono 120W high power class D power amplifier chip cs8683-tpa3116
- DataX tutorial (09) - how does dataX achieve speed limit?
猜你喜欢
cos(a-b)=cosa*cosb+sina*sinb的推导过程
使用OpenGL绘制shp文件
Cs8126t 3.1w mono ultra low EMI unfiltered class D audio power amplifier IC
Uncaught TypeError: Cannot read properties of undefined (reading ‘prototype‘)
You can see the classification of SQL injection. SQL injection point /sql injection type /sql injection has several /sql injection point classifications
Ht513 I2S input 2.8W mono class D audio power amplifier IC
[轻松学会shell编程]-5、计划任务
Sophomores majoring in mechanics build a manipulator by hand -- full of compromise
How to create a handy vs Code?
Direct select sort and quick sort
随机推荐
In a single-page app, what is the right way to deal with wrong URLs (404 errors)?
【2022黑马程序员】SQL优化
sin(a+b)=sina*cosb+sinb*cosa的推导过程
JS dynamic table creation
The Rust Programming Language
3dmax软件的制作木桶过程:三步流程
Metauniverse in 2022: robbing people, burning money and breaking through the experience boundary
这些老系统代码,是猪写的么?
Want to self-study SCM, do you have any books and boards worth recommending?
How do I turn off word wrap in iterm2- How to turn off word wrap in iTerm2?
With a younger brother OCR, say no to various types of verification codes!
Leetcode 2163. Minimum difference of sum after element deletion
Difference between rest and WebServices
Flask 的入门级使用
Query process of MySQL secondary index
[learn shell programming easily]-5. Plan tasks
Large funds support ecological construction, and Plato farm builds a real meta universe with Dao as its governance
集群常用群起脚本
Drosophila played VR and entered nature. It was found that there were attention mechanisms and working memory. The insect brain was no worse than that of mammals
Viewing Chinese science and technology from the Winter Olympics (V): the Internet of things