当前位置:网站首页>The arm button controls the flashing of the led light (embedded button experiment report)
The arm button controls the flashing of the led light (embedded button experiment report)
2022-07-31 15:49:00 【Full stack programmer webmaster】
Hello everyone, meet again, I'm your friend Quanstack Jun.
Experiment 6
Keyboard control
LED
Lamp experiment
1
The purpose of the experiment
(1)
Master the interrupt keyboard control and design method through experiments;
(2)
Proficient in writing
S3C2410
Interrupt service routine.
2
Experimental equipment
(1)
S3C2410
Embedded Development Board,
JTAG
Emulator.
(2)
Software:
PC
Computer operating system
Windows XP
,
ADS1.2
Integrated development environment, emulator driver
Motion program, HyperTerminal communication program.
3
Experiment content
Write an interrupt handler,
Handling a keyboard interrupt,
And print interruption and key display information on the serial port.
4
Experimental steps
(1)
Refer to the template project,
Create a new project
keypad
,
Add the appropriate file,
and modify
keypad
Project settings;
(2)
Create
keypad.c
And add to the project
keypad
middle;
(3)
Write a keyboard interrupt program;
The reference code is as follows:
①Serial port initialization program
void uart_init()/* UART
Serial port initialization
*/
{
GPHCON |= 0xa0;
//GPH2,GPH3 used as TXD0,RXD0
GPHUP
= 0x0;
//GPH2,GPH3
Internal pullup
ULCON0
= 0x03;
//8N1
UCON0
= 0x05;
//
The query mode is polling or interrupt
;
Clock selection is
PCLK
UFCON0 = 0x00;
//
Do not use
FIFO
UMCON0 = 0x00;
//
Do not use flow control
UBRDIV0 = 26;
//
Baud rate
57600,PCLK=12Mhz
}
Publisher: Full-stack programmer, please indicate the source: https://javaforall.cn/127984.htmlOriginal link: https://javaforall.cn
边栏推荐
猜你喜欢

6-22 Vulnerability exploit - postgresql database password cracking

外媒所言非虚,苹果降价或许是真的在清库存

Why don't you make a confession during the graduation season?

Dialogue with Zhuang Biaowei: The first lesson of open source

【7.29】代码源 - 【排列】【石子游戏 II】【Cow and Snacks】【最小生成数】【数列】

Synchronized and volatile interview brief summary

type of timer

Implementing DDD based on ABP

Internet banking stolen?This article tells you how to use online banking safely

Public Key Retrieval is not allowed error solution when DBeaver connects to MySQL 8.x
随机推荐
为什么黑客领域几乎一片男生?
MySQL数据库操作
复制延迟案例(1)-最终一致性
Foreign media right, apple on May be true in inventory
11 pinia使用
【7.28】代码源 - 【Fence Painting】【合适数对(数据加强版)】
The normal form of the database (first normal form, second normal form, third normal form, BCNF normal form) "recommended collection"
Replication Latency Case (1) - Eventual Consistency
mongo enters error
字符指针赋值[通俗易懂]
修改SQL语言实现Mysql 多表关联查询优化
工程力学复习资料
Emmet 语法
Gorm—Go language database framework
form 表单提交后,使页面不跳转[通俗易懂]
gerrit中如何切换远程服务器
The 2nd China PWA Developer Day
org.apache.jasperException(could not initialize class org)
mongo进入报错
TRACE32 - Common Operations