SPIバスの概要 (日本語ブログ)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPIバスの概要 (日本語ブログ)

akifumiokano
NXP Employee
NXP Employee
3 0 7,107

0. 目次

 

  1. 目次
  2. SPIとは
  3. 物理的/電気的特徴
  4. プロトコル
  5. 接続トポロジ
  6. 参考資料

1. SPIとは

 

1.1 歴史とその仕様

 

SPIバスはアメリカのモトローラ(現NXPセミコンダクターズ)によって提唱されたシリアル・バス仕様です.仕様が策定されたのは1980年代半ばとされています. SPIは「Serial Peripheral Interface」の略でプロセッサと周辺チップとの接続に使われる4線式のシリアル・バスとして開発されました. この派生仕様としての3線式SPIバスも存在しますが,基本となっているのは元の4線式です.

SPIでは信号の極性やデータの同期タイミング設定など,通信方法に幾つかのバリエーションがあるので,使用の際にはこれを意識する必要があります.

SPIはI²Cと同じく,チップ間のデータのやり取りに使われますが,それぞれに利点と不利な点があります.これを[表1]にまとめます.

SPIはより高速なデータ転送が必要な用途に使われます.これは電気的仕様の違いによるもので,I²Cではオープンドレインで信号を駆動するのに対し,SPIではプッシュプルで駆動するため高速化が容易です.さらにデータ転送速度の点では送受信を同時に行える全二重通信が行えるのが特長です.

一方,SPIにもいくつかの不利な点があります.転送のデータ長やクロックの極性は転送先デバイスごとに規定されているため,複数種類のデバイスの混在が困難な場合があります.また同種でも複数のデバイスを接続している場合には,各々のデバイスにチップセレクト信号が必要になるため信号線数が増えたり,あるいは縦続接続を行った場合にはデータ転送長の調整が必要になったりします.

 

  I²C SPI
線数 2
データ:SDA
クロック:SCL
4
データ:SDO, SDI (MOSI, MISO)
クロック:SCLK
チップセレクト:CS
速度 ~400kHz
モードにより1MHz, 3.4MHz, 5MHz
数百kHz〜数十MHz
通信方向 双方向
半二重
双方向
全二重
接続方法 マルチドロップ(並列)
複数コントローラ 対 複数ターゲット
並列 または デイジーチェーン
単一コントローラ 対 複数ターゲット
信号駆動 オープンドレイン
(プルアップ抵抗要)
プッシュプル

表1:I²CとSPIの比較

 

1.2 コントローラ/ターゲット.またはメイン/サブノード(サブ)

 

SPIでも主と従の関係で転送が行われます.これまでそれぞれにマスタ/スレーブの語が一般に使われていましたが,現在はコントローラ/ターゲットに改められています.

また,これまでの役割名の頭文字「M/S」をそのまま当てはめてメイン/サブノード(サブ)とも呼ばれます.以降,このブログではあえてこのメイン/サブノード(サブ)を使います.

SPIでは複数のメインが存在できません.必ずひとつのメインと,ひとつまたは複数のターゲット間で通信が行われます.

 

2. 物理的/電気的特徴

 

2.1 信号線数:信号名

 

SPIバスは4線式.同期式シリアル・インターフェースです.同期式シリアル・インターフェースとはクロック信号に同期してデータを送受する方法で,信号線のうちの1本をクロックに使います.

データには2本の信号線.メインからサブへのデータとサブからメインへのデータにそれぞれ1本使います.あとのもう1本はチップ・セレクトと呼ばれる信号です.SPIでは転送対象を指定するためのアドレス指定を行う方法がありません.そのためチップセレクト信号を使って,転送対象デバイスを指定します[図1].

信号名はさまざまな名前で呼ばれる場合があります.次の信号名はOSHWAによる呼称[英語サイト]です.

  • SDO:データ出力
  • SDI:データ入力
  • SCK:シリアル・クロック
  • CS:チップセレクト:CS

上記では,SDO,SDIの名称は各チップにおけるデータ入出力の方向が基準になっています.この場合,各ピン名としては明確で良いのですが,メイン/サブ間での信号の方向を示すには不便です,

これに代わって回路図上などでよく使われる信号名には以下のようなものもあります.このブログではこれらの語に統一します.

  • MOSI:メインからサブへのデータ(Main Out Sub In)
  • MISO:サブからメインへのデータ(Main In Sub Out)
  • SCLK:シリアル・クロック
  • CS:チップセレクト:CS

これらの信号のうちMISOだけはサブからメインへの信号で,それ以外は全てメインからサブへの信号となります.通信中に信号の方向が切り替わることはありません.

スクリーンショット 2025-02-03 6.18.59.png図1:コントローラとターゲット.各信号名

 

信号本数を節約するため,例えば片方向だけの通信が行われる場合,いずれかのデータ線が省略される場合があります.

また送受信を時多重にしてデータ線を1本だけで使うことができるようにしたターゲットもも存在します.この場合,メイン側ではMOSI/MISOを抵抗を用いてショートして,信号をまとめます.

2.2 プッシュプル.非転送時のハイ・インピーダンス状態

 

信号はプッシュプルで出力されます.また非データ転送時のMOSI,MISOの出力はハイ・インピーダンス状態に置かれます.これは複数のサブノードが並列に接続された時に,他の通信に影響を与えないようにするためです.

信号電圧はサブノードのデバイスによって規定されているため,それに合わせてやる必要があります.メイン側とサブノードで電圧が違う場合は電圧変換が必要です.

 

2.3 クロック周波数

 

クロック周波数も特に規定はありません.通常は百kHz台から数MHz台のクロックが使われる場合が多く,上限はサブノード・デバイスの仕様によって決められます.高レートでのデータ転送が必要なアプリケーションでは数十MHzのクロックが使われることもあります. またメモリ・デバイスなどでは,MOSIやMISOのデータ線を複数用いて転送レートを上げる応用例もあります.

 

3. プロトコル

 

データ転送手順を決めるプロトコルも特に厳密な決まりはなく,サブノード・デバイス毎に自由に決められています.メイン側となるマイコンでは様々なサブノード・デバイスをサポートするための設定が用意されています.

基本の転送手順は,転送先のサブノードに接続されたCSをアサートしてから転送を始めます.CSデアサートで転送が終了します.CSのアサートとデアサートはLOWとHIGHの信号で行われますが,この極性はサブノード・デバイスの仕様で規定されます. データのビット順については,多くのデバイスではMSBファーストとなっていますが,これにも例外があります.転送単位とするビット数も特に決まっていません.2ビットから16ビットとしている解説を見たことがありますが,もっと大きいビット長を単位としたサブノードも存在する(例えば64ビットなど)ためこの限りではありません.

 

3.1 モード

 

SPIには「モード」と呼ばれる設定があります.これはクロックの極性とエッジの選択の組み合わせを指しており,それぞれに2つの設定で4つのモードが存在します[図2].

クロック極性(Polarity)はCPOLと呼ばれる設定で,データ非転送時のSCLKがLOWかHIGHかを決める設定です.メイン側の設定ではを0に設定するとLOW,1ならHIGHになります. エッジの選択(phase)はCPHAと呼ばれます.データのラッチ(取り込み)を最初のクロックエッジで行うか,2番目のエッジで行うかを決める設定です. 0の設定で最初のエッジ,1の設定で2番目のエッジを選択します. CPOLとCPHAを組み合わせてモード0〜3のように表す場合もあります[表2].

さらに,これに加えてチップセレクトの極性が逆のサブノードも存在するので注意が必要です.

スクリーンショット 2025-02-03 7.42.56.png図2:モード(CPOL,CPHA)

 

  CPOL CPHA
mode=0 0 0
mode=1 0 1
mode=2 1 0
mode=3 1 1

表2:モードとCPOL,CPHA

 

「データをラッチするエッジ」とは?

データはクロックに同期して送受信されますが,クロックの立ち上がり,立ち下がりのどちらかひとつのエッジでデータの変化します. [図3]に立ち下がりでデータが変化する例を示して説明します.メイン側デバイスが出力するSCLKの立ち下がりのタイミングにに合わせて,メイン側はMOSIの,サブノード側はMISOの出力を変化させます.次のデータは次の立ち下がりで切り替わりますが,それまでの間は安定した状態になります.クロックの立ち上がりは,ちょうどこの期間に起こるため,このタイミングに合わせて互いのデータの取り込みを行います.これが「ラッチを行うエッジ」です.

スクリーンショット 2025-02-03 6.54.45.png

図3:データ(MOSI/MISO)とクロック(SCLK)の同期

 

3.2 データ転送

 

チップセレクトがアサートされたのち,クロックに同期してデータを送受信します.サブノードは自身のチップセレクトがアサートされたことを受け,クロックに合わせてデータを取り込み,また出力します.

[図4]はSPI転送の一例です.CSアサート中のクロックに合わせてデータがやり取りされます.ロジック回路に慣れている方なら,シフトレジスタによる単純な回路によって実現していることが見て取れると思います.

スクリーンショット 2025-02-03 7.55.53.png図4:SPI転送の例

 

4. 接続トポロジ

 

4.1 チップセレクトによる並列接続とデイジーチェーン

 

複数のサブノードは[図5]のように接続します. 各サブノード向けにチップセレクトを用意し,それぞれの信号で送受信先を指定しながら通信を行います. またはCS信号の本数を節約するために縦続接続(デイジーチェーン)を行なって,ビット長を拡張したひとつのサブノードと見做して通信を行う方法も使われます[図6].

先にも述べましたが,複数の種類のサブノードを同じSPIバスに接続するには注意が必要です. 先に述べたような,「モード」やチップセレクトの極性,さらにデータ・ビット長が同一とは限りません.このため各サブノードへの通信の度に設定を切り替えたり,ハードウェアでの調整が必要な場合があります.

スクリーンショット 2025-02-03 8.25.09.png

図5:並列接続

 

スクリーンショット 2025-02-03 8.25.21.png

図6:デイジーチェーン接続

5. 参考資料

 

 

 [初出:インターフェース 2024年3月号(CQ出版)「I2C&SPIをゼロから作る④…SPIの通信規格」p71-73.ブログ掲載にあたり通信仕様解説部分を抜粋,加筆修正]

 

変更履歴:
2025-02-03:初版
2025-02-25:「5. 参考資料」の項に「NXP システム・マネジメントI²C, I3C, SPIセレクタ・ガイド」へのリンクを追加

2025-05-01:目次を訂正(項目削除),2.2節の項目名訂正

 

=========================

本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。
お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。
(既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。)

%3CLINGO-SUB%20id%3D%22lingo-sub-2036964%22%20slang%3D%22ja-JP%22%20mode%3D%22CREATE%22%3ESPI%20Bus%20Overview%20(Japanese%20blog)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2036964%22%20slang%3D%22ja-JP%22%20mode%3D%22CREATE%22%3E%3CDIV%20id%3D%22idx0%22%20class%3D%22pt1%22%3E%0A%3CH1%20id%3D%22toc-hId-1242317653%22%20id%3D%22toc-hId-1300494700%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22idx0%22%3E%3C%2FA%3E0.%20Table%20of%20Contents%3C%2FH1%3E%0A%3C%2FDIV%3E%0A%3CBR%20%2F%3E%0A%3COL%20start%3D%220%22%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx0%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Etable%20of%20contents%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx1%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EWhat%20is%20SPI%3F%3C%2FA%3E%3C%2FLI%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx1-1%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E1.1%20History%20and%20specifications%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx1-2%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E1.2%20Controller%2FTarget%20or%20Main%2FSubnode%20(Sub)%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx2%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EPhysical%2FElectrical%20Characteristics%3C%2FA%3E%3C%2FLI%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx2-1%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E2.1%20Number%20of%20signal%20lines%3A%20Signal%20names%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx2-2%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E2.2%20Push-pull.%20High%20impedance%20state%20when%20not%20transmitting%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx2-2%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E2.3%20Clock%20Frequency%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx3%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Eprotocol%3C%2FA%3E%3C%2FLI%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx3-1%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E3.1%20Mode%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx3-2%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E3.2%20Data%20Transfer%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx4%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EConnection%20Topology%3C%2FA%3E%3C%2FLI%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx3-1%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E4.1%20Parallel%20connection%20and%20daisy%20chain%20with%20chip%20select%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CLI%3E%3CA%20class%3D%22smoothScroll%22%20href%3D%22%23idx5%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EReference%20materials%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22idx1%22%20class%3D%22pt1%22%3E%0A%3CH1%20id%3D%22toc-hId--565136810%22%20id%3D%22toc-hId--506959763%22%3E1.%20What%20is%20SPI%3F%3C%2FH1%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx1-1%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId-125424664%22%20id%3D%22toc-hId-183601711%22%3E1.1%20History%20and%20specifications%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EThe%20SPI%3C%2FSTRONG%3E%20bus%20is%20a%20serial%20bus%20specification%20proposed%20by%20%3CSTRONG%3EMotorola%3C%2FSTRONG%3E%20(now%20NXP%20Semiconductors)%20in%20the%20United%20States.%20The%20specification%20is%20said%20to%20have%20been%20established%20in%20the%20mid-1980s.%20SPI%20stands%20for%20%22%20%3CSTRONG%3ESerial%20Peripheral%20Interface%3C%2FSTRONG%3E%20%22%20and%20was%20developed%20as%20a%20four-wire%20serial%20bus%20used%20to%20connect%20processors%20and%20peripheral%20chips.%20A%20three-wire%20SPI%20bus%20is%20also%20available%20as%20a%20derivative%20specification%2C%20but%20the%20original%20four-wire%20system%20is%20the%20basis.%3C%2FP%3E%0A%3CP%3ESPI%20has%20several%20variations%20in%20communication%20methods%2C%20such%20as%20signal%20polarity%20and%20data%20synchronization%20timing%20settings%2C%20so%20you%20need%20to%20be%20aware%20of%20this%20when%20using%20it.%3C%2FP%3E%0A%3CP%3ELike%20I%C2%B2C%2C%20SPI%20is%20used%20to%20exchange%20data%20between%20chips%2C%20but%20each%20has%20its%20own%20advantages%20and%20disadvantages%2C%20as%20summarized%20in%20%5BTable%201%5D.%3C%2FP%3E%0A%3CP%3ESPI%20is%20used%20for%20applications%20that%20require%20%3CSTRONG%3Efaster%20data%20transfer%3C%2FSTRONG%3E%20.%20This%20is%20due%20to%20the%20difference%20in%20electrical%20specifications%3A%20I%C2%B2C%20drives%20signals%20using%20open%20drain%2C%20while%20SPI%20drives%20signals%20using%20%3CSTRONG%3Epush-pull%3C%2FSTRONG%3E%20%2C%20making%20it%20easier%20to%20achieve%20higher%20speeds.%20Furthermore%2C%20in%20terms%20of%20data%20transfer%20speed%2C%20SPI%20is%20characterized%20by%20its%20ability%20to%20perform%20%3CSTRONG%3Efull-duplex%20communication%2C%3C%2FSTRONG%3E%20which%20allows%20simultaneous%20transmission%20and%20reception.%3C%2FP%3E%0A%3CP%3EOn%20the%20other%20hand%2C%20SPI%20also%20has%20some%20disadvantages.%20The%20transfer%20data%20length%20and%20clock%20polarity%20are%20specified%20for%20each%20destination%20device%2C%20making%20it%20difficult%20to%20mix%20multiple%20types%20of%20devices.%20Also%2C%20when%20connecting%20multiple%20devices%20of%20the%20same%20type%2C%20a%20chip%20select%20signal%20is%20required%20for%20each%20device%2C%20which%20increases%20the%20number%20of%20signal%20lines%2C%20and%20when%20cascading%20devices%2C%20the%20data%20transfer%20length%20must%20be%20adjusted.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CTABLE%20style%3D%22margin-left%3A%20auto%3B%20margin-right%3A%20auto%3B%20background%3A%20%23F7F5F1%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%20style%3D%22background%3A%20%23EBE7DD%3B%22%3E%0A%3CTD%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%3EI%C2%B2C%3C%2FTD%3E%0A%3CTD%3ESPI%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ENumber%20of%20lines%3C%2FTD%3E%0A%3CTD%3E2%3CBR%20%2F%3E%20Data%3A%20SDA%3CBR%20%2F%3E%20Clock%3A%20SCL%3C%2FTD%3E%0A%3CTD%3E4%3CBR%20%2F%3E%20Data%3A%20SDO%2C%20SDI%20(MOSI%2C%20MISO)%3CBR%20%2F%3E%20Clock%3A%20SCLK%3CBR%20%2F%3E%20Chip%20select%3A%20CS%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3Espeed%3C%2FTD%3E%0A%3CTD%3E~400kHz%3CBR%20%2F%3E%201MHz%2C%203.4MHz%2C%205MHz%20depending%20on%20mode%3C%2FTD%3E%0A%3CTD%3ESeveral%20hundred%20kHz%20to%20several%20tens%20of%20MHz%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ECommunication%20Direction%3C%2FTD%3E%0A%3CTD%3Ebidirectional%3CBR%20%2F%3E%20half%20duplex%3C%2FTD%3E%0A%3CTD%3EBidirectional%3CBR%20%2F%3E%20full%20duplex%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3EConnection%20Method%3C%2FTD%3E%0A%3CTD%3EMultidrop%20(parallel)%3CBR%20%2F%3E%20Multiple%20Controllers%20vs.%20Multiple%20Targets%3C%2FTD%3E%0A%3CTD%3EParallel%20or%20Daisy%20Chain%3CBR%20%2F%3E%20Single%20Controller%20vs.%20Multiple%20Targets%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3ESignal%20Drive%3C%2FTD%3E%0A%3CTD%3EOpen%20Drain%3CBR%20%2F%3E%20(Pull-up%20resistor%20required)%3C%2FTD%3E%0A%3CTD%3EPush-pull%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3ETable%201%3A%20Comparison%20of%20I%C2%B2C%20and%20SPI%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22idx1-2%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId--1682029799%22%20id%3D%22toc-hId--1623852752%22%3E1.2%20Controller%2FTarget%20or%20Main%2FSubnode%20(Sub)%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIn%20SPI%2C%20transfers%20are%20also%20made%20in%20a%20master-slave%20relationship.%20Until%20now%2C%20the%20terms%20master%20and%20slave%20were%20commonly%20used%2C%20but%20these%20have%20now%20been%20changed%20to%20controller%20and%20target.%3C%2FP%3E%0A%3CP%3EThey%20are%20also%20called%20main%2Fsubnodes%20(sub)%2C%20retaining%20the%20initials%20%22M%2FS%22%20from%20the%20previous%20role%20names.%20From%20now%20on%2C%20this%20blog%20will%20deliberately%20use%20the%20terms%20main%2Fsubnodes%20(sub).%3C%2FP%3E%0A%3CP%3EIn%20SPI%2C%20multiple%20mains%20cannot%20exist.%20Communication%20always%20takes%20place%20between%20one%20main%20and%20one%20or%20more%20targets.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx2%22%20class%3D%22pt1%22%3E%0A%3CH1%20id%3D%22toc-hId--1692532903%22%20id%3D%22toc-hId--1634355856%22%3E2.%20Physical%2FElectrical%20Characteristics%3C%2FH1%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx2-1%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId--1001971429%22%20id%3D%22toc-hId--943794382%22%3E2.1%20Number%20of%20signal%20lines%3A%20Signal%20names%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20SPI%20bus%20is%20a%20four-wire%20synchronous%20serial%20interface.%20A%20synchronous%20serial%20interface%20is%20a%20method%20of%20sending%20and%20receiving%20data%20in%20synchronization%20with%20a%20clock%20signal%2C%20using%20one%20of%20the%20signal%20lines%20as%20the%20clock.%3C%2FP%3E%0A%3CP%3EThere%20are%20two%20signal%20lines%20for%20data.%20One%20is%20used%20for%20data%20from%20the%20main%20to%20the%20sub%20and%20the%20other%20is%20used%20for%20data%20from%20the%20sub%20to%20the%20main.%20The%20other%20is%20a%20signal%20called%20chip%20select.%20SPI%20does%20not%20have%20a%20way%20to%20specify%20an%20address%20to%20specify%20the%20transfer%20target.%20Therefore%2C%20the%20chip%20select%20signal%20is%20used%20to%20specify%20the%20target%20device%20%5BFigure%201%5D.%3C%2FP%3E%0A%3CP%3ESignal%20names%20may%20be%20called%20by%20a%20variety%20of%20names.%20The%20following%20signal%20names%20are%20%3CA%20href%3D%22https%3A%2F%2Fwww.oshwa.org%2Fa-resolution-to-redefine-spi-signal-names%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ethose%20used%20by%20%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3EOSHWA%3C%2FFONT%3E%3C%2FA%3E%20%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ESDO%3C%2FSTRONG%3E%20%3A%20Data%20output%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESDI%3C%2FSTRONG%3E%20%3A%20Data%20input%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESCK%3C%2FSTRONG%3E%20%3A%20Serial%20clock%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ECS%3C%2FSTRONG%3E%20%3A%20Chip%20Select%3A%20CS%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EIn%20the%20above%20example%2C%20the%20names%20SDO%20and%20SDI%20are%20based%20on%20the%20direction%20of%20data%20input%2Foutput%20on%20each%20chip.%20In%20this%20case%2C%20the%20names%20of%20the%20pins%20are%20clear%2C%20but%20it%20is%20inconvenient%20to%20indicate%20the%20signal%20direction%20between%20the%20main%20and%20sub.%3C%2FP%3E%0A%3CP%3EInstead%2C%20the%20following%20signal%20names%20are%20commonly%20used%20on%20circuit%20diagrams%2C%20etc.%20This%20blog%20will%20stick%20to%20these%20terms.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EMOSI%3C%2FSTRONG%3E%20%3A%20Data%20from%20main%20to%20sub%20(Main%20Out%20Sub%20In)%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EMISO%3C%2FSTRONG%3E%20%3A%20Data%20from%20sub%20to%20main%20(Main%20In%20Sub%20Out)%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESCLK%3C%2FSTRONG%3E%20%3A%20Serial%20clock%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ECS%3C%2FSTRONG%3E%20%3A%20Chip%20Select%3A%20CS%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EOf%20these%20signals%2C%20only%20MISO%20is%20a%20signal%20from%20the%20sub%20to%20the%20main%2C%20and%20all%20others%20are%20signals%20from%20the%20main%20to%20the%20sub.%20The%20signal%20direction%20does%20not%20change%20during%20communication.%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.18.59.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.18.59.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F322149i93D7D742424870B1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.18.59.png%22%20alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.18.59.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%20%3CEM%3EFigure%201%3A%20Controller%20and%20target.%20Signal%20names%3C%2FEM%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3ETo%20save%20on%20the%20number%20of%20signals%2C%20for%20example%20when%20communication%20is%20only%20one%20way%2C%20one%20of%20the%20data%20lines%20may%20be%20omitted.%3C%2FP%3E%0A%3CP%3EThere%20are%20also%20targets%20that%20allow%20transmission%20and%20reception%20to%20be%20time-multiplexed%2C%20allowing%20the%20use%20of%20only%20one%20data%20line.%20In%20this%20case%2C%20on%20the%20main%20side%2C%20MOSI%2FMISO%20are%20shorted%20using%20a%20resistor%20to%20combine%20the%20signals.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22idx2-2%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId-1485541404%22%20id%3D%22toc-hId-1543718451%22%3E2.2%20Push-pull.%20High%20impedance%20state%20when%20not%20transmitting%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3ESignals%20are%20output%20in%20a%20push-pull%20fashion.%20When%20no%20data%20is%20being%20transferred%2C%20the%20MOSI%20and%20MISO%20outputs%20are%20placed%20in%20a%20high-impedance%20state.%20This%20is%20to%20prevent%20interference%20with%20other%20communications%20when%20multiple%20subnodes%20are%20connected%20in%20parallel.%3C%2FP%3E%0A%3CP%3EThe%20signal%20voltage%20is%20determined%20by%20the%20sub-node%20device%2C%20so%20it%20must%20be%20adjusted%20accordingly.%20If%20the%20voltage%20differs%20between%20the%20main%20and%20sub-nodes%2C%20voltage%20conversion%20is%20required.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx2-3%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId--321913059%22%20id%3D%22toc-hId--263736012%22%3E2.3%20Clock%20Frequency%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThere%20are%20no%20specific%20regulations%20regarding%20clock%20frequencies.%20Clocks%20in%20the%20hundreds%20of%20kHz%20to%20several%20MHz%20range%20are%20typically%20used%2C%20with%20the%20upper%20limit%20determined%20by%20the%20specifications%20of%20the%20subnode%20device.%20Applications%20requiring%20high-rate%20data%20transfer%20may%20use%20clocks%20of%20several%20tens%20of%20MHz.%20In%20addition%2C%20in%20memory%20devices%2C%20there%20are%20also%20applications%20where%20multiple%20MOSI%20and%20MISO%20data%20lines%20are%20used%20to%20increase%20the%20transfer%20rate.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx3%22%20class%3D%22pt1%22%3E%0A%3CH1%20id%3D%22toc-hId--332416163%22%20id%3D%22toc-hId--274239116%22%3E3.%20Protocol%3C%2FH1%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThere%20are%20no%20strict%20rules%20regarding%20the%20protocol%20that%20determines%20the%20data%20transfer%20procedure%2C%20and%20it%20is%20freely%20determined%20for%20each%20subnode%20device.%20The%20main%20microcontroller%20has%20settings%20to%20support%20various%20subnode%20devices.%3C%2FP%3E%0A%3CP%3EThe%20basic%20transfer%20procedure%20begins%20by%20asserting%20CS%20connected%20to%20the%20destination%20subnode.%20The%20transfer%20ends%20when%20CS%20is%20deasserted.%20CS%20is%20asserted%20and%20deasserted%20using%20a%20LOW%20and%20HIGH%20signal%2C%20but%20the%20polarity%20is%20dictated%20by%20the%20subnode%20device%20specifications.%20Many%20devices%20use%20MSB%20first%20for%20data%20bit%20ordering%2C%20but%20there%20are%20exceptions%20to%20this.%20There%20is%20also%20no%20specific%20rule%20about%20the%20number%20of%20bits%20used%20as%20the%20transfer%20unit.%20I%20have%20seen%20explanations%20that%20say%20it%20is%202%20to%2016%20bits%2C%20but%20this%20is%20not%20the%20case%20as%20there%20are%20subnodes%20that%20use%20larger%20bit%20lengths%20as%20units%20(for%20example%2C%2064%20bits).%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx3-1%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId-358145311%22%20id%3D%22toc-hId-416322358%22%3E3.1%20Mode%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3ESPI%20has%20settings%20called%20%22%20%3CSTRONG%3Emodes%3C%2FSTRONG%3E%20%2C%22%20which%20refer%20to%20combinations%20of%20clock%20polarity%20and%20edge%20selection%2C%20and%20there%20are%20four%20modes%20with%20two%20settings%20each%20%5BFigure%202%5D.%3C%2FP%3E%0A%3CP%3EClock%20polarity%20is%20a%20setting%20called%20%3CSTRONG%3ECPOL%3C%2FSTRONG%3E%20%2C%20which%20determines%20whether%20SCLK%20is%20LOW%20or%20HIGH%20when%20no%20data%20is%20being%20transferred.%20On%20the%20main%20side%2C%20setting%20this%20to%200%20will%20make%20it%20LOW%2C%20and%201%20will%20make%20it%20HIGH.%20Edge%20selection%20(phase)%20is%20called%20%3CSTRONG%3ECPHA%3C%2FSTRONG%3E%20.%20This%20setting%20determines%20whether%20data%20is%20latched%20(taken%20in)%20on%20the%20first%20or%20second%20clock%20edge.%20A%20setting%20of%200%20selects%20the%20first%20edge%2C%20and%20a%20setting%20of%201%20selects%20the%20second%20edge.%20CPOL%20and%20CPHA%20can%20sometimes%20be%20combined%20to%20represent%20modes%200%20to%203%20%5BTable%202%5D.%3C%2FP%3E%0A%3CP%3EIn%20addition%2C%20please%20note%20that%20there%20are%20also%20subnodes%20with%20reversed%20chip%20select%20polarity.%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.42.56.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.42.56.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F322153i43BA6998F38102EE%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.42.56.png%22%20alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.42.56.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%20%3CEM%3EFigure%202%3A%20Mode%20(CPOL%2C%20CPHA)%3C%2FEM%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%20class%3D%22lia-align-center%22%20style%3D%22margin-left%3A%20auto%3B%20margin-right%3A%20auto%3B%20background%3A%20%23F7F5F1%3B%22%20border%3D%221%22%20width%3D%2250%25%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%0A%3CTBODY%3E%0A%3CTR%20style%3D%22background%3A%20%23EBE7DD%3B%22%3E%0A%3CTD%20height%3D%2225px%22%3E%26nbsp%3B%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3ECPOL%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3ECPHA%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2225px%22%3Emode%3D0%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E0%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E0%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2225px%22%3Emode%3D1%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E0%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E1%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2225px%22%3Emode%3D2%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E1%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E0%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20height%3D%2225px%22%3Emode%3D3%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E1%3C%2FTD%3E%0A%3CTD%20height%3D%2225px%22%3E1%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%3CEM%3ETable%202%3A%20Modes%20and%20CPOL%2C%20CPHA%3C%2FEM%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EWhat%20is%20the%20%22edge%20that%20latches%20data%22%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EData%20is%20sent%20and%20received%20in%20sync%20with%20the%20clock%2C%20but%20data%20changes%20on%20either%20the%20rising%20or%20falling%20edge%20of%20the%20clock.%20Figure%203%20shows%20an%20example%20of%20data%20changing%20on%20the%20falling%20edge.%20The%20main%20side%20changes%20its%20MOSI%20output%2C%20and%20the%20subnode%20side%20changes%20its%20MISO%20output%2C%20in%20time%20with%20the%20falling%20edge%20of%20the%20SCLK%20output%20by%20the%20main%20side%20device.%20The%20next%20data%20changes%20on%20the%20next%20falling%20edge%2C%20but%20until%20then%20the%20state%20remains%20stable.%20The%20rising%20edge%20of%20the%20clock%20occurs%20exactly%20during%20this%20period%2C%20so%20data%20is%20captured%20from%20each%20other%20in%20time%20with%20this%20timing.%20This%20is%20the%20%22latch%20edge.%22%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.54.45.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.54.45.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F322152i54780FA92A04E1F1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.54.45.png%22%20alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%206.54.45.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%3CEM%3EFigure%203%3A%20Data%20(MOSI%2FMISO)%20and%20clock%20(SCLK)%20synchronization%3C%2FEM%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx3-2%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId-224460587%22%20id%3D%22toc-hId-282637634%22%3E3.2%20Data%20Transfer%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAfter%20the%20chip%20select%20is%20asserted%2C%20data%20is%20sent%20and%20received%20in%20synchronization%20with%20the%20clock.%20When%20the%20subnode%20receives%20that%20its%20own%20chip%20select%20is%20asserted%2C%20it%20takes%20in%20and%20outputs%20data%20in%20synchronization%20with%20the%20clock.%3C%2FP%3E%0A%3CP%3E%5BFigure%204%5D%20is%20an%20example%20of%20an%20SPI%20transfer.%20Data%20is%20exchanged%20in%20accordance%20with%20the%20clock%20while%20CS%20is%20asserted.%20Those%20familiar%20with%20logic%20circuits%20will%20see%20that%20this%20is%20achieved%20using%20a%20simple%20circuit%20using%20a%20shift%20register.%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.55.53.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.55.53.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F322156i5C76A73BF453CDD1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.55.53.png%22%20alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%207.55.53.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%20%3CEM%3EFigure%204%3A%20Example%20of%20SPI%20transfer%3C%2FEM%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22idx4%22%20class%3D%22pt1%22%3E%0A%3CH1%20id%3D%22toc-hId--1712076595%22%20id%3D%22toc-hId--1653899548%22%3E4.%20Connection%20Topology%3C%2FH1%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20id%3D%22idx4-1%22%20class%3D%22pt1%22%3E%0A%3CH2%20id%3D%22toc-hId-904518957%22%20id%3D%22toc-hId-962696004%22%3E4.1%20Parallel%20connection%20and%20daisy%20chain%20with%20chip%20select%3C%2FH2%3E%0A%3CBR%20%2F%3E%0A%3CP%3EMultiple%20subnodes%20are%20connected%20as%20shown%20in%20%5BFigure%205%5D.%20A%20chip%20select%20is%20provided%20for%20each%20subnode%2C%20and%20communication%20is%20carried%20out%20by%20specifying%20the%20sender%20and%20receiver%20using%20each%20signal.%20Alternatively%2C%20to%20reduce%20the%20number%20of%20CS%20signals%2C%20a%20daisy-chain%20connection%20can%20be%20used%2C%20and%20communication%20can%20be%20carried%20out%20by%20treating%20the%20subnodes%20as%20a%20single%20subnode%20with%20an%20extended%20bit%20length%20%5BFigure%206%5D.%3C%2FP%3E%0A%3CP%3EAs%20mentioned%20earlier%2C%20care%20must%20be%20taken%20when%20connecting%20multiple%20types%20of%20subnodes%20to%20the%20same%20SPI%20bus.%20As%20mentioned%20earlier%2C%20the%20%22mode%2C%22%20chip%20select%20polarity%2C%20and%20data%20bit%20length%20may%20not%20be%20the%20same.%20For%20this%20reason%2C%20you%20may%20need%20to%20switch%20settings%20or%20make%20adjustments%20in%20the%20hardware%20each%20time%20you%20communicate%20with%20each%20subnode.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.09.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.09.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F322157iB0957AD902B08984%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.09.png%22%20alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.09.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%3CEM%3EFigure%205%3A%20Parallel%20connection%3C%2FEM%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.21.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.21.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F322158iDA2175B8E571C896%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.21.png%22%20alt%3D%22%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202025-02-03%208.25.21.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-center%22%20style%3D%22text-align%3A%20center%3B%22%20style%3D%22text-align%3A%20center%3B%22%3E%3CEM%3EFigure%206%3A%20Daisy%20chain%20connection%3C%2FEM%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22idx5%22%20class%3D%22pt1%22%3E%0A%3CH1%20id%3D%22toc-hId--1032018225%22%20id%3D%22toc-hId--973841178%22%3E5.%20Reference%20materials%3C%2FH1%3E%0A%3CBR%20%2F%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.oshwa.org%2Fa-resolution-to-redefine-spi-signal-names%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EOSHWA%20Role%20and%20Signal%20Names%3C%2FA%3E%20%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%5BEnglish%5D%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FSerial_Peripheral_Interface%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EWikipedia%20page%20on%20%22SPI%22%3C%2FA%3E%20%3A%20Signal%20names%20and%20main%2Fsubnode%20names%20in%20this%20blog%20are%20based%20on%20this%20description%20%3CFONT%20size%3D%221%202%203%204%205%206%207%22%20style%3D%22font-family%3A%20inherit%3B%22%3E.%3C%2FFONT%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Finterface.cqpub.co.jp%2Fmagazine%2F202403%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EInterface%20March%202024%20issue%20(CQ%20Publishing)%3C%2FA%3E%20%3A%20Special%20feature%20%22Serial%20communication%20from%20scratch%20%5BUART%2FI2C%2FSPI%20with%20Pico%5D%22%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fja%2Fproduct-selector-guide%2FI2CSELECTORBROC.pdf%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENXP%20System%20Management%20I%C2%B2C%2C%20I3C%2C%20SPI%20Selector%20Guide%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FI3C-%25E3%2581%259D%25E3%2581%25AE%25E6%25AC%25A1%25E3%2581%25AE%25E3%2582%25B7%25E3%2583%25AA%25E3%2582%25A2%25E3%2583%25AB%25E3%2583%2590%25E3%2582%25B9%2Fba-p%2F2036760%22%20target%3D%22_self%22%3ENXP%20Community%20Blog%3A%20I3C%3A%20The%20Next%20Serial%20Bus%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FI-C%25E3%2583%2590%25E3%2582%25B9%25E3%2581%25AE%25E6%25A6%2582%25E8%25A6%2581%2Fba-p%2F2036898%22%20target%3D%22_self%22%3ENXP%20Community%20Blog%3A%20An%20Overview%20of%20the%20I%C2%B2C%20Bus%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%5BOriginally%20published%20in%20Interface%2C%20March%202024%20issue%20(CQ%20Publishing)%2C%20%22Building%20I2C%20%26amp%3B%20SPI%20from%20Scratch%20%E2%91%A3...%20SPI%20Communication%20Standards%2C%22%20pp.%2071-73.%20The%20section%20explaining%20the%20communication%20specifications%20has%20been%20excerpted%20and%20revised%20for%20this%20blog%20post.%5D%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3EChangelog%3A%3CBR%20%2F%3E%202025-02-03%3A%20First%20edition%3CBR%20%2F%3E%202025-02-25%3A%20Added%20link%20to%20%22NXP%20System%20Management%20I%C2%B2C%2C%20I3C%2C%20SPI%20Selector%20Guide%22%20in%20%225.%20References%22%20section.%3C%2FSPAN%3E%20%3CSPAN%3E%3CBR%20%2F%3E2025-05-01%3A%20Corrected%20the%20table%20of%20contents%20(deleted%20items)%2C%20corrected%20the%20item%20name%20in%20Section%202.2%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3C%2FP%3E%0A%3CP%3EWe%20are%20currently%20unable%20to%20respond%20to%20comments%20in%20the%20%22Comment%22%20section%20of%20this%20post.%3CBR%20%2F%3E%20We%20apologize%20for%20the%20inconvenience%2C%20but%20when%20making%20inquiries%2C%20please%20refer%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FNXP%25E3%2581%25B8%25E3%2581%25AE%25E6%258A%2580%25E8%25A1%2593%25E8%25B3%25AA%25E5%2595%258F-%25E5%2595%258F%25E3%2581%2584%25E5%2590%2588%25E3%2582%258F%25E3%2581%259B%25E6%2596%25B9%25E6%25B3%2595-%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%25E3%2583%2596%25E3%2583%25AD%25E3%2582%25B0%2Fba-p%2F2153299%22%20target%3D%22_blank%22%3E%20to%20%60%60%20Technical%20Questions%20to%20NXP%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FNXP%25E3%2581%25B8%25E3%2581%25AE%25E6%258A%2580%25E8%25A1%2593%25E8%25B3%25AA%25E5%2595%258F-%25E5%2595%258F%25E3%2581%2584%25E5%2590%2588%25E3%2582%258F%25E3%2581%259B%25E6%2596%25B9%25E6%25B3%2595-%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%25E3%2583%2596%25E3%2583%25AD%25E3%2582%25B0%2Fba-p%2F2153299%22%20target%3D%22_blank%22%3E%20-%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FNXP%25E3%2581%25B8%25E3%2581%25AE%25E6%258A%2580%25E8%25A1%2593%25E8%25B3%25AA%25E5%2595%258F-%25E5%2595%258F%25E3%2581%2584%25E5%2590%2588%25E3%2582%258F%25E3%2581%259B%25E6%2596%25B9%25E6%25B3%2595-%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%25E3%2583%2596%25E3%2583%25AD%25E3%2582%25B0%2Fba-p%2F2153299%22%20target%3D%22_blank%22%3E%20How%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FNXP%25E3%2581%25B8%25E3%2581%25AE%25E6%258A%2580%25E8%25A1%2593%25E8%25B3%25AA%25E5%2595%258F-%25E5%2595%258F%25E3%2581%2584%25E5%2590%2588%25E3%2582%258F%25E3%2581%259B%25E6%2596%25B9%25E6%25B3%2595-%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%25E3%2583%2596%25E3%2583%25AD%25E3%2582%25B0%2Fba-p%2F2153299%22%20target%3D%22_blank%22%3E%20to%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FNXP%25E3%2581%25B8%25E3%2581%25AE%25E6%258A%2580%25E8%25A1%2593%25E8%25B3%25AA%25E5%2595%258F-%25E5%2595%258F%25E3%2581%2584%25E5%2590%2588%25E3%2582%258F%25E3%2581%259B%25E6%2596%25B9%25E6%25B3%2595-%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%25E3%2583%2596%25E3%2583%25AD%25E3%2582%25B0%2Fba-p%2F2153299%22%20target%3D%22_blank%22%3E%20Contact%20Us(%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FNXP%25E3%2581%25B8%25E3%2581%25AE%25E6%258A%2580%25E8%25A1%2593%25E8%25B3%25AA%25E5%2595%258F-%25E5%2595%258F%25E3%2581%2584%25E5%2590%2588%25E3%2582%258F%25E3%2581%259B%25E6%2596%25B9%25E6%25B3%2595-%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%25E3%2583%2596%25E3%2583%25AD%25E3%2582%25B0%2Fba-p%2F2153299%22%20target%3D%22_blank%22%3E%20Japanese%3C%2FA%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FNXP-Tech-Blog%2FNXP%25E3%2581%25B8%25E3%2581%25AE%25E6%258A%2580%25E8%25A1%2593%25E8%25B3%25AA%25E5%2595%258F-%25E5%2595%258F%25E3%2581%2584%25E5%2590%2588%25E3%2582%258F%25E3%2581%259B%25E6%2596%25B9%25E6%25B3%2595-%25E6%2597%25A5%25E6%259C%25AC%25E8%25AA%259E%25E3%2583%2596%25E3%2583%25AD%25E3%2582%25B0%2Fba-p%2F2153299%22%20target%3D%22_blank%22%3E%20Blog)%3C%2FA%3E%20''.%3CBR%20%2F%3E%20(If%20you%20are%20already%20an%20NXP%20distributor%20or%20have%20a%20relationship%20with%20NXP%2C%20you%20may%20ask%20the%20person%20in%20charge%20directly.)%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2036964%22%20slang%3D%22ja-JP%22%20mode%3D%22CREATE%22%3E%3CP%3ESPI%20bus%20used%20for%20communication%20between%20microcontrollers%2Fprocessors%20and%20peripheral%20devices.%3C%2FP%3E%0A%3CP%3EAlthough%20this%20serial%20bus%20is%20so%20commonly%20used%2C%20I%20would%20like%20to%20take%20this%20opportunity%20to%20summarize%20its%20origins.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2036964%22%20slang%3D%22ja-JP%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ecommunication%20standards%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EInterface%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EJapanese%20blog%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E