Misleading of UART instance demo in lpcxpresso

Source: Internet
Author: User

Misleading of UART instance demo in lpcxpresso

Misleading of UART instance demo in lpcxpresso

Import 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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.