SlideShare a Scribd company logo
1 of 18
SPI INTERFACE
Joseph
2016/08/08
1
SPI 線路
2
SPI 為一個Ring 結構:要讀資料,必送資料
{dummy byte}
CPOL: rest state of clock (high or low)
CPHA: First or second SCLK transition
CPOL,CPHA 用來決定latch 資料的時間點
SPI 模式
3
Serial Flash (SPI interface)
Flash size: 4Mbit
1) 64K Block size (Block Erase)
2) 4K Sector size (Sector Erase, Block_Erase_4K)
3) 256 Byte Page size (Page Program)
Single Power Supply Operation
• 2.7 to 3.6 volt for read, erase, and program operations
SPI Modes : Mode 0 & Mode 1
注意:
1) Flash 要寫入page之前,要先Erase
2) Page Program->"0", Erase -->"1"
3) 傳送順序為 MSB First
MX25L4005A 規格
4
MX25L4005A Addressing (3 byte)
Flash Memory Organization
Page #Sector #Block #
11 01523 18 12 8 7
Offset #
AD1 AD2 AD3
16
Sector Address A[18:12]
MSB LSB
Page Program (0x02)Page Address A[18:8] + Offset A[7:0]
. . .
256 byte
1 page=256 bytes
Sector Erase (0x20)
5
16 pages
Read Status Register (RDSR)
6
Command Table
7
對於 PP, SE, BE, CE, and WRSR 會改變Flash內容的Command, 都
要先設定WEL bit=1 (in RDSR bit 1), 一旦操作完成後, 它會自動reset
(將WEL bit設回0)
操作方法:
MX25L4005A 操作方法
CS# goes low
sending WREN (0x6); // set WEL=1
CS# goes high
CS# goes low
sending <CMD>+{Flash Address}+{Data}; //see command table
CS# goes high
CS# goes low
deadline = jiffies + MAX_READY_WAIT_JIFFIES;
do {
status=sending RDSR(0x5) ;
if (!(status & WIP) ) return 0; //判斷是否操作完成
cond_resched(); // 再排程
} while (!time_after_eq(jiffies, deadline));
CS# goes high
8
Read ID command
MX25L4005A FlashID:C22013
C2 20 13
9
Page Program
送出24 bit Address 決定了寫入位址(page+offset)後, 接著就是在這個page內偱序寫入資料。
因為page size為256 byte, 所以最多只能寫256 Byte, 超過會覆蓋到同page的開頭
10
write_flash(addr, buf, len) ;
在位址 0x2085, 寫入長度是786 byte時, 該進行何種程序? 假設
Page 為256 bytes
Answer:要執行4次Page Program cycle (每次不同的Page address)
Quiz
11
addr
len
page
PP(0x2100,256)
PP(0x2200,256)
PP(0x2300,151)
PP(0x2085,123)
page offset 0x85
SPI 操作-big-banging
void SendByte( uint8 byte_value )
{
uint16 i;
uint8 cycle_cnt;
cycle_cnt = 8;
for( i= 0; i < cycle_cnt; i++ )
{
if ( (byte_value & IO_MASK) == 0x80 ){
SI = 1;
}
else{
SI = 0;
}
SCLK = 0;
byte_value = byte_value << 1;
SCLK = 1;
}
}
uint8 GetByte( )
{
uint16 i;
uint8 cycle_cnt;
uint8 data_buf;
data_buf = 0;
cycle_cnt = 8;
for( i= 0; i < cycle_cnt; i++ )
{
SCLK = 0;
if ( SO == 1 ){
data_buf = (data_buf | (0x80 >> i));
}
SCLK = 1;
}
return data_buf;
}
SCLK = 1; // init Flash input clock
12
SPI Mode : 3
SPI 操作 - big-banging
ReturnMsg CMD_RDID( uint32 *Identification )
{
uint32 temp;
uint8 gDataBuffer[3];
// Chip select go low to start a flash command
CS_Low();
// Send command
#define FLASH_CMD_RDID 0x9F //RDID (Read Identification)
SendByte( FLASH_CMD_RDID);
// Get manufacturer identification, device identification
gDataBuffer[0] = GetByte( );
gDataBuffer[1] = GetByte( );
gDataBuffer[2] = GetByte( );
// Chip select go high to end a command
CS_High();
// Store identification
temp = gDataBuffer[0];
temp = (temp << 8) | gDataBuffer[1];
*Identification = (temp << 8) | gDataBuffer[2];
// Flash ID:C22013
return FlashOperationSuccess;
}
13
ADC (MCP3008)
2.7V 4-Channel/8-Channel 10-Bit A/D Converters with SPI Serial Interface
4 pseudo-differential input pairs or 8 single-ended inputs
LSB: 最小刻度
VREF determines the
analog input voltage range
SPI COMMUNICATION
SPI Interface

More Related Content

What's hot

Llpc2148 sci
Llpc2148 sciLlpc2148 sci
Llpc2148 sci
anishgoel
 
Лекц 8
Лекц 8Лекц 8
Лекц 8
Muuluu
 
Switch configuration
Switch configurationSwitch configuration
Switch configuration
Muuluu
 

What's hot (20)

Serial peripheral interface
Serial peripheral interfaceSerial peripheral interface
Serial peripheral interface
 
Linkmeup v23-compass-eos
Linkmeup v23-compass-eosLinkmeup v23-compass-eos
Linkmeup v23-compass-eos
 
I2C
I2CI2C
I2C
 
Llpc2148 sci
Llpc2148 sciLlpc2148 sci
Llpc2148 sci
 
COMPLETE DETAIL OF ARM PART 3
COMPLETE DETAIL OF ARM PART 3COMPLETE DETAIL OF ARM PART 3
COMPLETE DETAIL OF ARM PART 3
 
OSPF Internal Route Summarization
OSPF Internal Route SummarizationOSPF Internal Route Summarization
OSPF Internal Route Summarization
 
Spi (1)
Spi (1)Spi (1)
Spi (1)
 
Redistribution into OSPF
Redistribution into OSPFRedistribution into OSPF
Redistribution into OSPF
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
Serial connectors, Protocols , USB (universal serial bus)
Serial connectors, Protocols , USB (universal serial bus)Serial connectors, Protocols , USB (universal serial bus)
Serial connectors, Protocols , USB (universal serial bus)
 
I2 c communication protocol
I2 c communication protocolI2 c communication protocol
I2 c communication protocol
 
arm complete detail part 2
arm complete detail part 2arm complete detail part 2
arm complete detail part 2
 
CCNA ppt Day 7
CCNA ppt Day 7CCNA ppt Day 7
CCNA ppt Day 7
 
Лекц 8
Лекц 8Лекц 8
Лекц 8
 
FAR/MARS Avionics CDR
FAR/MARS Avionics CDRFAR/MARS Avionics CDR
FAR/MARS Avionics CDR
 
Switch configuration
Switch configurationSwitch configuration
Switch configuration
 
I2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication ProtocolI2c protocol - Inter–Integrated Circuit Communication Protocol
I2c protocol - Inter–Integrated Circuit Communication Protocol
 
My i2c
My i2cMy i2c
My i2c
 
SPI Bus Protocol
SPI Bus ProtocolSPI Bus Protocol
SPI Bus Protocol
 
I2c buses
I2c busesI2c buses
I2c buses
 

Similar to SPI Interface

Cisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentationCisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentation
Jeff Squyres
 

Similar to SPI Interface (20)

[KOR] ODI no.004 analysis of oracle performance degradation caused by ineffic...
[KOR] ODI no.004 analysis of oracle performance degradation caused by ineffic...[KOR] ODI no.004 analysis of oracle performance degradation caused by ineffic...
[KOR] ODI no.004 analysis of oracle performance degradation caused by ineffic...
 
POWER10 innovations for HPC
POWER10 innovations for HPCPOWER10 innovations for HPC
POWER10 innovations for HPC
 
The Quantum Physics of Java
The Quantum Physics of JavaThe Quantum Physics of Java
The Quantum Physics of Java
 
DOAG Security Day 2016 Enterprise Security Reloaded
DOAG Security Day 2016 Enterprise Security ReloadedDOAG Security Day 2016 Enterprise Security Reloaded
DOAG Security Day 2016 Enterprise Security Reloaded
 
Super scaling singleton inserts
Super scaling singleton insertsSuper scaling singleton inserts
Super scaling singleton inserts
 
Cisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentationCisco EuroMPI'13 vendor session presentation
Cisco EuroMPI'13 vendor session presentation
 
MaPU-HPCA2016
MaPU-HPCA2016MaPU-HPCA2016
MaPU-HPCA2016
 
8051 skb's- part - i
8051  skb's- part - i8051  skb's- part - i
8051 skb's- part - i
 
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
助教が吼える! 各界の若手研究者大集合「ハードウェアはやわらかい」
 
了解Cpu
了解Cpu了解Cpu
了解Cpu
 
Design and Implementation of 64 Bit RISC Processor Using System.pdf
Design and Implementation of 64 Bit RISC Processor Using System.pdfDesign and Implementation of 64 Bit RISC Processor Using System.pdf
Design and Implementation of 64 Bit RISC Processor Using System.pdf
 
Oracle Deep Internal 4 (ver.2)
Oracle Deep Internal 4 (ver.2)Oracle Deep Internal 4 (ver.2)
Oracle Deep Internal 4 (ver.2)
 
Proving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slobProving out flash storage array performance using swingbench and slob
Proving out flash storage array performance using swingbench and slob
 
Microprocessor Week1: Introduction
Microprocessor Week1: IntroductionMicroprocessor Week1: Introduction
Microprocessor Week1: Introduction
 
lecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdflecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdf
 
IPv6 Static Routes
IPv6 Static RoutesIPv6 Static Routes
IPv6 Static Routes
 
8051
80518051
8051
 
QSpiders - Basic intel architecture
QSpiders - Basic intel architectureQSpiders - Basic intel architecture
QSpiders - Basic intel architecture
 
了解网络
了解网络了解网络
了解网络
 
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran LonikarExploiting GPU's for Columnar DataFrrames by Kiran Lonikar
Exploiting GPU's for Columnar DataFrrames by Kiran Lonikar
 

More from 艾鍗科技

More from 艾鍗科技 (20)

TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
Appendix 1 Goolge colab
Appendix 1 Goolge colabAppendix 1 Goolge colab
Appendix 1 Goolge colab
 
Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用Project-IOT於餐館系統的應用
Project-IOT於餐館系統的應用
 
02 IoT implementation
02 IoT implementation02 IoT implementation
02 IoT implementation
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge
 
Openvino ncs2
Openvino ncs2Openvino ncs2
Openvino ncs2
 
Step motor
Step motorStep motor
Step motor
 
2. 機器學習簡介
2. 機器學習簡介2. 機器學習簡介
2. 機器學習簡介
 
5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron) 5.MLP(Multi-Layer Perceptron)
5.MLP(Multi-Layer Perceptron)
 
3. data features
3. data features3. data features
3. data features
 
心率血氧檢測與運動促進
心率血氧檢測與運動促進心率血氧檢測與運動促進
心率血氧檢測與運動促進
 
利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆利用音樂&情境燈幫助放鬆
利用音樂&情境燈幫助放鬆
 
IoT感測器驅動程式 在樹莓派上實作
IoT感測器驅動程式在樹莓派上實作IoT感測器驅動程式在樹莓派上實作
IoT感測器驅動程式 在樹莓派上實作
 
無線聲控遙控車
無線聲控遙控車無線聲控遙控車
無線聲控遙控車
 
最佳光源的研究和實作
最佳光源的研究和實作最佳光源的研究和實作
最佳光源的研究和實作
 
無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車無線監控網路攝影機與控制自走車
無線監控網路攝影機與控制自走車
 
Reinforcement Learning
Reinforcement LearningReinforcement Learning
Reinforcement Learning
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
人臉辨識考勤系統
人臉辨識考勤系統人臉辨識考勤系統
人臉辨識考勤系統
 
智慧家庭Smart Home
智慧家庭Smart Home智慧家庭Smart Home
智慧家庭Smart Home
 

Recently uploaded

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 

Recently uploaded (20)

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 

SPI Interface

  • 2. SPI 線路 2 SPI 為一個Ring 結構:要讀資料,必送資料 {dummy byte}
  • 3. CPOL: rest state of clock (high or low) CPHA: First or second SCLK transition CPOL,CPHA 用來決定latch 資料的時間點 SPI 模式 3
  • 4. Serial Flash (SPI interface) Flash size: 4Mbit 1) 64K Block size (Block Erase) 2) 4K Sector size (Sector Erase, Block_Erase_4K) 3) 256 Byte Page size (Page Program) Single Power Supply Operation • 2.7 to 3.6 volt for read, erase, and program operations SPI Modes : Mode 0 & Mode 1 注意: 1) Flash 要寫入page之前,要先Erase 2) Page Program->"0", Erase -->"1" 3) 傳送順序為 MSB First MX25L4005A 規格 4
  • 5. MX25L4005A Addressing (3 byte) Flash Memory Organization Page #Sector #Block # 11 01523 18 12 8 7 Offset # AD1 AD2 AD3 16 Sector Address A[18:12] MSB LSB Page Program (0x02)Page Address A[18:8] + Offset A[7:0] . . . 256 byte 1 page=256 bytes Sector Erase (0x20) 5 16 pages
  • 8. 對於 PP, SE, BE, CE, and WRSR 會改變Flash內容的Command, 都 要先設定WEL bit=1 (in RDSR bit 1), 一旦操作完成後, 它會自動reset (將WEL bit設回0) 操作方法: MX25L4005A 操作方法 CS# goes low sending WREN (0x6); // set WEL=1 CS# goes high CS# goes low sending <CMD>+{Flash Address}+{Data}; //see command table CS# goes high CS# goes low deadline = jiffies + MAX_READY_WAIT_JIFFIES; do { status=sending RDSR(0x5) ; if (!(status & WIP) ) return 0; //判斷是否操作完成 cond_resched(); // 再排程 } while (!time_after_eq(jiffies, deadline)); CS# goes high 8
  • 9. Read ID command MX25L4005A FlashID:C22013 C2 20 13 9
  • 10. Page Program 送出24 bit Address 決定了寫入位址(page+offset)後, 接著就是在這個page內偱序寫入資料。 因為page size為256 byte, 所以最多只能寫256 Byte, 超過會覆蓋到同page的開頭 10
  • 11. write_flash(addr, buf, len) ; 在位址 0x2085, 寫入長度是786 byte時, 該進行何種程序? 假設 Page 為256 bytes Answer:要執行4次Page Program cycle (每次不同的Page address) Quiz 11 addr len page PP(0x2100,256) PP(0x2200,256) PP(0x2300,151) PP(0x2085,123) page offset 0x85
  • 12. SPI 操作-big-banging void SendByte( uint8 byte_value ) { uint16 i; uint8 cycle_cnt; cycle_cnt = 8; for( i= 0; i < cycle_cnt; i++ ) { if ( (byte_value & IO_MASK) == 0x80 ){ SI = 1; } else{ SI = 0; } SCLK = 0; byte_value = byte_value << 1; SCLK = 1; } } uint8 GetByte( ) { uint16 i; uint8 cycle_cnt; uint8 data_buf; data_buf = 0; cycle_cnt = 8; for( i= 0; i < cycle_cnt; i++ ) { SCLK = 0; if ( SO == 1 ){ data_buf = (data_buf | (0x80 >> i)); } SCLK = 1; } return data_buf; } SCLK = 1; // init Flash input clock 12 SPI Mode : 3
  • 13. SPI 操作 - big-banging ReturnMsg CMD_RDID( uint32 *Identification ) { uint32 temp; uint8 gDataBuffer[3]; // Chip select go low to start a flash command CS_Low(); // Send command #define FLASH_CMD_RDID 0x9F //RDID (Read Identification) SendByte( FLASH_CMD_RDID); // Get manufacturer identification, device identification gDataBuffer[0] = GetByte( ); gDataBuffer[1] = GetByte( ); gDataBuffer[2] = GetByte( ); // Chip select go high to end a command CS_High(); // Store identification temp = gDataBuffer[0]; temp = (temp << 8) | gDataBuffer[1]; *Identification = (temp << 8) | gDataBuffer[2]; // Flash ID:C22013 return FlashOperationSuccess; } 13
  • 14. ADC (MCP3008) 2.7V 4-Channel/8-Channel 10-Bit A/D Converters with SPI Serial Interface 4 pseudo-differential input pairs or 8 single-ended inputs
  • 15.
  • 16. LSB: 最小刻度 VREF determines the analog input voltage range