当前位置:网站首页>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.
边栏推荐
- Do you understand automatic packing and unpacking? What is the principle?
- [CSDN] C1 training problem analysis_ Part IV_ Advanced web
- 万字手撕七大排序(代码+动图演示)
- Oracle database SQL statement execution plan, statement tracking and optimization instance
- 03 FastJson 解决循环引用
- Project cost management__ Topic of comprehensive calculation
- MYSQL数据库底层基础专栏
- 03 FastJson 解决循环引用
- 要選擇那種語言為單片機編寫程序呢
- [keil5 debugging] warning:enumerated type mixed with other type
猜你喜欢

Quelle langue choisir pour programmer un micro - ordinateur à puce unique
![[CSDN]C1训练题解析_第二部分_Web基础](/img/91/72cdea3eb3f61315595330d2c9016d.png)
[CSDN]C1训练题解析_第二部分_Web基础

Runtime. getRuntime(). GC () and runtime getRuntime(). The difference between runfinalization()

Oracle database SQL statement execution plan, statement tracking and optimization instance

I didn't think so much when I was in the field of single chip microcomputer. I just wanted to earn money to support myself first

NR PUCCH format0 sequence generation and detection mechanism

Mysql database underlying foundation column

要選擇那種語言為單片機編寫程序呢

Nr-prach: access scenario and access process

端午节快乐!—— canvas写的粽子~~~~~
随机推荐
STM32 external interrupt experiment
[male nanny style] teach you to open the first wechat applet
要選擇那種語言為單片機編寫程序呢
CEF下载,编译工程
Idea remote breakpoint debugging jar package project
顺利毕业[3]-博客系统 更新中。。。
顺利毕业[2]-学生健康管理系统 功能开发中。。。
单片机学到什么程度能找到工作,这个标准不好量化
[Li Kou brush question notes (II)] special skills, module breakthroughs, classification and summary of 45 classic questions, and refinement in continuous consolidation
万字手撕七大排序(代码+动图演示)
自动装箱与拆箱了解吗?原理是什么?
Gpiof6, 7, 8 configuration
Electronic product design, MCU development, circuit cloning
You need to use MySQL in the opening experiment. How can you forget the basic select statement? Remedy is coming~
IDEA远程断点调试jar包项目
Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
STM32 serial port usart1 routine
A lottery like scissors, stone and cloth (C language)
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
Epollet lessons