当前位置:网站首页>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
边栏推荐
- 数据库表外键的设计
- It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
- Long article review: entropy, free energy, symmetry and dynamics in the brain
- What insurance products should be bought for the elderly?
- Huawei BFD and NQA
- Oracle database knowledge points that cannot be learned (III)
- About uintptr_ T and IntPtr_ T type
- Print diamond pattern
- @EnableAsync @Async
- Hash table, string hash (special KMP)
猜你喜欢
![[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)](/img/44/aa4963d07d046deb2bc76eb59f8ff7.jpg)
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)

Since the "epidemic", we have adhered to the "no closing" of data middle office services

Characteristics of ginger
![[prefix and notes] prefix and introduction and use](/img/a6/a75e287ac481559d8f733e6ca3e59c.jpg)
[prefix and notes] prefix and introduction and use

Eight year test old bird, some suggestions for 1-3 year programmers

HackTheBox-baby breaking grad
![CesiumJS 2022^ 源码解读[8] - 资源封装与多线程](/img/d2/99932660298b4a4cddd7e5e69faca1.png)
CesiumJS 2022^ 源码解读[8] - 资源封装与多线程

Software testers, how can you quickly improve your testing skills? Ten minutes to teach you

MPLS experiment

Some other configurations on Huawei's spanning tree
随机推荐
The first training of wechat applet
Functions and arrays of shell scripts
功能:编写函数fun求s=1^k+2^k +3^k + ......+N^k的值, (1的K次方到N的K次方的累加和)。
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
PMP 考试常见工具与技术点总结
mysql使用视图报错,EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
Weekly open source project recommendation plan
机器学习基础:用 Lasso 做特征选择
Summary of common tools and technical points of PMP examination
删除所有值为y的元素。数组元素中的值和y的值由主函数通过键盘输入。
It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
手机异步发送短信验证码解决方案-Celery+redis
gslb(global server load balance)技术的一点理解
Future source code view -juc series
Decompile and modify the non source exe or DLL with dnspy
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
Pytest unit test framework: simple and easy to use parameterization and multiple operation modes
Function: write function fun to find s=1^k+2^k +3^k ++ The value of n^k, (the cumulative sum of the K power of 1 to the K power of n).
Cloud dial test helps Weidong cloud education to comprehensively improve the global user experience
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.