当前位置:网站首页>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.
边栏推荐
- Nr--- Pusch I: sorting out the agreement process
- 內存數據庫究竟是如何發揮內存優勢的?
- When you need to use some functions of STM32, but 51 can't realize them, 32 naturally doesn't need to learn
- 新系列单片机还延续了STM32产品家族的低电压和节能两大优势
- UCI and data multiplexing are transmitted on Pusch (Part V) -- polar coding
- STM32 serial port usart1 routine
- Epoll read / write mode in LT and et modes
- Not many people can finally bring their interests to college graduation
- 干单片机这一行的时候根本没想过这么多,只想着先挣钱养活自己
- JMX、MBean、MXBean、MBeanServer 入门
猜你喜欢
CEF下载,编译工程
[csdn] C1 analyse des questions de formation Partie III Bar _ JS Foundation
Programming ideas are more important than anything, not more than who can use several functions, but more than the understanding of the program
Hal library sets STM32 clock
In third tier cities and counties, it is difficult to get 10K after graduation
Electronic product design, MCU development, circuit cloning
UCI and data multiplexing are transmitted on Pusch (Part VI) -- LDPC coding
JS基础-原型原型链和宏任务/微任务/事件机制
PRACH --- originator
Eight working modes of stm32gpio and chip naming rules
随机推荐
Runtime.getRuntime().gc() 和 Runtime.getRuntime().runFinalization() 的区别
Hal library sets STM32 clock
当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学
Development of fire power monitoring system
Project cost management__ Cost management technology__ Article 7 completion performance index (tcpi)
2020-08-23
没有多少人能够最终把自己的兴趣带到大学毕业上
UCI and data multiplexing are transmitted on Pusch (Part 4) --small block lengths
Of course, the most widely used 8-bit single chip microcomputer is also the single chip microcomputer that beginners are most easy to learn
我想各位朋友都应该知道学习的基本规律就是:从易到难
Emballage automatique et déballage compris? Quel est le principe?
手机都算是单片机的一种,只不过它用的硬件不是51的芯片
Fundamentals of Electronic Technology (III)_ Integrated operational amplifier and its application__ Basic arithmetic circuit
Nr--- Pusch I: sorting out the agreement process
Matlab reads hexadecimal numbers and converts them into signed short
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
自动装箱与拆箱了解吗?原理是什么?
嵌入式本来就很坑,相对于互联网来说那个坑多得简直是难走
Intelligent home design and development
The third paper of information system project manager in soft examination