This is the multi-page printable view of this section. Click here to print...

Return to the regular view of this page

As of 2025-07-24

Transmitting Binary Data

Transmit arbitrary bytes via UART communication
    By using the Serial Communication App, you can send and receive arbitrary binary data.

    Products Used

    TWELITE DIPTWELITE R2
    TWELITE Parent/ChildUSB Adapter
    Serial Communication App-
    2 units2 units

    Note: The TWELITE DIP and TWELITE R2 pair is equivalent to a single MONOSTICK. The following combination is also acceptable.

    MONOSTICK
    TWELITE Parent/Child
    Serial Communication App
    2 units

    Serial Communication App

    Rewrite the TWELITE firmware to the Serial Communication App (App_Uart), which is specialized for wireless serial communication. While the “Extremely Simple! Standard App” also has a function for transmitting binary data via serial communication, its functionality is very limited.

    Writing Firmware

    Rewrite all Parent, Child, and Repeater devices.

    1. Install the TWELITE STAGE SDK and launch the TWELITE STAGE App
    2. From Serial Port Selection, select the connected device
    3. From the “Main Menu”, select “2: App Write
    4. Choose “1: Select from BIN” and select App_Uart...
    5. Press Enter several times until the write is complete

    List of Communication Modes

    The Serial Communication App provides five communication modes, allowing you to select the most suitable one for your application.

    By default, the app starts in Header Transparent Mode.

    Below, we introduce communication test procedures using four of these modes. Please select and try the mode that interests you.

    • Header Transparent Mode
      • No format is applied on the transmitting side.
      • The receiver’s output format provides information such as the logical device ID of the sender and the received radio signal quality.
      • This is a well-balanced mode.
    • Transparent Mode
      • No format is applied to either transmission or reception.
      • The input on the transmitting side and the output on the receiving side are equivalent.
      • This is the simplest mode, but functionality is limited.
    • Format Mode (ASCII)
      • Applies a format to both transmission and reception.
      • Requires external devices to support the format, but allows you to specify the destination and identify the sender.
      • Binary data is represented as hexadecimal strings.
    • Format Mode (Binary)
      • Applies a format to both transmission and reception.
      • Requires external devices to support the format, but allows you to specify the destination and identify the sender.
      • Binary data is represented as-is.

    In this example, we will connect two TWELITEs to the same PC and loop back data. Normally, you would use this to connect external devices wirelessly.

    Header Transparent Mode

    Let’s use Header Transparent Mode to send the ASCII string Hello from both sides.

    How to Configure

    The default mode of the Serial Communication App is Header Transparent Mode. Therefore, you can use it as-is with the initial settings.

    Communication Test

    1. Launch Two TWELITE STAGE Apps

    Start two instances of the TWELITE STAGE App (TWELITE_Stage.exe/.command/.run).

    2. Open the Terminal

    After selecting the serial port on both TWELITE STAGE Apps, choose “1: Viewer” > “1: Terminal”.

    3. Send from One Side

    Select one of the windows, type Hello, and press Enter. The message will appear in the other window.

    Send from One Side

    Send from One Side

    4. Send from the Other Side

    Select the other window, type Hello, and press Enter. The message will appear in the original window.

    Send from the Other Side

    Send from the Other Side

    Transparent Mode

    Let’s try sending the ASCII string Hello from both sides using Transparent Mode.

    How to Configure

    Set m: Communication Mode to D.

    Communication Test

    1. Launch Two TWELITE STAGE Apps

    Start two instances of the TWELITE STAGE App (TWELITE_Stage.exe/.command/.run).

    2. Open the Terminal

    In both TWELITE STAGE Apps, after selecting the serial port, choose “1: Viewer” > “1: Terminal”.

    3. Send from One Side

    Select one of the windows, type Hello, and press Enter. The message will appear in the other window.

    Send from One Side

    Send from One Side

    4. Send from the Other Side

    Select the other window, type Hello, and press Enter. The message will appear in the original window.

    Send from the Other Side

    Send from the Other Side

    Since no formatting is applied to either input or output, the data you enter is output as-is.

    Hello

    Format Mode (ASCII)

    Let’s use Format Mode (ASCII) to send the binary data 0x5A 0xAB 0x90 0x00 from both sides.

    Saab 9000 CD 2.3

    Saab 9000 CD 2.3

    How to Configure

    Set m: Communication Mode to A.

    Set i: Logical Device ID to 0 (Parent) on one device, and to 1 (Child, ID 1) on the other.

    Communication Test (Simple Format)

    Let’s first try the simple, basic format.

    1. Launch Two TWELITE STAGE Apps

    Start two instances of the TWELITE STAGE App (TWELITE_Stage.exe/.command/.run).

    2. Open the Terminal

    After selecting the serial port in both TWELITE STAGE Apps, choose “1: Viewer” > “1: Terminal”.

    3. Send from the Parent Side

    First, copy the following sequence:

    :01235AAB900047

    Next, select the Parent side window.

    Finally, paste with Alt+V/⌘+V and press Enter. The data will be reflected on the Child side window.

    Send from Parent Side

    Send from Parent Side

    4. Send from the Child Side

    First, copy the following sequence:

    :00235AAB900048

    Next, select the Child side window.

    Finally, paste with Alt+V/⌘+V and press Enter. The data will be reflected on the Parent side window.

    Send from Child Side

    Send from Child Side

    Communication Test (Extended Format)

    Next, let’s try the advanced extended format.

    1. Launch Two TWELITE STAGE Apps

    Start two instances of the TWELITE STAGE App (TWELITE_Stage.exe/.command/.run).

    2. Open the Terminal

    After selecting the serial port in both TWELITE STAGE Apps, choose “1: Viewer” > “1: Terminal”.

    3. Send from the Parent Side

    First, copy the following sequence:

    :01A0CDFF5AAB9000FE

    Next, select the Parent side window.

    Finally, paste using Alt+V/⌘+V and press Enter. The data will appear in the Child side window.

    Send from Parent Side

    Send from Parent Side

    4. Send from the Child Side

    First, copy the following sequence:

    :00A0CDFF5AAB9000FF

    Next, select the Child side window.

    Finally, paste using Alt+V/⌘+V and press Enter. The data will appear in the Parent side window.

    Send from Child Side

    Send from Child Side

    Format Mode (Binary)

    Let’s use Format Mode (Binary) to send the binary data 0x5A 0xAB 0x90 0x00 from both sides.

    Saab 9000 CD 2.3

    Saab 9000 CD 2.3

    How to Configure

    Set m: Communication Mode to B.

    Set the i: Logical Device ID to 0 (Parent) on one terminal, and to 1 (Child, ID 1) on the other.

    Prepare an Environment that Supports Binary Data

    The terminal features of the TWELITE STAGE App and TeraTerm do not support binary data. You need to use a terminal software that supports binary format.

    Here, we use CoolTerm as an example.

    Communication Test (Simple Format)

    Let’s first try the simple, basic format.

    1. Open Two CoolTerm Windows

    Open two CoolTerm windows and connect each to a device.

    To display received data in hexadecimal, select View > View Hex. Click Connect to connect.

    Two CoolTerm windows open

    Two CoolTerm windows open

    2. Send from the Parent Side

    Select the Parent window, then choose Connection > Send String... to open the send window, and select the Hex radio button.

    Send window open

    Send window open

    Enter the following and click Send to transmit from the Parent.

    A5 5A 80 06 01 23 5A AB 90 00 43 04
    Send from Parent Side

    Send from Parent Side

    3. Sending from the Child Side

    Just as with the Parent, select the Child window, then go to Connection > Send String... to open the send window, and make sure the Hex radio button is selected.

    Enter the following content and click Send to transmit to the Parent.

    A5 5A 80 06 00 23 5A AB 90 00 42 04
    Send from Child Side

    Send from Child Side

    Communication Test (Extended Format)

    Next, let’s try the advanced extended format.

    1. Open Two CoolTerm Windows

    Open two CoolTerm windows and connect each to a device.

    To display received data in hexadecimal, select View > View Hex. Click Connect to connect.

    Two CoolTerm windows open

    Two CoolTerm windows open

    2. Send from the Parent Side

    Select the Parent window, then choose Connection > Send String... to open the send window, and select the Hex radio button.

    Send window open

    Send window open

    Enter the following and click Send to transmit to the Child.

    A5 5A 80 08 01 A0 CD FF 5A AB 90 00 F2 04
    Send from Parent Side

    Send from Parent Side

    3. Send from the Child Side

    As with the Parent, select the Child window, then go to Connection > Send String... to open the send window, and make sure the Hex radio button is selected.

    Enter the following and click Send to transmit to the Parent.

    A5 5A 80 08 00 A0 CD FF 5A AB 90 00 F3 04
    Send from Child Side

    Send from Child Side