UART Commands

CFG

Gets/sets the UART configuration by passing a configuration string. This allows for the configuration of databits, parity, and stopbits using a single command. The default configuration is 8 (databits), N (no parity), 1 (stopbits).
Set the UART configuration: UART0 CFG [databits] [parity] [stopbits]
Get the current UART configuration: UART0 CFG ?
Parameters:
The databits parameter can be set to 5, 6, 7, or 8.
The parity parameter can be set as follows:
    To set the parity to NONE, use NONE, 0, or N
    To set the parity to ODD, use ODD, 1, or O
    To set the parity to EVEN, use EVEN, 2, or E
The stopbits parameter can be set to either 1 or 2.
Response:
Set: This function returns an ACK Response if the command succeeds in setting the configuration. If the command fails, the function will return a NAK Response.
Get: This function returns -UART0 followed by CFG followed by the current databits, parity, and stopbits values separated by whitespaces.
Example Usage:
1
UART0 CFG ?
2
-UART0 CFG 8 N 1
3
4
UART0 CFG 8 1 2
5
-OK
Copied!

BAUD

Gets/sets the baudrate of the UART connection. The default baudrate is 9600 bps.
Set the UART baudrate: UART0 BAUD [rate]
Get the current UART baudrate: UART0 BAUD ?
Parameters:
The rate parameter can be set to from 300 to 1000000 bps.
Response:
Set: This function returns an ACK Response if the command succeeds in setting the baudrate. If the command fails, the function will return a NAK Response.
Get: This function returns -UART0 followed by BAUD followed by the current baudrate.
Example Usage:
1
UART0 BAUD ?
2
-UART0 BAUD 9600
3
4
UART0 BAUD 115200
5
-OK
Copied!

DATABITS

Gets/sets the number of databits for the UART connection. The default databits setting is 8.
Set the number of databits: UART0 DATABITS [bits]
Get the current number of databits: UART0 DATABITS ?
Parameters:
The bits parameter can be set to 5, 6, 7, or 8.
Response:
Set: This function returns an ACK Response if the command succeeds in setting the number of databits. If the command fails, the function will return a NAK Response.
Get: This function returns -UART0 followed by DATABITS followed by the current number of databits.
Example Usage:
1
UART0 DATABITS ?
2
-UART0 DATABITS 8
3
4
UART0 DATABITS 7
5
-OK
Copied!

PARITY

Gets/sets the parity bit configuration for the UART connection. The default parity setting is None.
Set the UART parity: UART0 PARITY [par]
Get the current UART parity: UART0 PARITY ?
Parameters:
The par parameter can be set as follows:
    To set the parity to NONE, use NONE, 0, or N
    To set the parity to ODD, use ODD, 1, or O
    To set the parity to EVEN, use EVEN, 2, or E
Response:
Set: This function returns an ACK Response if the command succeeds in setting the desired parity configuration. If the command fails, the function will return a NAK Response.
Get: This function returns -UART0 followed by PARITY followed by the current parity setting.
Example Usage:
1
UART0 PARITY ?
2
-UART0 PARITY NONE
3
4
UART0 PARITY E
5
-OK
6
7
UART0 PARITY ?
8
-UART0 PARITY EVEN
Copied!

STOPBITS

Gets/sets the number of stop bits for the UART connection. The default number of stopbits is 1.
Set the number of stopbits: UART0 STOPBITS [bits]
Get the current number of stopbits: UART0 STOPBITS ?
Parameters:
The bits parameter can be set to either 1 or 2.
Response:
Set: This function returns an ACK Response if the command succeeds in setting the desired number of stopbits. If the command fails, the function will return a NAK Response.
Get: This function returns -UART0 followed by STOPBITS followed by the current number of stopbits.
Example Usage:
1
UART0 STOPBITS ?
2
-UART0 STOPBITS 1
3
4
UART0 STOPBITS 2
5
-OK
Copied!

ESC

Gets/sets the escape sequence that can be used to break out of the UART bridge mode. The default escape sequence is +++UART0.
Set the escape sequence: UART0 ESC [sequence]
Get the current escape sequence: UART0 ESC ?
Parameters:
The sequence parameter must be a string of 6 to 16 characters.
Response:
Set: This function returns an ACK Response if the command succeeds in setting the desired escape sequence. If the command fails, the function will return a NAK Response.
Get: This function returns -UART0 followed by ESC followed by the current escape sequence.
Example Usage:
1
UART0 ESC ?
2
-UART0 ESC +++UART0
3
4
UART0 ESC +!+!+!456
5
-OK
Copied!

BEGIN

Starts the UART bridge. The adapter will remain in UART bridge mode until the escape sequence is sent from the host computer.
Start the UART bridge: UART0 BEGIN
Parameters:
This command takes no parameters.
Response:
Set: This function returns an ACK Response if the command succeeds in opening the UART bridge. If the command fails, the function will return a NAK Response.
Example Usage:
1
UART0 ESC ?
2
-UART0 ESC +++UART0
3
4
UART0 BEGIN
5
-OK
6
7
Hello!
8
Ascii Bridge Content
9
10
+++UART0
11
-OK
12
Copied!
Last modified 1yr ago