Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

UART

マイクロコントローラには UART というペリフェラルがあり、これは Universal Asynchronous Receiver/Transmitter の略です。このペリフェラルは、 シリアル通信プロトコルのようないくつかの通信プロトコルで動作するように設定できます。

この章全体を通して、マイクロコントローラとコンピューターの間で情報をやり取りするために、 シリアル通信を使用します。

注意 micro:bit v2 では、いわゆる UARTE ペリフェラルを使用します。これは 通常の UART と同じように振る舞いますが、HAL はこれを異なる方法で扱う必要があります。 ただし、これはもちろん私たちが気にする必要のあることではありません。

セットアップ

これまでと同様に、以後は使用している micro:bit のバージョンに合わせて Embed.toml を変更する必要があります。

[default.general]
chip = "nrf52833_xxAA" # uncomment this line for micro:bit V2
# chip = "nrf51822_xxAA" # uncomment this line for micro:bit V1

[default.reset]
halt_afterwards = false

[default.rtt]
enabled = true

[default.gdb]
enabled = false