USB MIDIのキーボードをモジュラーシンセのCV入力にする方法 No2
<!-- markdown-mode-on -->
まとまりのない寄せ集めリンク集 No2 です。
## **概要**
USB MIDIのキーボードをモジュラーシンセのCV入力にする方法は、
1. USB MIDIのキーボード
1. usb host シールド を介してArduinoへ
1. DACでアナログへ変換
1. CVへ変換 これの事例
<h2 style="text-align: left;">USB MIDI ホスト シールド プロジェクト: </h2>
<div>?USB MIDI を Arduino USB ホスト シールドと統合するためのライブラリとサンプル。
</div>
<div>
<br />
</div>
<p>この動画から、
<b>モジュラーシンセのホスト </b>とは、Arduino のホストシールドであるらしいことが分かった。
<br />MIDIキーボード ?> USBケーブル・ タイプA ?>
<a href="https://www.amazon.co.jp/USB%E3%83%9B%E3%82%B9%E3%83%88%E3%82%B7%E3%83%BC%E3%83%AB%E3%83%89-Arduino-compatible-Google-Android/dp/B007YNG6RW">USBホストシールド
</a>?> Arduino uno (MIDI to CV/Gate 変換ソフト)という流れのようだ。
</p>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/P6riBo7KLcE" width="320" youtube-src-id="P6riBo7KLcE"></iframe>
</div>
<div class="separator" style="clear: both; text-align: center;">
<br />
</div>
<a name="more"></a>
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://x.com/YuuichiAkagawa/status/1595413033643229184" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="XユーザーのYuuichi Akagawaさん: 「CV/GATEがわかったので、USB MIDI to CV/GATE変換を作ってみた。 #KORG nanoKEY2でVolca Modularを鳴らしてます。
https://t.co/TuMduh6HaD」 / X" height="100" loading="lazy" src="https://capture.heartrails.com/382x200?https://x.com/YuuichiAkagawa/status/1595413033643229184" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">XユーザーのYuuichi Akagawaさん: 「CV/GATEがわかったので、USB MIDI to CV/GATE変換を作ってみた。 #KORG nanoKEY2でVolca Modularを鳴らしてます。 https://t.co/TuMduh6HaD」 / X
</p>
<p class="blogcard-description bd-link">
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://x.com/YuuichiAkagawa/status/1595413033643229184" width="16" />x.com
</div>
</a>
</figure>
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://github.com/YuuichiAkagawa/Arduino-UHS2MIDI" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="GitHub - YuuichiAkagawa/Arduino-UHS2MIDI: USB Host Shield 2.0 MIDI transport layer for the FortySevenEffects Arduino MIDI Library" height="100" loading="lazy" src="https://opengraph.githubassets.com/c0b392fb5fed3fe278d7e7156dda02ca44c2357a3908311e69b8db2145f491ad/YuuichiAkagawa/Arduino-UHS2MIDI" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">GitHub - YuuichiAkagawa/Arduino-UHS2MIDI: USB Host Shield 2.0 MIDI transport layer for the FortySevenEffects Arduino MIDI Library
</p>
<p class="blogcard-description bd-link">USB Host Shield 2.0 MIDI transport layer for the FortySevenEffects Arduino MIDI Library - YuuichiAkagawa/Arduino-UHS2MIDI
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://github.com/YuuichiAkagawa/Arduino-UHS2MIDI" width="16" />github.com
</div>
</a>
</figure>動画にあったコメントをここに載せるが、これだけの情報では難易度が高い。
<blockquote></blockquote>
<blockquote>Arduino UNO + USB Host ShieldにDACとオペアンプを接続してUSB MIDI→CV/GATE変換をやってみる実験。
<br />・DAC:Microchip MCP4725(12bit)?
<div>・OpAmp:LM358?
</div>
<div>MIDI Note値をDAC値に変換し、DAC出力値をオペアンプで増幅して83.333mV/半音になるように抵抗値を設定しているだけ。 → DAC値は12bitなので、32/半音。これをオペアンプで2.1333倍する。
<br />ポルタメントに対応(?)
<br />遷移の途中で別のキーをしたときの挙動をどうするのか難しい。(個々の実装はリトリガーなので飛ぶ)
</div>
</blockquote>
### DAC DACがI2CかSPIかを見分けるために、以下の点に注目します。
* <b>SPIの場合 </b>DACには CS (Chip Select), MOSI, SCK の3本の信号線がArduinoからDACへ接続されるはずです。 ArduinoのDigital Pin 10, 11, 13 が使われていればSPI接続の可能性が高いです。
* <b>I2Cの場合 </b>DACには SDA(データ)および SCL(クロック) の2本の信号線が接続されます。 Arduinoの Analog Pin A4 (SDA) と A5 (SCL) が使われている場合はI2C接続の可能性が高いです。
画像を確認したところ、接続されているピンが Digital Pin 10 (CS), Pin 11 (MOSI), Pin 13 (SCK) であるため、この回路はSPIインターフェースを使用している可能性が高いと判断できます。 したがって、このDACは
<u>MCP4921 のようなSPI対応の12ビットDAC </u>であると推測されます。
### 回路図の概要
1. Arduino UNO + USB Host Shield - USBポートにKORG nanoKEY2 を接続。 - 各ピンとデバイスの接続: - Digital Pin 10 (CS):DACのCSピンに接続(SPIでチップ選択を行う) - Digital Pin 11 (MOSI):DACのDINピンに接続(SPIでデータを送信) - Digital Pin 13 (SCK):DACのSCKピンに接続(SPIクロック信号) - 5Vピン:USBホストシールドとブレッドボードの5Vラインに接続 - GNDピン:すべてのGNDラインに接続
2. 12-bit DAC (MCP4921) + OpAmp - CSピン:ArduinoのDigital Pin 10に接続(SPI制御のため) - DINピン:ArduinoのDigital Pin 11(MOSI)に接続 - SCKピン:ArduinoのDigital Pin 13に接続(クロック用) - VOUTピン:OpAmpの非反転入力ピン(+)に接続し、電圧出力として使用 - GNDピン:ブレッドボードのGNDおよびArduinoのGNDに接続 - 電源ピン (VCC):12V電源からの電源供給に接続
3. 12V電源 - 正極:OpAmpおよびDACのVCCに接続 - 負極:ブレッドボードおよびArduinoのGNDに接続 4. マルチメータ - 測定端子:OpAmpの出力ピンに接続し、出力電圧(例:0.048V)を測定 この修正版はSPI接続用のDACであることを前提に記載しています。
## 予備知識
### MIDI
<table border="1" style="border-collapse: collapse; border: 1px solid black;">
<tbody>
<tr>
<th style="border: 1px solid black;">特徴 </th>
<th style="border: 1px solid black;">レガシーMIDI </th>
<th style="border: 1px solid black;">USB MIDI </th>
<th style="border: 1px solid black;">TRS MIDI </th>
</tr>
<tr>
<td style="border: 1px solid black;">コネクタ </td>
<td style="border: 1px solid black;">5ピンDIN </td>
<td style="border: 1px solid black;">USB Type-A/B/C </td>
<td style="border: 1px solid black;">3.5mmまたは2.5mm TRS </td>
</tr>
<tr>
<td style="border: 1px solid black;">ピンの内訳 </td>
<td style="border: 1px solid black;">1: シールド
<br />2: シールド
<br />3: 未使用
<br />4: データ送信
<br />5: データ受信
</td>
<td style="border: 1px solid black;">4ピンまたは5ピン(電力供給、データ送受信) </td>
<td style="border: 1px solid black;">Tip: 信号1
<br />Ring: 信号2
<br />Sleeve: グラウンド
</td>
</tr>
<tr>
<td style="border: 1px solid black;">ホスト/デバイス </td>
<td style="border: 1px solid black;">デバイス間(ホスト不要) </td>
<td style="border: 1px solid black;">ホストとデバイス </td>
<td style="border: 1px solid black;">デバイス間(ホスト不要) </td>
</tr>
<tr>
<td style="border: 1px solid black;">電力供給 </td>
<td style="border: 1px solid black;">なし </td>
<td style="border: 1px solid black;">あり </td>
<td style="border: 1px solid black;">なし </td>
</tr>
<tr>
<td style="border: 1px solid black;">互換性 </td>
<td style="border: 1px solid black;">高い(多くの機器で標準) </td>
<td style="border: 1px solid black;">高い(コンピュータやモバイル機器) </td>
<td style="border: 1px solid black;">中程度(変換ケーブルが必要) </td>
</tr>
<tr>
<td style="border: 1px solid black;">サイズ </td>
<td style="border: 1px solid black;">大きい </td>
<td style="border: 1px solid black;">中程度 </td>
<td style="border: 1px solid black;">小さい </td>
</tr>
<tr>
<td style="border: 1px solid black;">普及状況 </td>
<td style="border: 1px solid black;">広く普及 </td>
<td style="border: 1px solid black;">広く普及 </td>
<td style="border: 1px solid black;">増加中 </td>
</tr>
<tr>
<td style="border: 1px solid black;">用途 </td>
<td style="border: 1px solid black;">シンセサイザー、シーケンサー、DAW </td>
<td style="border: 1px solid black;">コンピュータ、モバイル機器、DAW </td>
<td style="border: 1px solid black;">コンパクトな楽器、エフェクター </td>
</tr>
</tbody>
</table>### USB ホストシールド
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://ht-deko.com/arduino/shield_usbhost.html" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="USB ホストシールド(USB Host Shield)" height="100" loading="lazy" src="https://capture.heartrails.com/382x200?https://ht-deko.com/arduino/shield_usbhost.html" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">USB ホストシールド(USB Host Shield)
</p>
<p class="blogcard-description bd-link">USB ホストシールド
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://ht-deko.com/arduino/shield_usbhost.html" width="16" />ht-deko.com
</div>
</a>
</figure>### ミニ USB ホストシールド
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://ht-deko.com/arduino/shield_usbhost_mini.html" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="ミニ USB ホストシールド(Mini USB Host Shield)" height="100" loading="lazy" src="https://capture.heartrails.com/382x200?https://ht-deko.com/arduino/shield_usbhost_mini.html" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">ミニ USB ホストシールド(Mini USB Host Shield)
</p>
<p class="blogcard-description bd-link">ミニ USB ホストシールド
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://ht-deko.com/arduino/shield_usbhost_mini.html" width="16" />ht-deko.com
</div>
</a>
</figure>これは3.3V駆動である。使っているICが3.3v仕様なので、もちろんSPI通信も。
<br />そこで以下の問題が出てくる。
<br />- 5Vで動くArduinoなどと繋げるには、5V<- ->3.3Vのレベルシフトを介してSPIを繋ぐ。 - もしくは、3.3V駆動のArduino mini とか、Pro micro を使う。 - ホストシールドのUSBが3.3Vなので、一般の5V USB と繋ぐためにはホストシールドを改造する。 ## Pro Microにmini USB Hostシールドを付けてUSBキーボードを接続する
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://okiraku-camera.tokyo/blog/?p=8092" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="Pro Microにmini USB Hostシールドを付けてUSBキーボードを接続する" height="100" loading="lazy" src="https://okiraku-camera.tokyo/blog/wp-content/uploads/2023/10/f62ccbec7fd09e6f8ee9aee981e0d715.jpg" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">Pro Microにmini USB Hostシールドを付けてUSBキーボードを接続する
</p>
<p class="blogcard-description bd-link">概要 SparkFun Pro Micro(コピー品)に小さなキーパッドを付けて小規模なHIDキーボードを作ってみたが、今度はふつうのUSBキーボードをつないでみた話。 ArduinoにUSBキーボー
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://okiraku-camera.tokyo/blog/?p=8092" width="16" />okiraku-camera.tokyo
</div>
</a>
</figure>## Arduino USB to Legacy MIDI Converter
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://www.instructables.com/Arduino-USB-to-Legacy-MIDI-Converter/" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="Arduino USB to Legacy MIDI Converter" height="100" loading="lazy" src="https://content.instructables.com/FW7/V57N/IWWFKQ5U/FW7V57NIWWFKQ5U.jpg?auto=webp&frame=1&width=2100" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">Arduino USB to Legacy MIDI Converter
</p>
<p class="blogcard-description bd-link">Arduino USB to Legacy MIDI Converter: This project allows sending MIDI signals from a USB-only keyboard or controller to a device that only has 5-pin MIDI IN. I'm not the first to do this - I think it was first hacked by my secret idol, the famous Collin Cunningham, back in 2010. Howeve…
</p>
</div>
</div>
<div class="blogcard-footer bf-link">
??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://www.instructables.com/Arduino-USB-to-Legacy-MIDI-Converter/" width="16" />
www.instructables.com
</div>
</a>
</figure>
## DIY USB Midi Controller With Arduino: a Beginner's Guide
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://www.instructables.com/DIY-USB-Midi-Controller-With-Arduino-a-Beginners-G/" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="DIY USB Midi Controller With Arduino: a Beginner's Guide" height="100" loading="lazy" src="https://content.instructables.com/F9R/H85P/KMT6CDB2/F9RH85PKMT6CDB2.jpg?auto=webp&frame=1" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">DIY USB Midi Controller With Arduino: a Beginner's Guide
</p>
<p class="blogcard-description bd-link">
DIY USB Midi Controller With Arduino: a Beginner's Guide: I love MIDI Controllers! They are some of the coolest yet most powerful devices for controlling mixed media - traditionally used to connect to music software (like Ableton Live) to play virtual instruments as well as control effects - but can also b…
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://www.instructables.com/DIY-USB-Midi-Controller-With-Arduino-a-Beginners-G/" width="16" />www.instructables.com
</div>
</a>
</figure>## Mini USB-MIDI to MIDI
<br />
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://diyelectromusic.com/2020/08/01/mini-usb-midi-to-midi/" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="Mini USB-MIDI to MIDI" height="100" loading="lazy" src="https://diyelectromusic.com/wp-content/uploads/2020/08/2020-08-01-17.16.33.jpg" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">Mini USB-MIDI to MIDI
</p>
<p class="blogcard-description bd-link">This is essentially a remake of my?Simple USB-MIDI to MIDI but using a mini MIDI Host Shield and an Arduino Pro Mini, which I've not used before, with a home-made MIDI out interface to make a simple "all in one" unit. https://youtu.be/mHmNyse8uJ0 Warning!?I strongly recommend using an old or second hand keyboard for your MIDI…
</p>
</div>
</div>
<div class="blogcard-footer bf-link">
??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://diyelectromusic.com/2020/08/01/mini-usb-midi-to-midi/" width="16" />
diyelectromusic.com
</div>
</a>
</figure>
## 関連リンク
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://diyelectromusic.com/2022/03/22/arduino-and-usb-midi/" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="Arduino and USB MIDI" height="100" loading="lazy" src="https://diyelectromusic.com/wp-content/uploads/2022/03/img_5967-prog.jpg" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">
Arduino and USB MIDI
</p>
<p class="blogcard-description bd-link">
I've been dabbling for a while with USB MIDI on an Arduino, but I've never really walked through all the options available or pulled together in a single place all the projects I have, so this post looks at all that in a bit more detail. Warning! I strongly recommend using old or second hand…
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://diyelectromusic.com/2022/03/22/arduino-and-usb-midi/" width="16" />diyelectromusic.com
</div>
</a>
</figure>
<figure class="blogcard b-link">
<a aria-label="記事詳細へ(別窓で開く)" href="https://diyelectromusic.com/2020/08/12/arduino-midi-interfaces/" rel="noopener noreferrer" target="_blank">
<div class="blogcard-content">
<div class="blogcard-image bi-link">
<div class="blogcard-image-wrapper biw-link">
<img alt="Arduino MIDI Interfaces" height="100" loading="lazy" src="https://diyelectromusic.com/wp-content/uploads/2021/09/usbmidi-promicro_bb.png" width="100" />
</div>
</div>
<div class="blogcard-text">
<p class="blogcard-title bt-link">Arduino MIDI Interfaces
</p>
<p class="blogcard-description bd-link">This are a mixture of beginner and advanced, DIY and off-the-shelf, options covering MIDI in (receive), MIDI out (send), and USBMIDI to MIDI conversion.? All link into the RX and TX pins of your Arduino or other microcontroller.? All are designed for 5V logic signals. Here are some other pages of interest: Ready-Made MIDI Modules…
</p>
</div>
</div>
<div class="blogcard-footer bf-link">??
<img alt="ファビコン" height="16" loading="lazy" src="https://www.google.com/s2/favicons?domain=https://diyelectromusic.com/2020/08/12/arduino-midi-interfaces/" width="16" />diyelectromusic.com
</div>
</a>
</figure>5V pro mini とUHS をレベルシフトしてつなげた例
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/a/AVvXsEjAh0J5SrRdimZlwmwBnYtNdBVFpWJVVGL9HNxeCDpNr0AKVC_T684KeUmglz_Rdgm3m8mRcz_a3Sg5k16TI1Yxrz2cmXVeW7EcmhrnO7fNYq23qgnAd4_LM5RK0KI8A-xXApqKY4I5DlWAzftLiQ1EDOYsTnzlNrAuRumJVACnFP9kQpa2-uaMnKKzXeJW" style="margin-left: 1em; margin-right: 1em;">
<img alt="USB Host Shield Schematic" data-original-height="1162" data-original-width="1510" src="https://blogger.googleusercontent.com/img/a/AVvXsEjAh0J5SrRdimZlwmwBnYtNdBVFpWJVVGL9HNxeCDpNr0AKVC_T684KeUmglz_Rdgm3m8mRcz_a3Sg5k16TI1Yxrz2cmXVeW7EcmhrnO7fNYq23qgnAd4_LM5RK0KI8A-xXApqKY4I5DlWAzftLiQ1EDOYsTnzlNrAuRumJVACnFP9kQpa2-uaMnKKzXeJW=s16000" />
</a>
</div>
<br />
<div>
<br />
</div>
<div>
<p>USBホストシールドが3.3V駆動で、Arduinoが5V駆動の場合、電圧レベルの違いにより、
<strong>一部のラインでレベルシフトが必要 </strong>になります。具体的には以下のような対応が必要です。
</p>
<h3>1. 要不要の判断基準 </h3>
<ul>
<li>
<strong>USBホストシールド(3.3V)側が受け取る信号 </strong>(5V → 3.3V):レベルシフトが必要
</li>
<li>
<strong>Arduino(5V)側が受け取る信号 </strong>(3.3V → 5V):多くのArduinoは3.3V信号を受け入れることができるため、レベルシフトは必須ではありませんが、確実な通信を行いたい場合はレベルシフトが推奨されます。
</li>
</ul>
<h3>2. 各SPIラインでのレベルシフト要不要 </h3>
<br />
<html>
<head>
<style>
table {
width: 100%;
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
}
th, td {
padding: 10px;
text-align: left;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<table>
<tr>
<th>信号 </th>
<th>ラインレベルシフト要不要 </th>
<th>説明 </th>
</tr>
<tr>
<td>MOSI (Master Out Slave In) </td>
<td>
<b>必要 </b>
</td>
<td>Arduino(5V)からUSBホストシールド(3.3V)に信号を送るため、5V → 3.3Vのレベルシフトが必要です。 </td>
</tr>
<tr>
<td>MISO (Master In Slave Out) </td>
<td>不要(推奨) </td>
<td>USBホストシールド(3.3V)からArduino(5V)に信号を送るため、通常のArduinoでは3.3V信号を直接受け取れますが、安全性を高めたい場合はレベルシフトを追加すると良いでしょう。 </td>
</tr>
<tr>
<td>SCK (Serial Clock) </td>
<td>
<b>必要 </b>
</td>
<td>Arduino(5V)からUSBホストシールド(3.3V)に信号を送るため、5V → 3.3Vのレベルシフトが必要です。 </td>
</tr>
<tr>
<td>SS (Slave Select) </td>
<td>
<b>必要 </b>
</td>
<td>Arduino(5V)からUSBホストシールド(3.3V)に信号を送るため、5V → 3.3Vのレベルシフトが必要です。 </td>
</tr>
</table>
</body>
</html>
<h3>3. レベルシフタの選択 </h3>
<ul>
<li>
<strong>双方向レベルシフタ </strong>や
<strong>分圧抵抗 </strong>を使ってMOSI、SCK、SSラインの5V→3.3Vの電圧を落とします。
</li>
<li>MISOは通常レベルシフト不要ですが、確実性を求めるならば
<strong>単方向レベルシフタ </strong>を使い、3.3V→5Vに変換しておくと良いでしょう。
</li>
</ul>
<h3>4. まとめ </h3>
<ul>
<li>必要なレベルシフト箇所は、MOSI、SCK、SSの3本です。 </li>
<li>MISOはレベルシフト不要ですが、必要に応じて行っても問題ありません。 </li>
</ul>
</div>