Misleading of UART instance demo in lpcxpresso
Misleading of UART instance demo in lpcxpressoImport the UART project in example project. In the UART. c file, initialize the serial port processing function to assign the initial value of uartcount to 0.
In the main function, after initialization, The uartcount value is used as the judgment condition to write the serial port.
At this time, uartcount = 0, and the statements in if will not be executed, and the terminal will not display any output. Return to UART. c. I defined void uart_irqhandler (void) and concluded that uartcount is a variable used to determine whether uartbuffer overflows.
As a result, we can analyze two methods for transferring serial port work: either modify the initialization handler function, assign the initial value 1 to uartcount, or modify the main function to cancel the judgment statement. In this way, you can smoothly complete the serial writing operation. Of course, it is better not to modify UART. c. After modification, although the applet in the demo can run normally, we recommend that you modify the main function to avoid interfering with the overflow judgment in large programs and affect the normal operation of other functions.