当前位置:网站首页>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
边栏推荐
- HackTheBox-baby breaking grad
- Gauss elimination method and template code
- 不得不会的Oracle数据库知识点(一)
- From functools import reduce -- see the use of reduce function from typical examples
- Sorry, Tencent I also refused
- What is regression testing? Talk about regression testing in the eyes of Ali Test Engineers
- Unity Shader入门精要读书笔记 第三章 Unity Shader基础
- be based on. NETCORE development blog project starblog - (14) realize theme switching function
- 不得不会的Oracle数据库知识点(二)
- Stringutils and collectionutils
猜你喜欢

In the process of seeking human intelligent AI, meta bet on self supervised learning

On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it

1-redis architecture design to use scenarios - four deployment and operation modes (Part 1)

A-Frame虚拟现实开发入门

String hash, find the string hash value after deleting any character, double hash

Release and visualization of related data

AI 助力艺术设计抄袭检索新突破!刘芳教授团队论文被多媒体顶级会议ACM MM录用

Weekly open source project recommendation plan

2-redis architecture design to use scenarios - four deployment and operation modes (Part 2)

Is it really possible that the monthly salary is 3K and the monthly salary is 15K?
随机推荐
CesiumJS 2022^ 源码解读[8] - 资源封装与多线程
The FISCO bcos console calls the contract and reports an error does not exist
On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it
Cloud dial test helps Weidong cloud education to comprehensively improve the global user experience
Is it really possible that the monthly salary is 3K and the monthly salary is 15K?
Thinkphp6 integrated JWT method and detailed explanation of generation, removal and destruction
Which insurance products can the elderly buy?
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
“疫”起坚守 保障数据中台服务“不打烊”
Meta metauniverse female safety problems occur frequently, how to solve the relevant problems in the metauniverse?
How to set the response description information when the response parameter in swagger is Boolean or integer
不得不会的Oracle数据库知识点(二)
Function: find the sum of the elements on the main and sub diagonal of the matrix with 5 rows and 5 columns. Note that the elements where the two diagonals intersect are added only once. For example,
Decompile and modify the non source exe or DLL with dnspy
How to be a professional software testing engineer? Listen to the byte five year old test
12. Go implementation of integer to Roman numeral and leetcode
MySQL - use of aggregate functions and group by groups
swagger中响应参数为Boolean或是integer如何设置响应描述信息
From functional testing to automated testing, how did I successfully transform my salary to 15K +?
Function: find the approximate value of the limit of the ratio of the former term to the latter term of Fibonacci sequence. For example, when the error is 0.0001, the function value is 0.618056.