For those of you who have ever programmed 8051 UART interfaces, web-based sites are not interested in interrupting UART, they Just write a function that continuously handles uart communication. This causes the processor to take the time to perform the uart function.
Processors will always take time to process the “callback () function.” Assuming you want to communicate and perform other functions such as blinking leds, LEDs, or PWM control, the motor is very difficult. The main program takes a lot of time to process the UART program. This section will guide you to use the UART interrupt. When the data is sent, the program will automatically run through the interrupt routine. When done, it will automatically exit to do other work, help you just communicate with uart programmable scan led or motor control with pulsed PWM
Program code: The program is to send the data array to uart. Use timer 2 to create time, every 200ms to send data once.
In the main program we do not execute any commands and still communicate with uart. You can use this program to write more functions you want.