当前位置:网站首页>Principle and application of single chip microcomputer timer, serial communication and interrupt system

Principle and application of single chip microcomputer timer, serial communication and interrupt system

2022-07-01 08:57:00 Waves ~



One 、 parallel IO Mouth use

51 SCM has 4 Group IO mouth , It can be done to IO Port for parallel input and parallel output 8 Bit data , And IO The mouth can be used in a bitwise manner .
keil The software programming and debugging window is as follows :
 Insert picture description here


Two 、 Working principle and mode of timer counter

51 There are... Inside the single chip microcomputer T0 and T1 Two timers , It is also an addition counter .
 Insert picture description here
Mode register TMOD, Control the working mode of the timer
 Insert picture description here
 Insert picture description here
Each timer has 16 Bit data ,

The way 2 yes 8 Bit auto set counter , The upper eight bits can automatically load the initial value ;
The way 3 Only timing / Counter T0 Only then .

3、 ... and 、 Timer / Counter programming

1、 Use query to process

 Insert picture description here

2、 Interrupt mode is adopted

 Insert picture description here
SCM timer can be timed at most 65536us, You can use the set software counting and timer to achieve greater than 65536us The timing of ;
 Insert picture description here


Four 、 Serial communication

According to the direction of information transmission : Simplex 、 Half duplex and full duplex

It is divided into serial communication and parallel communication ; It is divided into synchronous communication and asynchronous communication

High speed serial communication generally adopts synchronous communication ;

51 SCM is a standard digital circuit chip , Its input and output pins conform to TTL Level rule ( The high level is 3-5V, The low level is 0-1V)

To improve the reliability of serial communication , Various new communication level standards have been defined , To form the RS422、RS232 and RS484 Three asynchronous serial communication level protocols .
 Insert picture description here
 Insert picture description here

5、 ... and 、 Interrupt the system

 Insert picture description here

原网站

版权声明
本文为[Waves ~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010821241235.html