MCUXpresso SDK Documentation

usart_terminal

usart_terminal#

Overview#

This example demonstrate configuration and use of the USART module in interrupt-driven asynchronous mode on communication with a terminal emulator calling the USART transactional APIs. USART will echo back every character to terminal emulator, and send back all received characters once users press [Enter] key.

Supported Boards#

LPC845BREAKOUT
Hardware requirements
  • Micro USB cable

  • LPC845 Breakout board

  • Personal Computer

Board settings

No special settings are required.

Prepare the demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port on the board.

  2. Open a serial terminal with the following settings:

    • 9600 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

The log below shows the output of the USART terminal driver example in the terminal window:

Usart functional API interrupt example.
Board receives characters then sends them out.
Please input characters and press the Enter key to finish input:

LPCXpresso802
Hardware Requirements
  • Mini/micro USB cable

  • LPCXpresso802 board

  • Personal Computer

Board Settings

No special settings are required.

Run the Case

1.Connect a micro USB cable between the PC host and the CMSIS DAP port(CN1 on the board).

2.Open a serial terminal with the following settings:

  • 9600 baud rate

  • 8 data bits

  • No parity

  • One stop bit

  • No flow control

3.Choose and IDE, building the project and download the program to the target board. More information about how to compile and program the project can refer to the

4.Launch the debugger in your IDE to begin running the demo.

Expected Result
  • Board will print some log infomation first, and prompt users to input some character, the received character will be echo back immediately. Once users press the [Enter] key, board will print all the recieved character.

  • Due to the value of the receive buffer is only 32, once the size of received characters is larger than 32(contain [Enter] key), the overflow infomation will be printed. So, don’t input too many characters in one time.

LPCXpresso804
Hardware Requirements
  • Mini/micro USB cable

  • LPCXpresso804 board

  • Personal Computer

Board Settings

No special settings are required.

Run the Case

1.Connect a micro USB cable between the PC host and the CMSIS DAP port(CN2 on the board).

2.Open a serial terminal with the following settings:

  • 9600 baud rate

  • 8 data bits

  • No parity

  • One stop bit

  • No flow control

3.Choose and IDE, building the project and download the program to the target board. More information about how to compile and program the project can refer to the

4.Launch the debugger in your IDE to begin running the demo.

Expected Result
  • Board will print some log infomation first, and prompt users to input some character, the received character will be echo back immediately. Once users press the [Enter] key, board will print all the recieved character.

  • Due to the value of the receive buffer is only 32, once the size of received characters is larger than 32(contain [Enter] key), the overflow infomation will be printed. So, don’t input too many characters in one time.

LPCXpresso824MAX
Hardware Requirements
  • Mini/micro USB cable

  • LPCXpresso824MAX board

  • Personal Computer

Board Settings

Connect SJ9: 2-3

Run the Case

1.Connect a micro USB cable between the PC host and the CMSIS DAP port(J3 on the board).

2.Open a serial terminal with the following settings:

  • 9600 baud rate

  • 8 data bits

  • No parity

  • One stop bit

  • No flow control

3.Choose and IDE, building the project and download the program to the target board. More information about how to compile and program the project can refer to the

4.Launch the debugger in your IDE to begin running the demo.

Expected Result
  • Board will print some log infomation first, and prompt users to input some character, the received character will be echo back immediately. Once users press the [Enter] key, board will print all the recieved character.

  • Due to the value of the receive buffer is only 32, once the size of received characters is larger than 32(contain [Enter] key), the overflow infomation will be printed. So, don’t input too many characters in one time.

LPCXpresso845MAX
Hardware Requirements
  • Mini/micro USB cable

  • LPCXpresso845MAX board

  • Personal Computer

Board Settings

No special settings are required.

Run the Case

1.Connect a micro USB cable between the PC host and the CMSIS DAP port(J4 on the board).

2.Open a serial terminal with the following settings:

  • 9600 baud rate

  • 8 data bits

  • No parity

  • One stop bit

  • No flow control

3.Choose and IDE, building the project and download the program to the target board. More information about how to compile and program the project can refer to the

4.Launch the debugger in your IDE to begin running the demo.

Expected Result
  • Board will print some log infomation first, and prompt users to input some character, the received character will be echo back immediately. Once users press the [Enter] key, board will print all the recieved character.

  • Due to the value of the receive buffer is only 32, once the size of received characters is larger than 32(contain [Enter] key), the overflow infomation will be printed. So, don’t input too many characters in one time.

LPCXpresso860MAX
Hardware Requirements
  • Micro USB cable

  • LPCXpresso860MAX board

  • Personal Computer

Board Settings

No special settings are required.

Prepare the Demo
  1. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J4) on the board

  2. Open a serial terminal with the following settings:

    • 9600 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Press reset button to begin running the demo.

Running the demo

Monitor the information on the debug console.

Expected Result
  • Board will print some log infomation first, and prompt users to input some character, the received character will be echo back immediately. Once users press the [Enter] key, board will print all the recieved character.

  • Due to the value of the receive buffer is only 32, once the size of received characters is larger than 32(contain [Enter] key), the overflow infomation will be printed. So, don’t input too many characters in one time.