当前位置:网站首页>51 single chip microcomputer timer 2 is used as serial port
51 single chip microcomputer timer 2 is used as serial port
2022-07-04 01:11:00 【_ WILLPOWER_】
Use timer 2 Used as a serial port
#define FOSC 11059200L //System frequency
#define BAUD 115200 //UART baudrate
// Serial initialization
void UartInit(void) //[email protected]
{
SCON = 0x50; //8-bit variable UART
TL2 = RCAP2L = (65536-(FOSC/32/BAUD)); //Set auto-reload vaule
TH2 = RCAP2H = (65536-(FOSC/32/BAUD)) >> 8;
T2CON = 0x34; //Timer2 start run
}
// Serial port interrupt number is 4
边栏推荐
- The first training of wechat applet
- [common error] custom IP instantiation error
- Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading
- Gee: create a new feature and set corresponding attributes
- Which insurance products can the elderly buy?
- How to use AHAS to ensure the stability of Web services?
- 手机异步发送短信验证码解决方案-Celery+redis
- Future source code view -juc series
- How to set the response description information when the response parameter in swagger is Boolean or integer
- 功能:编写函数fun求s=1^k+2^k +3^k + ......+N^k的值, (1的K次方到N的K次方的累加和)。
猜你喜欢
Some other configurations on Huawei's spanning tree
@EnableAsync @Async
GUI application: socket network chat room
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
Huawei rip and BFD linkage
Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading
Pytest unit test framework: simple and easy to use parameterization and multiple operation modes
Characteristics of ginger
Analysis and solution of lazyinitializationexception
Technical practice online fault analysis and solutions (Part 1)
随机推荐
Regular expression of shell script value
功能:求出菲波那契数列的前一项与后一项之比的极限的 近似值。例如:当误差为0.0001时,函数值为0.618056。
关于 uintptr_t和intptr_t 类型
How can enterprises optimize the best cost of cloud computing?
删除所有值为y的元素。数组元素中的值和y的值由主函数通过键盘输入。
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
On covariance of array and wildcard of generic type
AI 助力艺术设计抄袭检索新突破!刘芳教授团队论文被多媒体顶级会议ACM MM录用
Summary of common tools and technical points of PMP examination
AI helps make new breakthroughs in art design plagiarism retrieval! Professor Liu Fang's team paper was employed by ACM mm, a multimedia top-level conference
CLP information - how does the digital transformation of credit business change from star to finger?
不得不会的Oracle数据库知识点(四)
HackTheBox-baby breaking grad
2-Redis架构设计到使用场景-四种部署运行模式(下)
Understanding of Radix
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing
A little understanding of GSLB (global server load balance) technology
How to use AHAS to ensure the stability of Web services?
2022 Software Test Engineer skill list, please check