当前位置:网站首页>0 basic learning C language - interrupt

0 basic learning C language - interrupt

2022-07-06 22:20:00 If life is just like the first time 645

One 、 The concept of interruption

CPU Dealing with an event A when , Another incident happened B Request to be dealt with quickly ( Interruption occurs )
CPU Temporarily interrupt the current work , Go ahead and deal with the incident B( Interrupt response and interrupt service )
stay CPU Put the event B After processing , Back to the original event A Continue to deal with the event where it was interrupted A( Interrupt return ), This process is called interruption .

Two 、 Interrupt structure

 Insert picture description here

3、 ... and 、 Interrupt request flag

1. Counter / Interrupt flag of timer control register

 Insert picture description here

2. Serial port interrupt flag

 Insert picture description here

Four 、 Interrupt priority

1. priority

 Insert picture description here

2. Interruption principle

 Insert picture description here

3. Interruption conditions

 Insert picture description here

5、 ... and 、 Interrupt the program

1. Turn on interrupt

 Insert picture description here

2. Write interrupt subfunction

 Insert picture description here

6、 ... and 、 timing / The counter is interrupted

1. timing / The structure of the counter

 Insert picture description here
 Insert picture description here

2. timing / How the counter works

 Insert picture description here

3. timing / Control of counter

 Insert picture description here

1. Working mode register TMOD

 Insert picture description here

 Insert picture description here
 Insert picture description here
Example method 1 Insert picture description here

2. Control register TCON

 Insert picture description here

  1. One of the top four TF0 and TF1 It is automatically controlled by single chip microcomputer , You don't have to worry about
  2. TR1TR1
  3. TR0
     Insert picture description here

4. timing / Counter application

1. Use steps

 Insert picture description here

2. Practical application

 Insert picture description here

原网站

版权声明
本文为[If life is just like the first time 645]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131056452769.html