当前位置:网站首页>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
边栏推荐
猜你喜欢

MySQL基础篇【单行函数】

定时器的类型

01 Encounter typescript, build environment

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

使用 GraphiQL 可视化 GraphQL 架构

The 2nd China PWA Developer Day

为什么黑客领域几乎一片男生?

国内市场上的BI软件,到底有啥区别

C language "the third is" upgrade (mode selection + AI chess)

Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
随机推荐
7、常见面试口语提问问题汇总
[MySQL] Mysql paradigm and the role of foreign keys
Applicable scenario of multi-master replication (2) - client and collaborative editing that require offline operation
「秋招系列」MySQL面试核心25问(附答案)
Kubernetes常用命令
2020微信小程序反编译教程(小程序反编译源码能用吗)
.NET 20周年专访 - 张善友:.NET 技术是如何赋能并改变世界的
更新数据表update
MySQL多表联合查询
Replication Latency Case (3) - Monotonic Read
MySQL基础篇【单行函数】
WPF项目--控件入门基础用法,必知必会XAML
Codeforces Round #796 (Div. 2) (A-D)
定时器的类型
MySQL数据库操作
C language "the third is" upgrade (mode selection + AI chess)
Implementing DDD based on ABP
Deployment应用生命周期与Pod健康检查
mysql黑窗口~建库建表
自动化测试如何创造业务价值?