UART Element
The UART element is used to read and write data over UART on the end device’s transmit (Tx) and receive (Rx) lines.
The UART element is located in the Element Toolbox within Studio’s Embedded tab.
Properties
The following properties can be changed for the UART element:
Name
The name of the element.
Instance
The UART driver instance number to use. If unsure leave it set to the default value.
Number of Read Bytes
The number of bytes the element will read up to at a time.
Number of Write Bytes
The number of bytes the element will write up to at a time.
Triggers
The following triggers are available to execute events from within the UART element:
Triggered
Execute an event when the source element connected to the UART triggers.
Read
Execute an event when the UART’s value is read.
Byte Received
Execute an event when a byte is received over the end device’s Rx line.
Written
Execute an event when data is written over the end device’s Tx line.
Written Blocking
Execute an event when data is written over the end device’s Tx line while blocking execution.
Abilities
The following abilities are available for the UART element when its source element triggers:
Trigger
Trigger the element(s) that follow the UART element.
Read
Read data over the end device’s Rx line.
Receive Byte
Receive byte(s) over the end device’s Rx line.
Write
Write data over the end device’s Tx line.
Write Blocking
Write data over the end device’s Tx line block execution until all data is flushed from the TX buffer out the line.
Element Resources
Atmosphere includes a selection of resources for users of all levels that demonstrate using the UART element.
Demo Projects
To view the UART element used within a project, click the demo’s name to open the project in Atmosphere and see how the element is set up.
Name | Hardware | Description |
---|---|---|
UART Element Demo | Arduino Mega | The UART element is used within this demo project that sends “Hello123” one byte at a time over UART while also demonstrating the buffering and RegEx capabilities of Atmosphere’s UART driver. Note this demo uses UART2, and connect IO18 and IO19 on the Arduino Mega to send TX back to RX. |