摘 要:在現代EDA外圍電子器件的接口中存在多種標準,已知的一些接口協議存在速度慢、協議復雜等問題。SPI總線是能夠克服上述缺點的一種外圍串行總線,其能很好地滿足要求。通過使用Lattice公司的FPGA芯片以及工程開發軟件,特別是在線邏輯分析儀這一先進的EDA工具,實現了基于FPGA的SPI接口的連接。將FPGA編程的靈活性和SPI總線的易用性結合,實現了FLASH的存取功能。同時也為同類型接口的芯片應用提供了一個原型,為進一步的工程設計提供了支持。
關鍵詞: FPGA; FLASH; SPI; 在線邏輯分析
中圖分類號:TN710; TP336 文獻標識碼:A
文章編號:1004-373X(2010)14-0102-03
Implementation of SPI Bus Interface Based on FPGA
WANG Jue-wen1, JIN Wei-xin2, CAI Yi-bing2, YAN Li-ping2
(1. PLA University of Science and Technology, Nanjing 210007, China; 2. CEDSEC, Beijing 100141, China)
Abstract: There are many standards in the scope of interfaces for peripheral electronic devices in the field of modern EDA. Some known interface protocols perform an unsatisfactory role with their low speed or complexity. SPI bus is a popular peripheral serial bus which can satisfy the practical demand. By using Lattice FPGA and its EDA software, especially the on-line logic analyzer which is an advanced EDA tool, the connection of SPI bus interface based on FPGA was implemented. The access function of FLASH was realized in combination with the flexibility of FPGA programming and the adaptability of SPI bus. At the same time, it can be taken as a prototype, which can be used in a further profound exploitation in EDA projection.
Keywords: FPGA; FLASH; SPI; on-line logic analysis
0 引 言
串行接口已成為當前傳輸接口的發展趨勢,原因在于串行的高速率傳輸性能和較簡單的線路連接。在已知的外圍器件連接端口中,有USB,wishbone和并行端口。其中SPI接口總線基于串行傳輸的思想,已經制定成為標準,成為常用的外圍器件連接方式。針對FLASH這種常用的外圍存儲器件,有多種接口可供選擇,然而具有SPI接口的FLASH芯片硬件連接方便,通過FPGA編程可以便捷地實現FLASH的存取功能。因此基于FPGA的具有SPI總線接口的FLASH功能實現為工程設計提供了一種原型,為進一步的工程開發奠定了基礎。
1 SPI總線介紹
1.1 SPI總線簡介
同步外設接口(serial peripheral interface,SPI)是由摩托羅拉公司開發的全雙工同步串行總線。SPI是一種串行同步通信協議,由1個主設備和1個或多個從設備組成,主設備啟動一個與從設備的同步通信,從而完成數據的交換。
1.2 SPI總線接口及時序
SPI接口由SDI(串行數據輸入),SDO(串行數據輸出),SCK(串行移位時鐘),CS(從使能信號)四種信號構成,CS決定了惟一的與主設備通信的從設備,如沒有CS信號,則只能存在一個從設備,主設備通過產生移位時鐘來發起通信。……