Download
To install the Extremely Simple! Standard App (App_Twelite
), install the TWELITE STAGE SDK and rewrite using the TWELITE STAGE App.
This is the multi-page printable view of this section. Click here to print...
To install the Extremely Simple! Standard App (App_Twelite
), install the TWELITE STAGE SDK and rewrite using the TWELITE STAGE App.
Pin Assignment Table
Pin Name | Function |
---|---|
VCC GND | Power Input |
DIx AIx | Digital/Analog Input |
DOx PWMx | Digital/Analog Output |
TX RX | UART |
SCL SDA | I2C |
Mx BPS | Configuration Input |
RST | Reset Input |
x
represents any digit. For example, M1
M2
M3
are collectively represented as Mx
.Connect a 3.3V (2.3-3.6V) power supply to VCC
/GND
.
DIx
/DOx
, AIx
/PWMx
pins transmit signals synchronously with matching pin numbers.
Digital | Analog |
---|---|
Input on DIx → Output on DOx | Input on AIx → Output on PWMx |
In the Extremely Simple! Standard App, the voltage range for analog input is set to 0-2V.
If a voltage above 2V is input, such as by connecting to VCC
, it will be treated as unused.
TX
/RX
are used for UART transmission and reception. Specifically, they are used in the following cases:
SCL
/SDA
pins are used to connect I2C target devices.
By leaving the Mx
pins unconnected or connecting them to GND
, you can switch operation modes such as parent, child, and repeater (Operation Modes).
By leaving the BPS
pin unconnected or connecting it to GND
, you can change the UART baud rate from 115200bps to other values (Alternative Baudrate).
By connecting a push button between the reset input pin RST
and GND
, you can implement a reset button. RST
is internally pulled up.
Each mode is set by leaving the Mx
pin unconnected or connecting it to GND
.
M3 | M2 | M1 | Mode | Function | Power | Initial |
---|---|---|---|---|---|---|
O | O | O | Child: | Sends input status to parent, | 120 | |
O | O | G | Parent: | Sends input status to child, | 0 | |
O | G | O | Repeater: | Always waits for received data | 122 | |
O | G | G | Child: | Frequently sends input status to parent, | 123 | |
G | O | O | Child: | Sends input status to parent every 1 second, | ✅ | 124 |
G | O | G | Child: | Sends input status to parent every 1 second, | ✅ | 125 |
G | G | O | - | Unused | - | - |
G | G | G | Child: | Sends input status to parent every 10 seconds, | ✅ | 127 |
O: Not connected (OPEN), G: Connected to
GND
Initial state is Child: Continuous mode.
The initial Logical Device ID (LID) used to identify the device varies depending on the mode.
Only in Parent or Repeater modes, the LID can be switched via Interactive Mode.
Please use 121
for Parent and 122
for Repeater.
AIx
portsIn Child: Continuous / Child: Continuous 0.03s / Parent: Continuous modes, please connect unused AIx
ports to VCC
.
Unused AIx
ports report undefined values. These modes send data when there is a change in input signals, which may cause unnecessary data transmission.
When input signals change or every 1 second, data is sent to all child devices.
It always waits for data sent from child devices, providing good responsiveness but continuously consuming power.
0x00000002
in Interactive Mode.When input signals change or every 1 second, data is sent to all parent devices.
It always waits for data sent from parent devices, providing good responsiveness but continuously consuming power.
Communication image with parent device
0x00000002
in Interactive Mode.This mode shortens the periodic transmission interval of Child: Continuous Mode from 1 second to 0.03 seconds.
Although it always waits for data sent from the parent, the communication from child to parent occupies the bandwidth, making the parent’s input response slower. It continuously consumes power.
Communication image with parent device
When input signals change or every 1 second, power-saving mode is canceled and data is sent to all parent devices.
Reception is disabled, so control from the parent device is not possible. This mode has excellent power-saving performance.
Communication image with parent device
When input signals change or every 10 seconds, power-saving mode is canceled and data is sent to all parent devices.
Reception is disabled, so control from the parent device is not possible. This mode has excellent power-saving performance.
Communication image with parent device
When input signals change or every 1 second, power-saving mode is canceled and data is sent to all parent devices.
Reception is also performed every 1 second. It has excellent power-saving performance but is inferior to Child: Intermittent 1s Mode.
Communication image with parent device
The repeater forwards received packets.
Up to three repeaters can be installed between parent and child devices, but increasing repeaters increases the number of packets, which may cause interference.
Image of relaying
0x00008000
in the option bits of Interactive Mode.You can enable the alternative baud rate setting by connecting the BPS
pin to GND
.
BPS | Description | Baud Rate | Remarks |
---|---|---|---|
O | Default | 115200bps | |
G | Override Setting | 38400bps | Can be changed via Interactive Mode |
O
: Not connected (OPEN), G
: Connected to GND
BPS
pin is not connected to GND
, the Interactive Mode setting will not be applied.0x81
: Status Notification from Remote DeviceOutputs the state of the received input signals.
# | Data | Content | Note |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Source Logical Device ID | |
1 | uint8 | Command Number | 0x81 only |
2 | uint8 | Packet Identifier | Generated from Application ID |
3 | uint8 | Protocol Version | 0x01 only |
4 | uint8 | LQI | 0 -255 |
5 | uint32 | Source Serial ID | 0x8??????? |
9 | uint8 | Destination Logical Device ID | |
10 | uint16 | Timestamp | 64 counts per second |
12 | uint8 | Relay Count | |
13 | uint16 | Power Supply Voltage | Unit is mV |
15 | int8 | - | (Unused) |
16 | uint8 | Digital Signals | Corresponds to DIx from LSB, 0 is HighMSB 1 means periodic transmission |
17 | uint8 | Digital Signal Mask | Corresponds to DIx from LSB, 1 is valid |
18 | uint8 | Conversion Value of AI1 | See Calculation of Analog Signals, 0xFF means unused |
19 | uint8 | Conversion Value of AI2 | See Calculation of Analog Signals, 0xFF means unused |
20 | uint8 | Conversion Value of AI3 | See Calculation of Analog Signals, 0xFF means unused |
21 | uint8 | Conversion Value of AI4 | See Calculation of Analog Signals, 0xFF means unused |
22 | uint8 | Correction Value of AIx | Corresponds to AIx in 2-bit units from LSB |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
The input voltage \(V\) of AIx
can be expressed using the received conversion value \(e_{r}\) and correction value \(e_{fr}\) as follows:
Unit: mV
:78811501C98201015A000391000C2E00810301FFFFFFFFFB
# | Data | Content | Value | |
---|---|---|---|---|
: | char | Header | : | |
78 | 0 | uint8 | Source Logical Device ID | 0x78 |
81 | 1 | uint8 | Command Number | 0x81 |
15 | 2 | uint8 | Packet Identifier | 0x15 |
01 | 3 | uint8 | Protocol Version | 0x01 |
C9 | 4 | uint8 | LQI | 201/255 |
8201015A | 5 | uint32 | Source Serial ID | 0x201015A |
00 | 9 | uint8 | Destination Logical Device ID | 0x00 |
0391 | 10 | uint16 | Timestamp | About 14.27 seconds |
00 | 12 | uint8 | Relay Count | 0 |
0C2E | 13 | uint16 | Power Supply Voltage | 3118 mV |
00 | 15 | int8 | - | |
81 | 16 | uint8 | Digital Signals | DI1 Low DI2 HighDI3 High DI4 High(Periodic transmission) |
03 | 17 | uint8 | Digital Signal Mask | DI1 DI2 |
01 | 18 | uint8 | Conversion Value of AI1 | 16 mV |
FF | 19 | uint8 | Conversion Value of AI2 | Unused |
FF | 20 | uint8 | Conversion Value of AI3 | Unused |
FF | 21 | uint8 | Conversion Value of AI4 | Unused |
FF | 22 | uint8 | Correction Value of AIx | AI1 0x03 |
FB | uint8 | Checksum | 0xFB | |
char | Footer | \r | ||
char | Footer | \n |
0x80
: Remote Device Output ChangeControls the output signals of the remote device.
# | Data | Content | Note |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , All Children 0x78 |
1 | uint8 | Command Number | 0x80 only |
2 | uint8 | Format Version | 0x01 only |
3 | uint8 | Digital Signals | Corresponds to DOx from LSB, 0 is High |
4 | uint8 | Digital Signal Mask | Corresponds to DOx from LSB, 1 is valid |
5 | uint16 | PWM1 Signal | 0 -1024 , 0xFFFF means disabled |
7 | uint16 | PWM2 Signal | 0 -1024 , 0xFFFF means disabled |
9 | uint16 | PWM3 Signal | 0 -1024 , 0xFFFF means disabled |
11 | uint16 | PWM4 Signal | 0 -1024 , 0xFFFF means disabled |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0x01
: Transmission of Arbitrary Data# | Data | Content | Note |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , All Children 0x78 |
1 | uint8 | Command Number | 0x01 only |
2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) (recommended \(N\leqq80\)) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0x01
in the Format Mode (ASCII) simple format of the Serial Communication App.0x01
: Reception of Arbitrary Data# | Data | Content | Note |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , Child 0x01 -0x64 , Unset Child 0x78 |
1 | uint8 | Command Number | 0x01 only |
2 | [uint8] | Arbitrary Data | Byte sequence of length \(N\) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0x01
in the Format Mode (ASCII) simple format of the Serial Communication App.0x88
: I2C Input# | Data | Content | Note |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Destination Logical Device ID | Parent 0x00 , Child 0 -0x7F , All Children 0x78 , Self 0xDB |
1 | uint8 | Packet Identifier | 0x88 only |
2 | uint8 | Response Number | Number output to response message |
3 | uint8 | Command Number | Write 0x1 , Read 0x2 , Read/Write 0x4 |
4 | uint8 | I2C Address | 7-bit |
5 | uint8 | I2C Command | First command byte |
6 | uint8 | Data Size | 0 means none |
7 | [uint8] | Data | Byte sequence of length \(N\) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
0x4
, specify the data size to read and omit the data. The specified I2C command is written, and the specified amount of data is read.0x89
: I2C Output# | Data | Content | Note |
---|---|---|---|
char | Header | : only | |
0 | uint8 | Source Logical Device ID | Parent 0x00 , Child 0 -0x7F , All Children 0x78 , Self 0xDB |
1 | uint8 | Packet Identifier | 0x89 only |
2 | uint8 | Response Number | Number output to response message |
3 | uint8 | Command Number | Write 0x1 , Read 0x2 , Read/Write 0x4 |
4 | uint8 | Result | Failure 0 , Success 1 |
5 | uint8 | Data Size | 0 means none |
6 | [uint8] | Data | Byte sequence of length \(N\) |
uint8 | Checksum | LRC8 | |
char | Footer | CR (0x0D /'\r' ) | |
char | Footer | LF (0x0A /'\n' ) |
This section explains functions specific to the Extremely Simple! Standard App (App_Twelite). For common features, please refer to the TWELITE APPS manual top page.
Interactive Mode cannot be used while TWELITE is sleeping.
Set the Mx
pin settings to Child Continuous Mode or Parent/Relay Mode.
The following screen is displayed.
--- CONFIG/TWELITE APP V1-08-2/SID=0x8201001f/LID=0x78 ---
a: set Application ID (0x67720102)
i: set Device ID (--)
c: set Channels (18)
x: set Tx Power (03)
t: set mode4 sleep dur (1000ms)
y: set mode7 sleep dur (10s)
f: set mode3 fps (32)
z: set PWM HZ (1000,1000,1000,1000)
o: set Option Bits (0x00000000)
b: set UART baud (38400)
p: set UART parity (N)
---
S: save Configuration
R: reset to Defaults
Command Item | Default | Remarks | |
---|---|---|---|
a | Application ID | 0x67720102 | 32bit |
i | Logical Device ID | Auto | Child 1 -100 , Parent 121 , Relay 122 |
c | Frequency Channel | 18 | 11 -26 |
x | Transmission Output and Retry Count | 03 | |
Retry Count | 0 | 1 -9 times, 0 means default 2 times, F disables | |
Transmission Output | 3 | 0 -3 | |
t | Child Intermittent 1-second Mode Interval | 1000 | 100 -10000 ms |
y | Child Intermittent 10-second Mode Interval | 10 | 2 -10000 s |
f | Child Continuous 0.03-second Mode Cycle | 32 | 4 /8 /16 /32 times per second |
z | PWMx Frequency | 1000 | 1 -64000 Hz, individually set by comma separation |
o | Option Bits | 0x00000000 | Other detailed settings |
b | UART Alternative Baud Rate | 38400 | Enabled by BPS pin |
p | UART Parity | N | 8-( N /O /E )-1 |
Details of each command are shown below.
a
: Application IDAll devices communicating must share the same value. It logically separates networks.
i
: Logical Device IDSet when it is necessary to identify multiple child devices.
Set any value from 1
to 100
for child devices, 121
for parent devices, and 122
for relay devices.
121
or 122
switches to parent or relay mode. In this case, Mx
pin settings are not required.In the Extremely Simple! Standard App, the initial value of Logical Device ID differs depending on the operation mode.
c
: Frequency ChannelAll devices communicating must share the same value. It physically separates networks.
x
: Transmission Output and Retry CountSpecify the radio transmission output and the number of additional packet transmissions.
t
: Child Intermittent 1-second Mode IntervalOverrides the intermittent interval of the child intermittent 1-second mode from 1 second to another value. Unit is milliseconds.
Setting 0
disables periodic wakeup by timer. In this case, wakeup occurs on falling edge of DIx
but not on rising edge.
y
: Child Intermittent 10-second Mode IntervalOverrides the intermittent interval of the child intermittent 10-second mode from 10 seconds to another value. Unit is seconds.
Setting 0
disables periodic wakeup by timer. In this case, wakeup occurs on falling edge of DIx
but not on rising edge.
f
: Child Continuous 0.03-second Mode CycleOverrides the number of transmission requests per second from 32 times to 4
/8
/16
times. Retry count is not included.
z
: PWMx
FrequencyIf one value is specified, it overrides the frequency of all PWM ports. If specified by comma separation, individual values for PWM1
to PWM4
can be overridden.
o
: Option BitsSpecify a 32bit number. Enables settings linked to each bit.
Target Bit | Setting Item | Initial | Transmission | Reception | Continuous | Intermittent |
---|---|---|---|---|---|---|
0x00000001 | Low Latency Mode | 0️⃣ | ✅ | ✅ | ✅ | |
0x00000002 | Disable Periodic Transmission | 0️⃣ | ✅ | ✅ | ||
0x00000004 | Disable Periodic Transmission and UART Output | 0️⃣ | ✅ | ✅ | ||
0x00000010 | Disable Transmission on AIx Change | 0️⃣ | ✅ | ✅ | ||
0x00000020 | Disable AIx Value | 0️⃣ | ✅ | ✅ | ✅ | |
0x00000040 | Change PWMx Calculation Formula | 0️⃣ | ✅ | ✅ | ✅ | |
0x00000100 | Transmit Only When Button Pressed | 0️⃣ | ✅ | ✅ | ✅ | |
0x00000800 | Disable Internal Pull-up of DIx | 0️⃣ | ✅ | ✅ | ✅ | |
0x00008000 | Add Relay Function to Child | 0️⃣ | ✅ | ✅ | ✅ | |
0x00001000 | Set Max Relay Steps to 2 for Child Relay | 0️⃣ | ✅ | ✅ | ✅ | |
0x00002000 | Set Max Relay Steps to 3 for Child Relay | 0️⃣ | ✅ | ✅ | ✅ | |
0x00010000 | Invert PWMx Waveform | 0️⃣ | ✅ | ✅ | ||
0x00020000 | Turn Off PWMx After Startup | 0️⃣ | ✅ | ✅ | ||
0x00080000 | Alternative Port Assignment | 0️⃣ | ✅ | ✅ | ✅ | ✅ |
0x00100000 | Turn Off DOx for 2 Seconds After Startup | 0️⃣ | ✅ | ✅ | ||
0x00400000 | Invert DOx Output | 0️⃣ | ✅ | ✅ | ✅ | |
0x00800000 | Disable Internal Pull-up of DOx | 0️⃣ | ✅ | ✅ | ✅ |
b
: UART Alternative Baud RateOverrides the alternative baud rate selected when the BPS
pin is connected to GND
at startup from 38400
bps.
Values can be selected from 9600
/19200
/38400
/57600
/115200
/230400
. Specifying other values may cause errors.
This setting is not applied when the BPS
pin is left open at startup. The baud rate is fixed at 115200
bps.
This is a specification to prevent situations where Interactive Mode becomes unusable due to baud rate changes.
p
: UART ParityN
means no parity, O
means odd parity, and E
means even parity.
Data bits are fixed to 8, stop bits to 1. Hardware flow control cannot be set.
Explanation of settings linked to each bit of the Option Bits value.
00000001
: Low Latency ModeLow Latency Mode shortens the delay on the receiver side by quickly transmitting after detecting changes in DIx
.
In the initial state, there is a delay of about 30-70ms until DIx
is reflected on DOx
. Low Latency Mode shortens this delay to about 3-10ms by simplifying processing to avoid chattering and wireless packet interference.
00000002
: Disable Periodic TransmissionDisables periodic transmission every 1 second in continuous mode for child devices.
00000004
: Disable Periodic Transmission and UART OutputFor child devices: disables periodic transmission every 1 second in continuous mode and stops UART output of received data.
00000010
: Disable Transmission on AIx
ChangeFor child devices: disables transmission when AIx
input changes in continuous mode.
Since released AIx
ports report undefined values, connect them to VCC
when analog input is not used. This option allows omission of connection to VCC
.
00000020
: Disable AIx
ValueSends packets treating unused ports as 0xFFFF
without using ADC measurement values.
00000040
: Change PWMx
Calculation FormulaBy default, adjusted output for volume control is applied to PWMx
.
This option disables that and outputs full scale for inputs below 1.8V.
Duty cycle \(duty\) can be expressed using input voltage \(V_{input}\) and power supply voltage \(V_{cc}\) as in (1).
When this option is enabled, (2) is applied instead.
Note that inputs above 2.0V are treated as unused.
00000100
: Transmit Only When Button PressedContinuously transmits packets when DIx
input is Low.
For example, used to remotely control a motor. The motor runs while the remote button is pressed and stops when the radio signal is lost.
DIx
is Low, transmits 32 times per secondDIx
transitions to HighDOx
transitions to Low, all DOx
return to High. PWMx
is retained.00000800
: Disable Internal Pull-up of DIx
Disables all internal pull-ups (about 50kΩ) of DIx
.
00008000
: Add Relay Function to ChildAdds relay function to child devices in continuous mode. Maximum relay steps is 1.
00001000
: Set Max Relay Steps to 2 for Child RelayChanges maximum relay steps to 2 when 00008000
: Add Relay Function to Child is set.
00002000
: Set Max Relay Steps to 3 for Child RelayChanges maximum relay steps to 3 when 00008000
: Add Relay Function to Child is set.
00010000
: Invert PWMx
WaveformInverts the output waveform of PWMx
.
When maximum value is input to AIx
, PWMx
becomes Low.
00020000
: Turn Off PWMx
After StartupSets PWMx
output to Low state after startup or reset.
PWMx
is High during about 1ms hardware initialization period after startup.00080000
: Alternative Port AssignmentEnables alternative port assignment.
Connecting transistors etc. to PWM2
/PWM3
may cause unstable operation (Details). Use this option in such cases.
PWMx
assignmentDI3
→ PWM1
DI1
→ PWM2
DI2
→ PWM3
BPS
→ PWM4
DIx
assignmentPWM1
→ DI1
PWM4
→ DI2
SDA
→ DI3
DI4
→ DI4
(no change)BPS
assignmentSCL
→ BPS
SCL
/SDA
SCL
: noneSDA
: none00100000
: Turn Off DOx
for 2 Seconds After StartupSets DOx
to Low state for 2 seconds after startup or reset.
You can light LEDs connected to DOx
at startup.
DOx
is High during about 1ms hardware initialization period after startup.00400000
: Invert DOx
OutputInverts DOx
output.
Unlike the initial state, when one DI is Low level, the other DO is High level.
00800000
: Disable Internal Pull-up of DOx
Disables all internal pull-ups (about 50kΩ) of DOx
.