当前位置:网站首页>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.
边栏推荐
- C language enumeration type
- MySQL的简单使用(增删改查)
- [keil5 debugging] warning:enumerated type mixed with other type
- [male nanny style] teach you to open the first wechat applet
- Do you understand automatic packing and unpacking? What is the principle?
- Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~
- Assignment to '*' form incompatible pointer type 'linkstack' {aka '*'} problem solving
- Eight working modes of stm32gpio and chip naming rules
- Quelle langue choisir pour programmer un micro - ordinateur à puce unique
- How MySQL modifies null to not null
猜你喜欢
STM32 port multiplexing and remapping
How MySQL modifies null to not null
Stm32f407 key interrupt
UCI and data multiplexing are transmitted on Pusch - determine the bit number of harqack, csi1 and csi2 (Part II)
STM32 serial port usart1 routine
MySQL data manipulation language DML common commands
內存數據庫究竟是如何發揮內存優勢的?
Exception handling of arm
单片机职业发展:能做下去的都成牛人了,熬不动就辞职或者改行了
[graduation successful] [1] - tour [Student Management Information System]
随机推荐
Project scope management__ Scope management plan and scope specification
STM32 interrupt switch
Shell logic case
Raspberry pie installation SciPy
学历是一张通行证,门票,你有了它,可以踏入更高层次的环境里
byte alignment
Project cost management__ Cost management technology__ Article 7 completion performance index (tcpi)
Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
The third paper of information system project manager in soft examination
MYSQL数据库底层基础专栏
Mobile phones are a kind of MCU, but the hardware it uses is not 51 chip
Happy Dragon Boat Festival—— Zongzi written by canvas~~~~~
我想各位朋友都应该知道学习的基本规律就是:从易到难
自动装箱与拆箱了解吗?原理是什么?
Schematic diagram and connection method of six pin self-locking switch
[combinatorics] Introduction to Combinatorics (combinatorial thought 2: mathematical induction | mathematical induction promotion | multiple induction thought)
顺利毕业[2]-学生健康管理系统 功能开发中。。。
Eight working modes of stm32gpio and chip naming rules
QT qcombobox QSS style settings
Nr--- Pusch I: sorting out the agreement process