# ピン割り当て

本解説で使用するピン名は、超簡単！標準アプリの名前定義 (M1-M3, BPS, TX, RX, I1-I4) を用います。以下に各TWELITEの配列を記載します。

## ピン配列表(v1.2以降)

### TWELITE/TWELITE DIP

※ DIO番号は半導体データシートに基づく信号名で、ピン番号ではありません。TWELITE DIP の場合はピンに記載されるシルクの数字記載が DIO 番号です。

| ピン名     | 機能                                                                        | <p>TWELITE DIO番号<br>(<a href="https://mono-wireless.com/jp/products/TWE-APPS/App_Twelite/index.html">超簡単！標準アプリ</a>と同じ)</p> |
| ------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| M1      | <p>親機子機の設定。ソフト上からも設定可能。<br>オープン: 子機<br>Lo: 親機</p>                         | 10                                                                                                                         |
| M2      | <p>子機設定で Lo で中継と設定する(Role=1 または Role=0x12 と等価)。<br>※ 親機設定で Lo にしないこと。</p> | 2                                                                                                                          |
| M3      | ピンが Lo の間スリープする                                                           | 3                                                                                                                          |
| EX1     | <p>Lo で起動すると UART mode を書式モード(バイナリ形式)に強制する<br>※標準アプリケーションのAI2ピンです。</p>    | 0                                                                                                                          |
| EX2     | <p>未使用<br>※標準アプリケーションのAI4ピンです。</p>                                        | 1                                                                                                                          |
| BPS     | ピンが Lo で起動すると、設定したボーレート、パリティ設定で UART を初期化する                               | 17                                                                                                                         |
| TX      | UARTの出力 (TX)                                                              | 6                                                                                                                          |
| RX      | <p>UARTの入力 (RX)<br>※ 本ピンに Lo > Hi への立下り信号を投入するとスリープ復帰します。</p>             | 7                                                                                                                          |
| RTS     | UART の RTS 出力 (Hi 時に入力を禁止すると、データ欠落等を抑制できる）                                | 5                                                                                                                          |
| TX\_SUB | 副UARTの出力 (TX)                                                             | 14                                                                                                                         |
| RX\_SUB | 副UARTの入力 (RX)                                                             | 15                                                                                                                         |

※ オープンは Hi レベルでも可。設計上必要と考える場合はプルアップ(10k～100kΩ)して下さい。\
※ Lo は GND レベル。設計上必要と考える場合はプルダウン(100Ω程度)して下さい。\
※ 未使用ピンはオープンにしてください。

### TWELITE UART

各部の説明は[こちら](https://mono-wireless.com/jp/products/twelite-uart/index.html)をご確認ください。

| 名称  | 機能                                      | <p>TWELITE DIO番号<br>(<a href="https://mono-wireless.com/jp/products/TWE-APPS/App_Twelite/index.html">超簡単！標準アプリ</a>と同じ)</p> |
| --- | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| GND | 電源のマイナス側                                | GND                                                                                                                        |
| TXD | シリアル出力通信線（相手側はシリアル入力端子に接続）              | 6                                                                                                                          |
| PRG | GNDに接続してリセットし、開放またはVCCに接続するとプログラムモードに遷移 | SPIMISO                                                                                                                    |
| RXD | シリアル入力通信線（相手側はシリアル出力端子に接続）              | 7                                                                                                                          |
| RST | GNDに接続するとリセット                           | RESETN                                                                                                                     |
| VCC | 電源のプラス側（2.0V - 3.6V）                    | VCC                                                                                                                        |
| SET | Lo で起動すると UART mode を書式モード(アスキー形式)に強制する | 11                                                                                                                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://twelite.gitbook.io/mw-pug-uart/pin-assignment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
