Serial Communication App Format Mode (ASCII)
Mode that adds headers to both transmitted and received outputs (ASCII format)
Each mode is switched by Interactive Mode (some modes can be set via pin input).
ID | Mode |
---|---|
A | Format Mode (ASCII) |
B | Format Mode (Binary) |
C | Chat Mode |
D | Transparent Mode |
E | Header Transparent Mode |
Initial state is Header Transparent Mode.
Due to packet size constraints, please keep the data sent at one time within 80 bytes in binary.
The maximum length of packets in IEEE 802.15.4 adopted by TWELITE is 128 bytes, and considering overhead, the payload area available for the serial communication app is limited to 80 bytes.
If you need to send a large amount of data, please consider other products using Wi-Fi, etc. TWELITE is suitable for efficiently sending small amounts of data.
A
: Format Mode (ASCII)When data is input to the transmitting terminal according to a specific format, the receiving terminal outputs data according to the same specific format.
Data represented in hexadecimal is expressed as ASCII strings.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Simple/Extended format data | → | Simple/Extended format data |
In TWELITE UART, this mode is enabled when started with the SET
pin connected to GND
.
There are two formats to represent data.
For example, 5-byte binary data 0x48 0x45 0x4C 0x4C 0x4F
can be sent using the simple format as follows.
[Transmitting Side]
:000148454C4C4F8B <- Input
:DBA1800103 <- Output
[Receiving Side]
:780148454C4C4F13 <- Output
In format mode, settings such as application ID can be dynamically applied not only by Interactive Mode but also by commands via UART (ASCII format).
B
: Format Mode (Binary)When data is input to the transmitting terminal according to a specific format, the receiving terminal outputs data according to the same specific format.
Data represented in hexadecimal is expressed in binary format as is.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Simple/Extended format data | → | Simple/Extended format data |
In TWELITE / TWELITE DIP, this mode is enabled when started with the EX1
pin connected to GND
.
Like Format Mode (ASCII), there are two formats to represent data.
For example, 5-byte binary data 0x48 0x45 0x4C 0x4C 0x4F
can be sent using the simple format as follows.
[Transmitting Side]
0xA5 0x5A 0x00 0x07 0x00 0x01 0x48 0x45 0x4C 0x4C 0x4F 0x43 0x04 <- Input
0xA5 0x5A 0x00 0x04 0xDB 0xA1 0x80 0x01 0xFB 0x04 <- Output
[Receiving Side]
0xA5 0x5A 0x00 0x07 0x78 0x01 0x48 0x45 0x4C 0x4C 0x4F 0x3B 0x04 <- Output
In format mode, settings such as application ID can be dynamically applied not only by Interactive Mode but also by commands via UART (binary format).
C
: Chat ModeEnables text chat.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Any string | → | Auxiliary information + any string |
Displays prompt and echoes back (outputs the entered characters). All terminals act as child devices and perform broadcast communication.
For example, when a terminal sends the string Hello
to other terminals, the behavior is as follows.
[Transmitting Side]
810A4778:0> Hello <- Input
810A4778:1> <- Output
[Receiving Side]
[810A4778:0] Hello <- Output
82018CA0:0> <- Output
In the above example, the prompt shows the serial ID, but you can also use any handle name.
D
: Transparent ModeWhen arbitrary data is input to the transmitting terminal, the receiving terminal outputs the received data as is.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Any data | → | Any data |
Since no format is required, existing UART communication can be easily wirelessized.
On the other hand, data boundaries become ambiguous, and the receiving output cannot identify the sender, which are drawbacks.
By default, data input to the transmitting side is separated by CRLF, and data before CRLF is sent.
For example, when Hello<Enter>
is input on the transmitting terminal, the receiving terminal outputs Hello
as is.
[Transmitting Side]
Hello <- Input
[Receiving Side]
Hello <- Output
E
: Header Transparent ModeWhen arbitrary data is input to the transmitting terminal, the receiving terminal outputs the received content with auxiliary information added in a specific format.
Input on Transmitting Side | Output on Receiving Side | |
---|---|---|
Any data | → | Any data + auxiliary information |
By default, data input to the transmitting side is separated by CRLF, and data before CRLF is sent.
For example, when Hello<Enter>
is input on the transmitting terminal, the receiving terminal outputs Hello
in a format including auxiliary information. The transmitting terminal also outputs a format that conveys a transmission completion message.
[Transmitting Side]
Hello <- Input
;U;00004;219;0x820163B2;000;000;0,1,Hel...;6E; <- Output
[Receiving Side]
;U;00003;000;0x820163B2;255;000;Hello;42; <- Output
The auxiliary information output by the receiving side includes the sender’s address, received signal strength, checksum, etc. The format of auxiliary information can be customized.
Mode that adds headers to both transmitted and received outputs (ASCII format)
Mode that adds headers to both transmitted and received outputs (binary format)
Mode that displays prompts and performs echo back
Mode that purely wirelesss UART
Mode that adds headers only to the received output