usart_transfer_sync_mode#
Overview#
The usart_interrupt_sync_transfer example shows how to use usart API in synchronous mode:
In this example, one usart instance will be selected as master ,and another as slave. The master will send data to slave in polling way, and slave will receive data in nonblocking way. After all data has been received by slave, info will be printed by debug console.
Supported Boards#
LPC845BREAKOUT
Hardware requirements
Micro USB cable
LPC845 Breakout board
Personal Computer
Board settings
Please connect the USART1_CLK(P0_26) pin to USART2_CLK(P0_27) pin directly. No need to connect other pins. The data pins are shared.
Prepare the demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port on the board.
Open a serial terminal with the following settings:
9600 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
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 transfer using sync mode driver example in the terminal window:
Usart synchronous transfer example.
Master USART will send data to slave on one board.
All data matched, data transfer success!
LPCXpresso824MAX
Hardware requirements
Mini/micro USB cable
LPCXpresso824MAX board
Personal Computer
Board settings
Please connect the USART1_CLK pin to USART2_CLK pin directly. No need to connect other pins. The data pins are shared.
P0_24(J1-8) -> P0_25(J1-7)
Prepare the Demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port on the board
Open a serial terminal with the following settings:
9600 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
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 hello world demo in the terminal window:
Usart synchronous transfer example.
Master USART will send data to slave on one board.
All data matched, data transfer success!
LPCXpresso845MAX
Hardware requirements
Mini/micro USB cable
LPCXpresso845MAX board
Personal Computer
Board settings
Please connect the USART1_CLK pin to USART2_CLK pin directly. No need to connect other pins. The data pins are shared.
P0_24(J2-8) -> P0_25(J2-7)
Prepare the Demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port on the board
Open a serial terminal with the following settings:
9600 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
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 hello world demo in the terminal window:
Usart synchronous transfer example.
Master USART will send data to slave on one board.
All data matched, data transfer success!
LPCXpresso860MAX
Hardware requirements
Micro USB cable
LPCXpresso860MAX board
Personal Computer
Board settings
Please connect the USART1_CLK pin to USART2_CLK pin directly. No need to connect other pins. The data pins are shared.
P0_24(J2-2 on board) -> P0_25(J2-4 on board)
Prepare the Demo
Connect a micro USB cable between the PC host and the CMSIS DAP USB port on the board
Open a serial terminal with the following settings:
9600 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
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 hello world demo in the terminal window:
Usart synchronous transfer example.
Master USART will send data to slave on one board.
All data matched, data transfer success!