当前位置:网站首页>Serial communication based on 51 single chip microcomputer
Serial communication based on 51 single chip microcomputer
2022-07-03 09:56:00 【Yiao】
One , Concept of computer communication : The computer is on = Information exchange with external devices or computers .
Two ,89C51 Serial port of SCON 1, structure
SCON It's a special SCON Is a special function register , Used to set the working mode of serial port , receive / Send control and set status flags

2, To configure ******SM0 and SM1:SM0 and SM1 Select bit for working mode , There are four ways to work , Usually used 1.

******SM2 Multi machine access control bit , Mainly used in 2 And way 3. When the receiver SM2=1 when , You can use what you receive RB8 To control whether to activate RI(RB8=0 Not active when RI, The received message is discarded ;RB8=1 when , The received message enters SBUF, And activate RI, In turn, the data is transferred from SBUF Go to read ). When SM2=0 when , No matter what you receive RB8 yes 0 still 1, Can make the received data enter SBUF, And activate RI( here RB8 Don't control RI). In ways 0 when ,SM2 Must be 0, In ways 1 when , If SM2=1, Then only when a valid stop bit is received ,RI Can be set 1.
******REN, Allows serial reception of bits . Set by software REN=1, start-up , Set up 0 To close .
******TB8, In ways 2 Or the way 3 in , Is the ninth bit of received data , Its function can be specified by software . Can be used as parity bit of data . In ways 0 And way 1 The middle bit is not used .
*******RB8, In ways 2 or 3 in , The ninth bit of the received data . In ways 1 when , if SM2=0, be RB8 Is the received stop bit .
******T1, Send interrupt flag bit . In ways 0 when , When the serial port sends the eighth bit data , Or in other The way , When the serial port sends the stop bit , By internal hardware T1 Set up 1, towards CPU Send interrupt request . In the interrupt program , The software must be clear 0, Cancel this interruption request .
******RI, Receive interrupt flag bit , In ways 0 when , When the serial port receives the eighth bit data , Or in other ways , When the serial port receives the middle of the stop bit , By internal hardware RI Set up 1, towards CPU Send interrupt request . Must be in the interrupt program , Use software to clear 0, Cancel the interruption Application .
3、 ... and ,PCON
SMOD(PCON.7) Baud rate multiplication . In ways 1,2,3 when , Baud rate and SMOD of , When SMOD=1 when , Double the baud rate , Reset time ,SMOD=0.
边栏推荐
- JS基础-原型原型链和宏任务/微任务/事件机制
- GPIO port details, Hal library operation keys
- uniapp 实现微信小程序全局分享及自定义分享按钮样式
- Project cost management__ Topic of comprehensive calculation
- [csdn] C1 analyse des questions de formation Partie III Bar _ JS Foundation
- Basic knowledge of MySQL database (an introduction to systematization)
- numpy. Reshape() and resize() functions
- SSB Introduction (PbCH and DMRs need to be supplemented)
- Development of electrical fire system
- 开学实验里要用到mysql,忘记基本的select语句怎么玩啦?补救来啦~
猜你喜欢

我想各位朋友都应该知道学习的基本规律就是:从易到难

How MySQL modifies null to not null

Eight working modes of stm32gpio and chip naming rules

el-table X轴方向(横向)滚动条默认滑到右边

Difference of EOF

Electronic product design

STM32 interrupt priority management

应用最广泛的8位单片机当然也是初学者们最容易上手学习的单片机

SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers

SSB Introduction (PbCH and DMRs need to be supplemented)
随机推荐
内存数据库究竟是如何发挥内存优势的?
MYSQL数据库底层基础专栏
Error output redirection
自动装箱与拆箱了解吗?原理是什么?
SSB Introduction (PbCH and DMRs need to be supplemented)
端午节快乐!—— canvas写的粽子~~~~~
Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
An executable binary file contains more than machine instructions
Development of electrical fire system
手机都算是单片机的一种,只不过它用的硬件不是51的芯片
STM32 interrupt priority management
SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
Development of fire evacuation system
[successful graduation] [1] - visit [student management information system]
el-table X轴方向(横向)滚动条默认滑到右边
Emballage automatique et déballage compris? Quel est le principe?
The third paper of information system project manager in soft examination
You need to use MySQL in the opening experiment. How can you forget the basic select statement? Remedy is coming~
Seven sorting of ten thousand words by hand (code + dynamic diagram demonstration)
STM32 serial communication principle