TW201112002A - Data transmission device and method based on serial peripheral interface - Google Patents

Data transmission device and method based on serial peripheral interface Download PDF

Info

Publication number
TW201112002A
TW201112002A TW98133052A TW98133052A TW201112002A TW 201112002 A TW201112002 A TW 201112002A TW 98133052 A TW98133052 A TW 98133052A TW 98133052 A TW98133052 A TW 98133052A TW 201112002 A TW201112002 A TW 201112002A
Authority
TW
Taiwan
Prior art keywords
host
slave
internal clock
controller
data
Prior art date
Application number
TW98133052A
Other languages
Chinese (zh)
Other versions
TWI394050B (en
Inventor
Cheng-Wen Huang
Original Assignee
Hon Hai Prec Ind Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Priority to TW98133052A priority Critical patent/TWI394050B/en
Publication of TW201112002A publication Critical patent/TW201112002A/en
Application granted granted Critical
Publication of TWI394050B publication Critical patent/TWI394050B/en

Links

Abstract

The present invention provides a data transmission method based on serial peripheral interface (SPI). The method generates a master clock for a master controller and a slave clock for a slave controller. Frequencies of the master clock and the slave clock are twice the frequency of a serial clock between the master controller and the slave controller. The master clock is counted to control data transmission of the master controller. The slave clock is counted to control data transmission of the slave controller.

Description

201112002 六、發明說明: 【發明所屬之技術領域】 • _]本發明涉及-種串列資料傳輪設似其資料傳輪方法, [0002] 尤其關於一種基於串列週邊介面匯流排的設備及其資料 傳輸方法。 ' 【先前技術】 串列週邊介面(Serial Peripheral Interface,spi )是一種串列同步通訊介面。利用該介面,主設備(即 ❹ 主機)可以與一個或多個從設備〈即從機)以串列方式 進行資料傳輸。 [0003] ❹ 傳統的S PI匯流排系統基於主設備提供給從設備的串列時 鐘訊號進行資料傳輸,每個串列時鐘週期發送丨比特資料 。適當地提高串列時鐘訊號的頻率,可以獲得較高的資 料傳輸速率。例如,當串列時鐘訊號頻率為8MHZ時資 料傳輸速率為8Mbps,當串烈a夺鐘tfL蜱頻率提高到UMHz 時,資料傳輸速率提高到1叫bps然而,串列時鐘訊號 的頻率是受限的,不能任彖提高。例如,為了保證訊號 ' -,.4 %,,· 完整性’最高串列時鐘訊號的頻率為32MHz。相對應地, 傳統的SPI匯流排系統的資料傳輸速率也受到了限制。例 如’當最高串列時鐘訊號的頻率為32MHz時,最高資料傳 輸速率只能達到32Mbps。 [0004] 另一方面’目前絕大多數的SPI匯流排系統使用的是傳統 的51>1匯流排’為了與傳統的SPI匯流排系統進行資料傳 輸’相容性問題不容忽視。 【發明内容】 098133052 表單編號A0101 第3頁/共37頁 0982056595-0 201112002 [0005] 鑒於以上内容,有必要提供一種基於串列週邊介面(SPI )匯流排的設備及其資料傳輸方法,能夠實現高速率的 資料傳輸,並且相容習知技術的SPI匯流排系統。 [0006] 一種基於SPI匯流排的主機控制器,可以與基於SPI匯流 排的從機控,器進行資料傳輸,該主機控制器包括:主 機時鐘產生單元,用於生成主機内部時鐘;從機選擇單 元,用於選擇與主機控制器進行資料傳輸的從機控制器 ;主機時鐘分頻單元,用於將主機内部時鐘二分頻生成 串列時鐘訊號,並將該串列時鐘訊號發送給選擇的從機 控制器;主機時鐘計數單元,用於對主機内部時鐘計數 :主機位址緩衝區,用於緩存發送給選擇的從機控制器 的目標位址;主機輸出資料緩衝區,用於緩存發送給選 擇的從機控制器的有效資料;主機輸出控制邏輯單元, 用於生成讀/寫操作控制符,從主機位址缓衝區讀取發送 給選擇的從機控制器的目標位址,從主機輸出資料緩衝 區讀取發送給選擇的從機控制器的有效資料,並根據主 機内部時鐘及主機内部時鐘計數值按照指定的順序將讀/ 寫操作控制符、目標位址以及有效資料發送給選擇的從 機控制器,所述讀/寫操作控制符用於控制選擇的從機控 制器執行相對應的讀/寫操作;及主機輸入控制邏輯單元 ,用於根據主機内部時鐘及主機内部時鐘計數值接收選 擇的從機控制器發送來的有效資料,並將接收的有效資 料緩存到主機輸入資料緩衝區。 [0007] —種基於串列週邊介面(SPI)匯流排的資料傳輸方法, 用於在主機控制器與從機控制器之間進行資料傳輸,該 098133052 表單編號A0101 第4頁/共37頁 0982056595-0 201112002201112002 VI. Description of the invention: [Technical field to which the invention pertains] • _] The present invention relates to a method for data transmission of a serial data transmission, [0002], in particular, a device based on a serial peripheral interface bus and Its data transmission method. [Prior Art] The Serial Peripheral Interface (spi) is a serial synchronous communication interface. With this interface, the master device (i.e., the master) can perform data transfer in tandem with one or more slave devices (i.e., slaves). [0003] ❹ The conventional S PI bus system performs data transmission based on the serial clock signals provided by the master device to the slave devices, and transmits the bit data every serial clock cycle. By appropriately increasing the frequency of the serial clock signal, a higher data transfer rate can be obtained. For example, when the serial clock signal frequency is 8 MHz, the data transmission rate is 8 Mbps. When the frequency of the tfL 蜱 is increased to UMHz, the data transmission rate is increased to 1 bps. However, the frequency of the serial clock signal is limited. Can not be improved. For example, to ensure that the signal ' -, .4 %,, · integrity', the highest serial clock signal has a frequency of 32 MHz. Correspondingly, the data transmission rate of the traditional SPI bus system is also limited. For example, when the frequency of the highest serial clock signal is 32MHz, the maximum data transmission rate can only reach 32Mbps. [0004] On the other hand, the vast majority of current SPI bus systems use the traditional 51>1 busbars for data transmission with conventional SPI bus systems. The compatibility issue cannot be ignored. SUMMARY OF THE INVENTION 098133052 Form No. A0101 Page 3 of 37 0982056595-0 201112002 [0005] In view of the above, it is necessary to provide a device based on a serial peripheral interface (SPI) bus and its data transmission method, which can be realized High-speed data transmission, and compatible with the SPI bus system of the prior art. [0006] A host controller based on an SPI bus can perform data transmission with a slave controller based on an SPI bus, the host controller includes: a host clock generation unit for generating a host internal clock; and a slave selection a unit, configured to select a slave controller for data transmission with the host controller; a host clock divider unit, configured to divide the host internal clock by a frequency division to generate a serial clock signal, and send the serial clock signal to the selected one Slave controller; host clock counting unit for counting the internal clock of the host: host address buffer for buffering the destination address sent to the selected slave controller; host output data buffer for buffering and sending A valid data for the selected slave controller; a host output control logic unit for generating a read/write operation control character, reading a target address transmitted from the host address buffer to the selected slave controller, The host output data buffer reads the valid data sent to the selected slave controller and presses according to the internal clock of the host and the internal clock count value of the host. The specified sequence sends the read/write operation control character, the target address, and the valid data to the selected slave controller, and the read/write operation control character is used to control the selected slave controller to perform the corresponding read/write. And the host input control logic unit is configured to receive the valid data sent by the selected slave controller according to the internal clock of the host and the internal clock count value of the host, and buffer the received valid data into the host input data buffer. [0007] A data transmission method based on a serial peripheral interface (SPI) bus for data transmission between a host controller and a slave controller, the 098133052 Form No. A0101 Page 4 of 37 pp. -0 201112002

方法包括步驟:主機控制器生成主機内部時鐘;主機控 制選擇進行資料傳輸的從機控制器;主機控制器將主 機内部時鐘二分頻生成串列時鐘訊號,並將該串列時鐘 訊號發送給選擇的從機控制器;從機控制器將串列時鐘 訊號-倍頻生歧機内料鐘;域㈣輯主機内部 :知片數錢料H對從油料鐘計數;主機控制 Γ虞機内。p時在里叶數值以及主機内部時鐘按照指定 的順序發送4/寫操作控制符及目標位址,從機控制器根 據從機内料鐘計數值以及從機内料鐘接收該讀/寫操 作控制符及目標位址;與寫操作控制#相對應地主機 控制器根據主機内料料數值料主機㈣時鐘按照 指定的順序發送有效資料,從機控制器根據從機内部時 鐘計數值以及從機内部時鐘接收有效資料並將該有效資 Ο 料寫入目的位址指定的儲存單元,或者與讀操作控制符 相對應地,從機控制器從目標位址指定的儲存單元讀取 有效資料,並根據從機内部時鐘:及從機内部時鐘計數值 將該有效資料按照指定的順序齊送給主機控制器,主機 控制器根據主機内部時鐘及主機内部時鐘計數值接收該 有效資料;及主機控制器結束對從機控制器的選擇。 [0008]本發明將主機控制器及從機控制器的内部時鐘的頻率加 倍,利用多個控制邏輯單元協調主機控制器與從機控制 器之間的資料傳輸,每半個串列時鐘週期傳輪〗比特資料 ,實現了高速率的資料傳輪。並且,本發明支持單倍速 的資料傳輸,以相容習知技術的SPI匯流排系統。 【實施方式】 098133052 表單編號A0101 第5頁/共37頁 0982056595-0 201112002 [_9]參閱圖1所示,係串列週邊介面(Serial Peripheral Interface,SPI)匯流排系統較佳實施例的系統架構圖 。该SPI匯流排系統1〇包括主機控制器丨丨及一個或者多個 從機控制器,例如從機控制器12A_12D。主機控制器u 與從機控制器12A-12D之間透過SPI匯流排13進行資料傳 輪。所述SPI匯流排13包括串列時鐘訊號線14、主機輪出 /從機輸入資料線15、主機輪入/從機輸出資料線16以及 從機選擇訊號線17A-17D。所述串列時鐘訊號線ι4傳輸 串列時鐘訊號(SCLK),所述主機輸出/從機輸入資料線 15傳輸主機控制器11發送給從機控制器12A_12D的資料 (M0SI),所述主機輸入/從機輸出資料線16傳輸從機控 制器12A-12D發送給主機控制器η的資料〔μ丨ς〇),所 述從機選擇訊號線17A-17D傳輸從機選廣訊號(/ SS卜/SS4)。SPI匯流排系統10的工作方式包括寫操作 及讀操作。主機控制器11擁有SPI匯流排控制的主動權, 讀、寫操作都由主機控制器11發起。進行寫操作時主 機控制器11將目標位址及有效資料發送給從機控制器 12A-12D,從機控制器12A-12D將有效資料寫入目標位址 指定的儲存單元。進行讀操作時,主機控制器u將目標 位址發送給從機控制器12A-12D ’從機控制器12A-12D從 目標位址指定的儲存單元讀取有效資料,並把有效資料 返回給主機控制器11。 [0010]參閱圖2所示,係圖1中主機控制器U的細化架構圖。所 述主機控制器11包括主機時鐘產生單元2〇〇、從機選擇單 元210、主機時鐘分頻單元220、主機時鐘計數單元23〇 098133052 表單編號A0101 第6頁/共37頁 0982056595-0 201112002 主機位址緩衝區240、主機輸出資料緩衝區250、主機 輸入-貝料緩衝區260、主機輸出控制邏輯單元270及主機 輪入控制邏輯單元280。 [0011] ο 所述主機時鐘產生單元200生成主機内部時鐘,並將該主 機内部時鐘輸出給從機選擇單元21〇、主機時鐘分頻單元 220、主機時鐘計數單元23〇、主機輸出控制邏輯單元 270及主機輸入控制邏輯單元“ο。主機内部時鐘用於對 從機選擇單元21〇、主機時鐘分頻單元22〇、主機時鐘計 數單元230、主機輸出控制邏輯單元27〇及主機輸入控制 邏輯單元280輸出的訊號進行同步。在本實施例中,主機 時鐘產生單元纟〇〇根據外部電路(例如外部的晶振電路) . 提供的系統時鐘生成主機内部時鐘。例如,假設外部的 晶振電路提供的系統時鐘的頻率為16ΜΗζ,主機控制器U 需要64MHz的主機内部時鐘,則主機時鐘產生單元2〇〇將 系統時鐘四倍頻,從而生成64MHz的主機内部時鐘。The method comprises the steps of: the host controller generates a host internal clock; the host control selects a slave controller for data transmission; the host controller divides the internal clock of the host to generate a serial clock signal, and sends the serial clock signal to the selection. The slave controller; the slave controller will serialize the clock signal - the multi-frequency raw machine internal clock; the domain (four) the internal of the host: know the number of pieces of material H to count from the oil clock; the host control inside the machine. The p-time value and the host internal clock transmit the 4/write operation control character and the target address in the specified order, and the slave controller receives the read/write operation control character according to the slave internal clock count value and the slave internal clock. And the target address; corresponding to the write operation control #, the host controller sends the valid data according to the clock value of the host (four) clock in the host, and the slave controller according to the internal clock count value of the slave and the internal clock of the slave Receiving valid data and writing the valid data to the storage unit specified by the destination address, or corresponding to the read operation control, the slave controller reads the valid data from the storage unit specified by the target address, and according to the slave The internal clock of the machine: and the internal clock count value of the slave, the valid data is sent to the host controller in the specified order, and the host controller receives the valid data according to the internal clock of the host and the internal clock count value of the host; and the host controller ends the pair The choice of slave controller. [0008] The present invention doubles the frequency of the internal clock of the master controller and the slave controller, and utilizes multiple control logic units to coordinate data transmission between the host controller and the slave controller, and transmits each half of the serial clock cycle. The round-bit data enables high-speed data transfer. Moreover, the present invention supports single-speed data transmission to accommodate conventional SPI bus systems. [Embodiment] 098133052 Form No. A0101 Page 5 of 37 0982056595-0 201112002 [_9] Referring to FIG. 1, a system architecture of a preferred embodiment of a Serial Peripheral Interface (SPI) bus system Figure. The SPI bus system 1 includes a host controller and one or more slave controllers, such as slave controllers 12A-12D. Data transfer between the host controller u and the slave controllers 12A-12D through the SPI bus 13 is performed. The SPI bus 13 includes a serial clock signal line 14, a master wheel/slave input data line 15, a master wheeling/slave output data line 16, and a slave select signal line 17A-17D. The serial clock signal line ι4 transmits a serial clock signal (SCLK), and the host output/slave input data line 15 transmits data (M0SI) sent by the host controller 11 to the slave controller 12A_12D, the host input The slave output data line 16 transmits the data (μ丨ς〇) sent from the slave controllers 12A-12D to the host controller η, and the slave selects the signal line 17A-17D to transmit the slave selection signal (/SSb) /SS4). The SPI bus system 10 operates in a manner that includes write operations and read operations. The host controller 11 has the initiative of the SPI bus control, and both the read and write operations are initiated by the host controller 11. When the write operation is performed, the host controller 11 transmits the target address and the valid data to the slave controllers 12A-12D, and the slave controllers 12A-12D write the valid data to the storage unit designated by the target address. During the read operation, the host controller u sends the target address to the slave controllers 12A-12D 'the slave controllers 12A-12D to read the valid data from the storage unit specified by the target address, and returns the valid data to the host. Controller 11. [0010] Referring to FIG. 2, it is a detailed architecture diagram of the host controller U in FIG. The host controller 11 includes a host clock generating unit 2, a slave selecting unit 210, a host clock dividing unit 220, a host clock counting unit 23〇098133052, a form number A0101, a sixth page, a total of 37 pages, 20, 925, 659, 550, a The address buffer 240, the host output data buffer 250, the host input-bedding buffer 260, the host output control logic unit 270, and the host wheeling control logic unit 280. [0011] The host clock generating unit 200 generates a host internal clock, and outputs the host internal clock to the slave selecting unit 21, the host clock dividing unit 220, the host clock counting unit 23, and the host output control logic unit. 270 and the host input control logic unit "o. The host internal clock is used for the slave selection unit 21, the host clock division unit 22, the host clock counting unit 230, the host output control logic unit 27, and the host input control logic unit. The signal outputted by 280 is synchronized. In this embodiment, the host clock generating unit generates a host internal clock according to a system clock provided by an external circuit (for example, an external crystal oscillator circuit). For example, a system provided by an external crystal oscillator circuit is assumed. The clock frequency is 16ΜΗζ, the host controller U needs a 64MHz host internal clock, then the host clock generation unit 2〇〇 quadruples the system clock to generate a 64MHz host internal clock.

Ud κ IUd κ I

[0012] Ο 所述從機選择單元210產生從機择擇雖裝並由從機選擇訊 號線17A-17D發送給從機控制丨琴12A-12D,以指示從機控 制器12A-12D是否與主機控制器11進行資料傳輸。具體 而言’當主機控制器11與從機控制器12A、12B、12C或 12D進行資料傳輸時’從機選擇單元210將相對應的從機 選擇訊號置為有效,當資料傳輸完畢後,從機選擇單元 210將相對應的從機選擇訊號置為無效。在本實施例中, 主機控制器11發送給從機控制器12A、12B、12C及12D的 從機選擇訊號分別是/SSI、/SS2、/SS3及/SS4。假設 從機選擇訊號低電平有效,若主機控制器11選擇與從機 098133052 表單編號A0101 第7頁/共37頁 0982056595-0 201112002 控制器12B進行資料傳輸,則從機選擇單元210將/SS2置 為低電平,將/SSI、/SS3及/SS4置為高電平。當主機控 制器11與從機控制器12B的資料傳輸完畢後,從機選擇單 元200將從機選擇訊號/SS2置為高電平。在本實施例中, 從機選擇單元200根據外部設備(例如處理器)提供的選 擇控制訊號產生從機選擇訊號/SSI、/SS2、/SS3及/ SS4。[0012] Ο The slave selection unit 210 generates a slave selection and is sent by the slave selection signal line 17A-17D to the slave control piano 12A-12D to indicate whether the slave controller 12A-12D is Data transmission is performed with the host controller 11. Specifically, 'when the host controller 11 and the slave controller 12A, 12B, 12C or 12D perform data transmission, the slave selection unit 210 sets the corresponding slave selection signal to be valid. When the data transmission is completed, the slave The machine selection unit 210 disables the corresponding slave selection signal. In the present embodiment, the slave selection signals transmitted from the host controller 11 to the slave controllers 12A, 12B, 12C, and 12D are /SSI, /SS2, /SS3, and /SS4, respectively. Assuming that the slave select signal is active low, if the host controller 11 selects to perform data transfer with the slave 098133052 Form No. A0101, page 7/37 page 0982056595-0 201112002, the slave select unit 210 will /SS2 Set low to set /SSI, /SS3, and /SS4 high. When the data transfer from the master controller 11 and the slave controller 12B is completed, the slave selecting unit 200 sets the slave select signal /SS2 to a high level. In the present embodiment, the slave selecting unit 200 generates the slave select signals /SSI, /SS2, /SS3, and /SS4 based on the selection control signals supplied from the external device (e.g., the processor).

[0013] 所述主機時鐘分頻單元220將主機内部時鐘二分頻生成串 列時鐘訊號,並將該串列時鐘訊號由串列時鐘訊號線14 發送給從機控制器12A-12D。顯然地,主機内部時鐘的頻 率是串列時鐘訊號的二倍。V[0013] The host clock frequency dividing unit 220 divides the internal clock of the host into a serial clock signal, and sends the serial clock signal from the serial clock signal line 14 to the slave controllers 12A-12D. Obviously, the frequency of the internal clock of the host is twice that of the serial clock signal. V

1¾ 丨 II13⁄4 丨 II

[0014] 所述主機時鐘計數單元230對主機内部時鐘計數,並將主 機内部時鐘計數值輸出給從機選擇單元2H)、主機輸出控 制邏輯單元270及主機輸入控制邏輯單元280。從機選擇 單元210根據主機時鐘計數單元230的主機内部時鐘計數 值判斷是否資料傳輸完畢。例如,假設需要在主機控制 器11與從機控制器12之間傳輸32比特資料,每個主機内 部時鐘週期傳輸1比特資料,並且每經過一個主機内部時 鐘週期將主機内部時鐘計數值加1,若主機時鐘計數單元 2 3 0從〇開始計數’則計數到31時表明資料傳輸完畢。主 機時鐘計數單元230可以設置為每經過—個主機内部時鐘 週期將主機内部時鐘計數值加1,或者每經過兩個主機内 部時鐘週期將主機内部時鐘計數值加1,從而控制主機控 制器11與從機控制器12的資料傳輸速率。具體而言,當 需要以兩倍速(即為串列時鐘訊號頻率兩倍的速率)傳 098133052 表單編號Α0101 第8頁/共37頁 0982056595-0 201112002 輸資料時’主機時鐘計數單元23〇每經過一個主機内部時 鐘週期將主機内部時鐘計數值加1 ;當需要以單倍速(即 與串列時鐘訊號頻率相同的速率)傳輸資料時,主機時 鐘计數單元230每經過兩個主機内部時鐘週期將主機内部 時鐘計數值加1。在本實施例中,主機時鐘計數單元23〇 根據外部設備提供的計數方式控制訊號設置其工作方式 。例如,當計數方式控制訊號為丨時,每經過兩個主機内 時鐘週期主機時鐘計數單元230將主機内部時鐘計數值 Ο [0015] 加1,當計數方式控制訊號為〇時,每經過丨個主機内部時 鐘週期主機時鐘計數單元23〇將主機内部時鐘計數值加j 〇 所述主機位址鍰衝區24〇提供儲存空間,緩存發送給從機 控制器12Α-12D的目標位址;所述主機輸出資料緩衝區 250提供儲存空間,緩存發送給從機控制器的有 效貝料。在本實施例中,#機位址緩衝區24〇接收外部設 備提供的有效資料’主機輸出資料緩接收外部設 備提供的目標位址。進一步地?主機位址緩衝區利用 兩條位址匯流排接收外部設備提供的目標位址,主機輸 出資料緩衝區250利用兩條資料匯流排接收外部設備提供 的有效資料。 ’ [0016] 所述主機輪出控制邏輯單元27G生成讀/寫操作控制符, 從=機位址緩衝區240讀取發送給從機控制器12^121)的 目標位址,從主機輸出資料緩衝區25Q讀取發送給從機控 制器12A、12D的有效資料,並根據主機内部時鐘及主_ 部時鐘計數值按照指定的順序將讀/寫操作控制符、目標 098133052 表單編號_1 第9頁/共37頁 0982056595-0 201112002 ,X及有效 > 料由主機輸出/從機輸入資料線15發送給 從機控制器12A-12D。對於寫操作,主機輪出控制邏輯單 生成寫操作控制符;對於讀操作,主機輸出控· 輯單元270生成6買操作控制符。主機輪出控制邏輯單元 270在主機内部時鐘的跳變沿發送資料。例如,在每個主 機内部時鐘的上升沿發送特資料。或者,在每個主機 内部時鐘的下降沿發送1比特資料。 [0017] [0018] 098133052 所述主機輸人控制邏輯單元28〇根據主機内部_及主機 内部時鐘計數值接收從機控制器12A_12D由主機輸入/從 機輪出資料線16發送的有效諸,並將接收的有效資料 緩存到主機輸人資料緩衝區26G。主態入控制邏輯單元 280在主機内部時鐘的跳變沿接枚.資料。例如,在每個主 機内部時鐘的上升沿接收Ub#f^ ^或者,在每個主機 内部時鐘的下降沿接收1比特資料。 在本實施财,主機輸出控制邏輯單元27G及主機輸入控 制邏輯單元280根據_設備提供㈣/寫控制訊號執行 讀/寫操作。當__觀_,主機輸出㈣邏輯單 元270生成寫操作控制符,並將寫操作_符目標位址 及有效資料發送給·㈣!i12A_12D ;當收到讀㈣訊 號時,主機輸出控制邏輯單元27G生成讀操作控制符,並 將讀操作控制符、目標位址發送給從機控制器i2A_m, 主機輸入控制邏輯單元28〇接收從機控制器^⑽返回 的有效資料並緩存到主機輸入資料緩衝區26〇。 參閱圖3所示’係圖4的從機控制器的細化架構圖。從 機控制器12A-12D包括從機時鐘倍頻單元3〇〇、從機 表單煸號Α0101 第10頁/共37頁 、里 [0019] 201112002 [0020] Ο [0021] 〇 [0022] 098133052 计數單元310、從機輸入控制邏輯單元320、從機輸出控 制邏輯單元330、從機位址緩衝區340、從機輸入資料緩 衝區350、從機輸出資料緩衝區36〇、從機操作控制邏輯 單元370及從機目標記憶體380。 所述從機時鐘倍頻單元3〇〇由串列時鐘訊號線丨4接收主機 控制器發送的串列時鐘訊號,將該串列時鐘訊號二倍頻 生成從機内部時鐘’並將該從機内部時鐘輸出給從機時 鐘計數單元31〇、從機輸入控制邏輯單元32〇及從機輸出 控制邏輯單元330。與主機内部時鐘相類似地,從機内部 時鐘用於對從機時鐘計數單元31〇、從機輸入控制邏輯單 元320及從機輸出控制邏輯單元33〇輸出的訊號進行同步 。從機内部時鐘的頻率是串列時鐘訊號的二倍。在本實 施例中,從機時鐘倍頻單元300採用鎖相環電路將串列時 鐘訊號二倍頻。所述鎖相環電路接收外部電路提供的系 統時鐘作為參考時鐘e ( jn, , 所述從機時鐘計數單元310由從機選擇1訊號線17八-171)接 收主機控制器11發送的從機聲擇訊號,當從機選擇訊號 有效時’對從機内部時鐘計數,並將從機内部時鐘計數 值輸出給從機輸入控制邏輯單元320及從機輸出控制邏輯 單元330 » 所述從機輸入控制邏輯單元320根據從機内部時鐘及從機 内部時鐘計數值由主機輸出/從機輸入資料線15接收主機 控制器11發送的讀/寫操作控制符、目標位址及有效資料 ,將接收的目標位址緩存到從機位址緩衝區340,將接收 的有效資料緩存到從機輸入資料缓衝區350,並根據接收 表單編號A0101 第11頁/共37頁 〇982 201112002 的讀/寫操作控制符產生相對應的讀/寫操 輸出給從機操作控制邏輯單綱 ,右收到寫知作控制符 則從機輸入控制邏輯單元320產生 者若收到讀摔作γ3日,似或 機輸人控制邏輯單元Μ0產 魅tr制訊號1機輸人邏輯控_輯單元320在從 =時鐘的跳變沿接收資料。例如,在每個從機内部 時知的上升沿触以特請。或者,在每個從機 鐘的下降沿接收1比特資料。 。夺 [0023] 所述從機操作控制邏輯單元37。根據接收的讀/寫操作控 制訊號執行相對應的操作。具體而言,當㈣寫操作; 制訊说時,從顯作㈣轉料37G讀取從機位 區340緩存的目標位址以及從機輸人資料緩衝區350緩存 的有效資料,並將有效f 存到_#標記憶體⑽的 目標位址所缺_存單元;或者當__作控制訊 號時’從機操作控制邏輯單元370讀取從機位址緩衝區 340緩存的目標值址,緣目標位騎指定的儲存單元中讀 取有效貝料’並將該有效資料緩存到從機輸出資料緩衝 區360纟本實施例中,從機操作控制邏輯單以7〇透過 兩條位址匯流排與從機位址緩衝區34()相連,透過兩條輸 入資料匯流排與從機輸人資料缓衝區350相連,透過兩條 輸出貝料匯流排與從機輸出資料緩衝區36〇相連。若以兩 倍速傳輸資料,從機操作控制賴單以7()利用兩條位址 匯流排、兩條輪人資料匯流排及兩條輪出資料匯流排進 行資料傳輸。若以單倍速傳m從機操作控制邏輯 單兀370利用其中—條位址匯流排、一條輸入資料匯流排 098133052 表單編號A0101 第12頁/共37頁 201112002 及—條輸出資料匯流排進行資料傳輸。 [0024] 所述從機輸出控制邏輯單元330讀取從機輸出資料緩衝區 36〇緩存的有效資料,並根據從機内部時鐘及從機内部時 鐘計數值由主機輸入/從機輸出資料線16將讀取的有效資 料按照指定的順序發送給主機控制㈣。從機輸出控制 邏輯單元330在從機内部時鐘的跳變沿發送資料。例如, 在每個從機内部時鐘的上升沿發送丨比特資料。或者,在 每個從機内部時鐘的下降沿發送丨比特資料。 〇 [0025] 參閱圖4所示,係本發明基於串列週邊介面(spi)匯流 排的資料傳輸方法較佳實施例的流程圖m圖i中的 主機控制器11與從機控制器12B的資料傳冑為例進行說明 [0026] Ο 步驟S4(U,主機時鐘產生單㈣Q生成主機内部時鐘並 將該主機内部時鐘輸出給從機選擇單元21〇、主機時鐘分 ,單元22G '主機時鐘轉料23(}、主機輪出控制邏輯 早元270及主機輸人㈣邏輯單,元28(^主機内部時鐘用 於對從機_單元2U)、主機時—頻單以別、主機時 鐘計數單元230、主機輸出控㈣輯單元27()及主機輸入 控制邏輯單元28()輸出的訊號進行同步。在本實施例中, 主機時鐘產生單㈣Q根據外部電路(例如外部的晶振電 路)提供的线時鐘生成主機内料鐘。例如,假設外 部的晶振電路提供的系統時鐘的頻率為16MHz,主機控制 器11需要64MHZ的域内部時L機時鐘產生單元 200將系統時鐘四倍頻,從而生成6_2的主機内部時鐘 098133052 表單編號A0101 第13頁/共37頁 0982056595-0 201112002 闺步驟S4〇2,從機選擇單元210將由從機選擇訊號線i?B發 送給從機控制器12B的從機選擇訊號/SS2置為有效。假設 從機選擇訊號低電平有效,則從機選擇單元…將/说置 為低電平。 闕步驟S403,主機時鐘分頻單元22〇將主機内部時鐘二分頻 生成串列時鐘訊號’並將該串列時鐘訊號由串列時鐘訊 號線14發送給從機控制器m。如前所述,主機内部時鐘 的頻率是串列時鐘訊號的二倍。 [0029]步驟S404,從機控制器12B的從機時鐘倍頻單元3〇〇將串 列時鐘訊號二倍頻生成從機内部時鐘,並將該從機内部 時鐘輸出給從機時鐘計數單元310、從機輪入控制邏輯單 元320及從機輸出控制輯單元_,前所述從機内 部時鐘的頻率與主機内部時鐘相同,均是串列時鐘訊號 的二倍。在本實施例中,從機時鐘倍頻單元3〇〇採用鎖相 環電路將串列時鐘訊號二倍頻。所述鎖相瓖電路接收外 部電路提供的系統時鐘作為參考時,鐘…。 _]步驟S405 ’主機時蠢計數單元23〇對主機内部時鐘計數, 並將主機内部時鐘計數值輸出給從機選擇單元21〇、主機 輸出控制邏輯單元270及主機輸入控制邏輯單元28〇 ;從 機時鐘》十數早元310對從機内部時鐘計數,並將從機内部 時鐘計數值輸出給從機輸入控制邏輯單元32〇及從機輸出 控制邏輯單元330。其中,主機時鐘計數單元23〇可以設 置為每經過一個主機内部時鐘週期將主機内部時鐘計數 值加1,或者母經過兩個主機内部時鐘週期將主機内部時 鐘計數值加1,從而控制主機控制器11與從機控制器丨2的 098133052 表單編號A0101 第14頁/共37頁 nC)Si 201112002 資料傳輸速率。具體而言,备 時鐘邙嗨相,玄, 田而要以兩倍速(即為串列 單元=頻率兩倍的速率)傳輪叫 數值加丨主機内部時鐘週期將主機内部時鐘計 的=值"需要以單倍速(即與串列時鐘訊號頻率相同 =率)傳輸f料時,主機時鐘計數單元每經過兩個 内部時鐘週期將主機内部時鐘計數值加!。 [0031] ❹ Ο 098133052 驟S406主機控制川與從機㈣器⑽之間傳輸讀/ ^操作控制符及目標位址。具體來說,主機輸出控制邏 早几㈣生成讀/寫操作控制符,從主機位址緩衝區240 讀取發送給從機控㈣目標他,根齡機内部時 鐘及主機_^鐘計數值將讀/寫操作控制符及目標位址 按照指㈣順序由主機輸出/從機輸人資料線15發送給從 機控制器12Β ;從機輪人控制邏輯單元·根據從機内部 時鐘及從機内部時鐘計數值接收主機控制器丨丨發送的讀/ 寫操作控制符及目標位址,將接收的目標位址緩存到從 機位址緩衝區340,將接收的東$資料g存到從機輸入資 料緩衝區350 ’並根據接收的;讀/寫操作控制符產生讀/寫 操作控制訊號並輸出給從機操作控制邏輯單元37〇。例如 ,主機輸出控制邏輯單元27〇在主機内部時鐘計數值為〇 或1時發送1比特的讀/寫操作控制符,在主機内部時鐘計 數值為2、3.....或15時發送1比特的目標位址。從機輸 入控制邏輯單元320在從機内部時鐘計數值為〇或1時接收 1比特的讀/寫操作控制符,在從機内部時鐘計數值為2、 3.....或15時接收1比特的目標位址《並且,主機輸出 控制邏輯單元270在主機内部時鐘的跳變沿發送資料,從 表單編號A0101 第15頁/共37頁 0982056595-0 201112002 機輸入控制邏輯單元3齡從機内料鐘的跳變沿接收資 料。 、 [0032] 步驟S407 ’主機控制器n與從機控制器m之間傳輸有 效資料。在該步驟中,對於寫操作(此時從機輸入控制 邏輯單元320發送寫操作控制訊餘從機操作控制邏輯單 元37〇) ’主機輪出控制邏輯單元27()從主機輸出資料緩 衝區25G讀取發送給從機控制器12B的有效資料,並根據 主機時鐘計數單切㈣主機内部時鐘及主機内部時鐘計 數值將有效資料按照指定的順序由主機輸出/從機輸入資 料線15發送給從機控·12Β ;從機輸人控制邏輯單元 320根據從_料鐘及從機内料料數值接收有效資 料’從機操作控制邏輯單⑽〇根料操作㈣訊號將接 收的有效資料寫入目標位址指定的從機目標記憶體綱的 儲存單元對於讀操作(此時從機輸入控制邏輯單元32〇 發送讀操作控制訊號至從機操作控制邏輯單元37〇),從 機操作控制邏輯單元37Q轉讀操作㈣訊餘目標位址 指定的從機目標記憶體38_儲存單元讀取有效資料並緩 存到從機輸出資料緩衝區36〇,從機輸出控制邏輯單元 330讀取該有效資料,並根據從機内部時鐘及從機内部時 鐘計數值將該有效資料按照指定的順序由主機輸入/從機 輸出資料線16發送給主機控制器U ;主機輸入控制邏輯 單元280根據主機内部時鐘及主機内部時鐘計數值接收從 機輸出控制邏輯單元330發送的有效資料’並將接收的有 效資料緩存到主機輸入資料緩衝區260。其中,從機輸出 控制邏輯單元330在從機内部時鐘的跳變沿發送資料。主 098133052 表單編號A0101 第16頁/共37頁 0982056595-0 201112002 [0033] [0034] Ο [0035] 〇 [0036] 機輸入控制邏輯單元在主機内部時鐘的跳變沿接收資料 〇 需要說明的是’從錢作控簡輯單元持單倍速的 貝料傳輪’也支持兩倍速的資料傳輸。 步驟S408 ’主機控制器u與從機控制器12B資料傳輸完 畢後,從機選擇單元200將從機選擇訊號/SS2置為無效, 例如將/SS2置為向電平。在本實施例中,從機選擇單元 210根據主機時鐘計數單元23〇的主機内部時鐘計數值判 斷主機控制器11與從機控制器12B資料傳輸是否完畢。例 如’假設需要在主機控制器11與從機控制器12之間傳輸 32比特資料,每個主機内部時鐘週期傳輸1比特資料,並 且每經過一個主機内部時鐘週期將主機内部時鐘計數值 加1 ’若主機時鐘計數單元230從0開始計數,則計數到31 時表明資料傳輸完畢。 圖5至圖8係以兩倍速傳輪資料的示意圖。其中,5(:1^表 示串列時鐘訊號,2xSCLK表示主機内部時鐘,/SS2表示 從機控制器12B的從機選擇訊號+MOSI表示主機輸出/從 機輸入資料線15上的資料,MISO表示主機輸入/從機輸出 資料線1_6上的資料 圖5至圖8所示的例子中,採用交錯傳輸的方式進行資料 傳輸’每次傳輸兩個有效資料,每個有效資料是8比特, 每個有效資料對應的目標位址是7比特,每個有效資料對 應1比特的讀/寫操作控制符。其中,第一個有效資料( 以下稱第一有效資料)為D0,其對應的第一目標位址為 098133052 表單編號A0101 第Π頁/共37頁 0982056595-0 201112002 A0 ’第—有效資料的各個比特從低到高為D〇〇、D〇i、 D〇2、D03、D04、D05、D06、D07,第一目標位址的各 個比特從低到高為A00、A01、A02、A03、A04、A05、 A06、A07。第二個有效資料(以下稱第二有效資料)為 D1,其對應的第二目標位址為A1,第二有效資料的各個 比特從低到高為D10、Dll ' D12、D13、D14、D15、D16 、D17 ’第二目標位址的各個比特從低到高為人1〇、A11 、A12、A13、A14、A15、A16、A17。由圖 5 至圖 8可知 ,主機控制器11與從機控制器i2B之間首先傳輸兩個讀/ 寫操作控制符,然後傳輸兩個目標位址,最後傳輸兩個 有效資料,並且按照從低到今:的順序谬輸目標位址及有 效資料的各個比特。其中,與標位址▲發送順序為:A 、Α10、Α01、Ail、Α02、Α12、Α03、Α13、Α〇4、Au ' Α05、Α15、Α06、Α16,有效資料的發送順序為:D〇〇 、DIO 、 D01 ' Dll 、 D02 、 D12 、 D03 、 D13 、 D04 、 D14 、D05、D15、D06、D16、D06、D16。 [0037] [0038] 具體來說,圖5係連轉執行兩次寫操作的示意圖。首先傳 輸寫操作控制符/wo與/wi,然後傳輸目標位址A0與A1, 最後傳輸有效資料DO與D1。並且,寫操作控制符1〇與〆 W1、目標位址A0與A1以及有效資料D〇與m均由主機輸出 /從機輸入資料線15傳輸。 圖6係連續執行兩次讀操作的示意圖。首先傳輸讀操作控 制符R0與R1,然後傳輸目標位址“與“,最後傳輸有效 資料D0與D1。並且,讀操作控制符別與们以及目標位址 A0與A1由主機輸出/從機輸入資料線15傳輸有效資料 098133052 表單編號A0101 第18頁/共37頁 0982056595-0 201112002 DO與D1由主機輪入/從機輸入資料線16傳輸。 [_ 係錢執行—次寫操作及—次讀操作的示意圖。首先 傳輸寫操作控制符/W〇與讀操作控制符以,然後傳輸目標 位址A〇與A1,最後傳輸有效資料DO與D1。並且,寫操作 控制符/W〇、讀操作控制符R1、目標位址A0與A1以及有 效資料DO由主機輸出/從機輸入資料線15傳輸,有效資料 Dl由主機輸入/從機輪入資料線16傳輪。 [0040] 〇 [0041] ❹ [0042] [0043] 098133052 圖8係先後執行-次讀操作及—次寫操作的示意圖。首先 傳輸讀操作控制細與寫操作控㈣/W卜職傳輸目標 位址A0與A1 ’最後傳輸有效資料⑽與^。並且,讀操作 控制細與寫操作控制符川、目標位址_A1及有效 資料D1由主機輸出/從機輸人資料線ι5傳輸,有效資料⑽ 由主機輸入/從機輸入資料線16傳輸。 〜田可以理解,若SPI匯流排系統1Q以單倍速傳輸資料, 則按照圖9所示執行寫操作,教照圖_示執行讀操作。 利用本發明,SPI,匯流排系統1Q可以每半個串列時鐘訊號 週期傳輸1比特資料’相對於習知它術中的SPI匯流排系 統實現了更高的資料傳輸速率,如,若最高串列時鐘 訊號的頻率是32驗,習知技術的SPI匯流排系統只能達 ^㈣_8的資料傳輸速率’而本發明的則匯流排 系統10可以達到最高64Mbps的資料傳輸速率。並且,主 :控制器11以及從機控制器12八_121)均支持單倍速的資 :傳輪’以相容習知技術的SPI匯流排系統。 综上所述’本發明符合發明專利要件,美依法提出專利 表單蝙辣删1 帛I9 1/共37頁 0982056595-0 201112002 申請。惟,以上所述者僅為本發明之較佳實施例,本發 明之範圍並不以上述實施例為限,舉凡熟悉本案技藝之 人士援依本發明之精神所作之等效修飾或變化,皆應涵 蓋於以下申請專利範圍内。 【圖式簡單說明】 [0044] 圖1係串列週邊介面匯流排系統較佳實施例的系統架構圖 〇 [0045] 圖2係圖1中主機控制器的細化架構圖。 [0046] 圖3係圖1中從機控制器的細化架構圖。 [0047] 圖4係本發明基於串列週邊介面匯流排的資料傳輸方法較 佳實施例的示意圖。 [0048] 圖5係以兩倍速傳輸資料時連續執行兩次寫操作的示意圖 〇 [0049] 圖6係以兩倍速傳輸資料時連續執行兩次讀操作的示意圖 〇 [0050] 圖7係以兩倍速傳輸資料時先後執行一次寫操作與一次讀 操作的示意圖。 [0051] 圖8係以兩倍速傳輸資料時先後執行一次讀操作與一次寫 操作的示意圖。 [0052] 圖9係以單倍速傳輸資料時執行寫操作的示意圖。 [0053] 圖10係以單倍速傳輸資料時執行讀操作的示意圖。 【主要元件符號說明】 098133052 表單編號A0101 第20頁/共37頁 0982056595-0 201112002[0014] The host clock counting unit 230 counts the internal clock of the host, and outputs the internal clock count value of the host to the slave selecting unit 2H), the host output controlling logic unit 270, and the host input controlling logic unit 280. The slave selection unit 210 determines whether or not the data transmission is completed based on the host internal clock count value of the host clock counting unit 230. For example, suppose that 32-bit data needs to be transferred between the host controller 11 and the slave controller 12, each host transmits 1 bit of data in the internal clock cycle, and the host internal clock count is incremented by 1 every one internal clock cycle. If the host clock counting unit 2 3 0 starts counting from 〇, then counting to 31 indicates that the data transmission is completed. The host clock counting unit 230 may be configured to increment the host internal clock count value by one every internal host clock cycle, or increase the host internal clock count value by one every two host internal clock cycles, thereby controlling the host controller 11 and The data transfer rate of the slave controller 12. Specifically, when it is required to transmit the data at twice the speed (that is, twice the frequency of the serial clock signal), 098133052 Form No. 1010101 Page 8/37 Page 0982056595-0 201112002 When the data is transmitted, the host clock counting unit 23 A host internal clock cycle increments the host internal clock count by one; when it is required to transfer data at a single rate (ie, at the same rate as the serial clock signal frequency), the host clock count unit 230 will pass each of the two host internal clock cycles. The internal clock count value of the host is incremented by 1. In this embodiment, the host clock counting unit 23 controls the operation mode of the signal according to the counting mode provided by the external device. For example, when the counting mode control signal is 丨, the host clock counting unit 230 increments the host internal clock count value Ο [0015] every two clock cycles in the host, and each time the counting mode control signal is 〇 The host internal clock cycle host clock counting unit 23 〇 provides the host internal clock count value plus j 〇 the host address buffer 24 〇 provides storage space, and the buffer is sent to the target address of the slave controller 12 Α -12D; The host output data buffer 250 provides storage space and caches valid beeps sent to the slave controller. In this embodiment, the # machine address buffer 24 receives the valid data provided by the external device, and the host output data buffers the destination address provided by the external device. further? The host address buffer uses two address buss to receive the target address provided by the external device, and the host output data buffer 250 uses two data buss to receive the valid data provided by the external device. [0016] The host rotation control logic unit 27G generates a read/write operation control character, reads a target address transmitted from the machine address buffer 240 to the slave controller 12^121), and outputs data from the host. The buffer 25Q reads the valid data sent to the slave controllers 12A, 12D, and according to the internal clock of the host and the main clock count value, the read/write operation control character, target 098133052 form number_1, ninth according to the specified order. Page / Total 37 pages 0982056595-0 201112002, X and active > are sent by the master output/slave input data line 15 to the slave controllers 12A-12D. For a write operation, the host rotates the control logic to generate a write operation control; for a read operation, the host output control unit 270 generates a 6 buy operation control. The host rotation control logic unit 270 transmits data on the edge of the host internal clock. For example, special data is sent on the rising edge of each host's internal clock. Alternatively, a 1-bit data is transmitted on the falling edge of each host's internal clock. [0018] 098133052, the host input control logic unit 28 receives the valid signals sent by the slave controller 12A_12D by the master input/slave wheel data line 16 according to the host internal_and the host internal clock count value, and The received valid data is cached to the host input data buffer 26G. The main state input control logic unit 280 is connected to the data on the transition edge of the internal clock of the host. For example, Ub#f^ ^ is received on the rising edge of each host's internal clock or 1-bit data is received on the falling edge of each host's internal clock. In the present embodiment, the host output control logic unit 27G and the host input control logic unit 280 perform read/write operations in accordance with the _device providing (four)/write control signals. When __view_, the host output (4) logic unit 270 generates a write operation control character, and sends the write operation_address destination address and valid data to (4)! i12A_12D; when receiving the read (four) signal, the host output control logic unit 27G generates a read operation control character, and sends the read operation control character and the target address to the slave controller i2A_m, and the host input control logic unit 28 receives the slave The valid data returned by the controller ^(10) is cached in the host input data buffer 26〇. Referring to Figure 3, a detailed architecture diagram of the slave controller of Figure 4 is shown. The slave controllers 12A-12D include a slave clock multiplier unit 3A, a slave form number Α0101, a 10th page, a total of 37 pages, and a [0019] 201112002 [0020] Ο [0021] 〇 [0022] 098133052 The number unit 310, the slave input control logic unit 320, the slave output control logic unit 330, the slave address buffer 340, the slave input data buffer 350, the slave output data buffer 36, and the slave operation control logic Unit 370 and slave target memory 380. The slave clock multiplying unit 3 receives the serial clock signal sent by the host controller by the serial clock signal line 丨4, and generates the slave internal clock by the double frequency of the serial clock signal' and the slave The internal clock is output to the slave clock counting unit 31, the slave input control logic unit 32, and the slave output control logic unit 330. Similarly to the internal clock of the master, the slave internal clock is used to synchronize the signals output from the slave clock counting unit 31, the slave input control logic unit 320, and the slave output control logic unit 33. The internal clock of the slave is twice the frequency of the serial clock signal. In the present embodiment, the slave clock multiplier unit 300 uses a phase locked loop circuit to double the serial clock signal. The phase-locked loop circuit receives the system clock provided by the external circuit as a reference clock e (jn, the slave clock counting unit 310 receives the slave signal sent by the host controller 11 by the slave select 1 signal line 17--171) The acoustic selection signal, when the slave select signal is valid, 'counts the internal clock of the slave, and outputs the slave internal clock count value to the slave input control logic unit 320 and the slave output control logic unit 330 » the slave input The control logic unit 320 receives the read/write operation control character, the target address and the valid data sent by the host controller 11 from the master output/slave input data line 15 according to the slave internal clock and the slave internal clock count value, and will receive the received data. The target address is buffered into the slave address buffer 340, and the received valid data is buffered to the slave input data buffer 350, and according to the read/write operation of the receiving form number A0101 page 11/37 page 〇982 201112002 The control character generates a corresponding read/write operation output to the slave operation control logic, and the right received write control symbol, then the slave input control logic unit 320 generates a read y3 if received. On the day, the input logic control unit Μ0 produces the Tr signal 1 machine input logic control unit 306 unit receives data from the edge of the = clock transition. For example, the rising edge of each slave is touched by a special request. Alternatively, receive 1 bit of data on the falling edge of each slave clock. . The slave operates the control logic unit 37. The corresponding operation is performed according to the received read/write operation control signal. Specifically, when the (four) write operation; the message is said, the target address buffered from the location area 340 and the valid data buffered by the slave input data buffer 350 are read from the display (4) transfer 37G, and will be valid. f is stored in the _# standard memory (10) target address missing _ memory unit; or when __ as a control signal 'slave operation control logic unit 370 reads the slave address buffer 340 cached target value address, The edge target bit reads the valid bee material in the specified storage unit and buffers the valid data into the slave output data buffer 360. In this embodiment, the slave operation control logic unit transmits the data through two addresses. The row is connected to the slave address buffer 34 (), connected to the slave input data buffer 350 through two input data buss, and connected to the slave output data buffer 36 through two output bus buffers. . If the data is transmitted at twice the speed, the slave operation control will use 7 address bus, two wheel data bus and two wheel data bus to transmit data. If the single-speed transmission m slave operation control logic unit 370 uses one of the address bus, one input data bus 098133052, the form number A0101, the 12th page, the total output page, the data transmission line for data transmission . [0024] The slave output control logic unit 330 reads the valid data buffered by the slave output data buffer 36, and outputs the data line 16 by the master input/slave according to the internal clock of the slave and the internal clock count value of the slave. The valid data read is sent to the host control in the specified order (4). The slave output control logic unit 330 transmits data on the edge of the slave internal clock. For example, the 丨 bit data is transmitted on the rising edge of each slave's internal clock. Alternatively, the 丨 bit data is transmitted on the falling edge of each slave's internal clock. [0025] Referring to FIG. 4, a flow chart of a preferred embodiment of a data transmission method based on a serial peripheral interface (spi) bus bar of the present invention is shown in the flowchart of the host controller 11 and the slave controller 12B in FIG. The data transmission is described as an example. [0026] Ο Step S4 (U, the host clock generates a single (four) Q to generate a host internal clock and outputs the internal clock of the host to the slave selection unit 21, the host clock is divided, and the unit 22G 'host clock turns Material 23 (}, host rotation control logic early 270 and host input (four) logic single, element 28 (^ host internal clock for slave_unit 2U), host time - frequency single, host clock counting unit 230, the host output control (4) unit 27 () and the signal output by the host input control logic unit 28 () are synchronized. In this embodiment, the host clock generates a single (four) Q according to an external circuit (such as an external crystal oscillator circuit) provided by the line The clock generates a host internal clock. For example, if the external crystal oscillator circuit provides a system clock frequency of 16 MHz and the host controller 11 requires a 64 MHz internal domain, the L-machine clock generating unit 200 quadruples the system clock, thereby Generating the internal clock of the host 2_2 098133052 Form No. A0101 Page 13 of 37 0982056595-0 201112002 闺Step S4〇2, the slave selecting unit 210 transmits the slave selected signal line i?B to the slave controller 12B. The machine selection signal /SS2 is asserted. Assuming that the slave select signal is active low, the slave select unit ... puts / speaks low. 阙Step S403, the master clock divider unit 22 〇 will host the internal clock two The serial clock signal is generated by frequency division and transmits the serial clock signal from the serial clock signal line 14 to the slave controller m. As described above, the frequency of the internal clock of the host is twice that of the serial clock signal. Step 0404, the slave clock multiplying unit 3 of the slave controller 12B double-frequency generates the slave internal clock, and outputs the slave internal clock to the slave clock counting unit 310. The slave wheel control logic unit 320 and the slave output control unit _, the frequency of the internal clock of the slave is the same as the internal clock of the master, which is twice the serial clock signal. In this embodiment, the slave Clock multiplier The unit 3〇〇 uses a phase-locked loop circuit to double the serial clock signal. When the phase-locked loop circuit receives the system clock provided by the external circuit as a reference, the clock.... _] step S405 'host stupid counting unit 23〇 Counting the internal clock of the host, and outputting the internal clock count value of the host to the slave selection unit 21, the host output control logic unit 270, and the host input control logic unit 28; the slave clock "ten number 310" to the slave internal The clock is counted and the slave internal clock count value is output to the slave input control logic unit 32 and the slave output control logic unit 330. The host clock counting unit 23〇 can be set to increment the host internal clock count value by one internal clock cycle, or the master internal clock count value is incremented by one after two host internal clock cycles, thereby controlling the host controller. 11 and slave controller 丨 2 098133052 Form No. A0101 Page 14 of 37 nC) Si 201112002 Data transfer rate. Specifically, the standby clock phase, the mysterious, and the field must be doubled (that is, the rate of the tandem unit = frequency twice). The value is added to the host internal clock cycle to the host internal clock count = value &quot When the material needs to be transmitted at a single speed (that is, the same frequency as the serial clock signal frequency = rate), the host clock counting unit adds the internal clock count value of the host every two internal clock cycles! . [0031] ❹ 098 098133052 Step S406 The host control passes the read/^ operation control character and the target address between the slave (4) device (10). Specifically, the host output control logic (four) generates a read/write operation control character, reads from the host address buffer 240 and sends it to the slave (4) target, the root clock internal clock and the host _^ clock count value will The read/write operation control character and the target address are transmitted from the master output/slave input data line 15 to the slave controller 12 in the order of (4); the slave wheel control logic unit is based on the slave internal clock and the slave internal The clock count value receives the read/write operation control character and the target address sent by the host controller, buffers the received target address to the slave address buffer 340, and stores the received east$ data g to the slave input. The data buffer 350' and based on the received; read/write operation control generates a read/write operation control signal and outputs it to the slave operation control logic unit 37A. For example, the host output control logic unit 27 sends a 1-bit read/write operation control character when the host internal clock count value is 〇 or 1, and transmits when the host internal clock count value is 2, 3, ..., or 15. 1-bit target address. The slave input control logic unit 320 receives a 1-bit read/write operation control when the slave internal clock count value is 〇 or 1, and receives when the slave internal clock count value is 2, 3..... or 15. 1 bit target address "And, the host output control logic unit 270 transmits data on the transition edge of the host internal clock, from the form number A0101 page 15 / 37 pages 0982056595-0 201112002 machine input control logic unit 3 in the slave The data is received on the edge of the skip. [0032] Step S407 'The effective data is transmitted between the host controller n and the slave controller m. In this step, for the write operation (at this time, the slave input control logic unit 320 transmits the write operation control slave slave operation control logic unit 37). The host wheel control logic unit 27 () outputs the data buffer 25G from the host. The valid data sent to the slave controller 12B is read, and the valid data is sent from the host output/slave input data line 15 to the slave according to the host clock count single cut (four) host internal clock and the host internal clock count value in a specified order. Machine control · 12 Β ; slave input control logic unit 320 receives valid data according to the value of the slave clock and the slave material. The slave operation control logic (10) 〇 root operation (4) signal writes the valid data received to the target position. The storage unit of the slave target memory class specified by the address is for the read operation (at this time, the slave input control logic unit 32 sends the read operation control signal to the slave operation control logic unit 37), and the slave operation control logic unit 37Q Read operation (4) The slave target memory 38_ storage unit specified by the source target address reads the valid data and buffers it into the slave output data buffer 36〇 The slave output control logic unit 330 reads the valid data, and sends the valid data to the host controller U according to the slave internal clock and the slave internal clock count value in the specified order from the host input/slave output data line 16. The host input control logic unit 280 receives the valid data sent by the slave output control logic unit 330 according to the host internal clock and the host internal clock count value and buffers the received valid data to the host input data buffer 260. The slave output control logic unit 330 transmits data on the edge of the slave internal clock. Main 098133052 Form No. A0101 Page 16/37 Page 0982056595-0 201112002 [0033] [0035] 〇[0036] The machine input control logic unit receives data on the edge of the internal clock of the host. 'From the money control briefing unit holding a single speed of the shell transfer wheel' also supports double-speed data transmission. Step S408 After the data transmission of the master controller u and the slave controller 12B is completed, the slave selecting unit 200 sets the slave select signal /SS2 to be invalid, for example, sets /SS2 to the level. In the present embodiment, the slave selecting unit 210 determines whether or not the data transmission of the host controller 11 and the slave controller 12B is completed based on the host internal clock count value of the host clock counting unit 23A. For example, 'assuming that 32-bit data needs to be transferred between the host controller 11 and the slave controller 12, each host transmits 1 bit of data in the internal clock cycle, and the host internal clock count is incremented by 1 every one internal clock cycle. If the host clock counting unit 230 starts counting from 0, counting to 31 indicates that the data transmission is completed. Figures 5 to 8 are schematic views of the data of the double-speed transfer wheel. 5(:1^ indicates the serial clock signal, 2xSCLK indicates the internal clock of the host, /SS2 indicates the slave selection signal +MOSI of the slave controller 12B indicates the data on the host output/slave input data line 15, MISO indicates In the example shown in Figure 5 to Figure 8 of the master input/slave output data line 1_6, data transmission is performed by means of interleaved transmission. 'Every valid data is transmitted each time. Each valid data is 8 bits, each The target address corresponding to the valid data is 7 bits, and each valid data corresponds to a 1-bit read/write operation control character, wherein the first valid data (hereinafter referred to as the first valid data) is D0, and the corresponding first target The address is 098133052 Form No. A0101 Page/Total 37 Page 0982056595-0 201112002 A0 'The number of bits of valid data from low to high is D〇〇, D〇i, D〇2, D03, D04, D05, D06, D07, each bit of the first target address is A00, A01, A02, A03, A04, A05, A06, A07 from low to high. The second valid data (hereinafter referred to as the second valid data) is D1, Corresponding second target address is A1, second The bits of the valid data are from low to high D10, Dll ' D12, D13, D14, D15, D16, D17 'The bits of the second target address are from 1 to 1, A11, A12, A13, A14. A15, A16, A17. As can be seen from FIG. 5 to FIG. 8, two read/write operation control symbols are first transmitted between the host controller 11 and the slave controller i2B, and then two target addresses are transmitted, and finally two transmissions are performed. Valid data, and in the order from low to present: the target address and the bits of the valid data are transmitted. The order of the address and address ▲ is: A, Α10, Α01, Ail, Α02, Α12, Α03, Α13 , Α〇4, Au ' Α05, Α15, Α06, Α16, the order of sending valid data is: D〇〇, DIO, D01 ' Dll, D02, D12, D03, D13, D04, D14, D05, D15, D06, D00, D06, D16. [0038] Specifically, FIG. 5 is a schematic diagram of performing two write operations in a continuous manner. First, the write operation control symbols /wo and /wi are transmitted, and then the target addresses A0 and A1 are transmitted. Finally, the valid data DO and D1 are transmitted, and the write operation controllers 1〇 and 〆W1, the target addresses A0 and A 1 and the valid data D〇 and m are both transmitted by the master output/slave input data line 15. Figure 6 is a schematic diagram of two consecutive read operations. The read operation control characters R0 and R1 are transmitted first, and then the target address is transmitted. ", the last valid data D0 and D1 are transmitted. Moreover, the read operation control symbols and the target addresses A0 and A1 are transmitted by the host output/slave input data line 15 as valid data 098133052 Form No. A0101 Page 18 of 37 0982056595-0 201112002 DO and D1 are transmitted by the master wheel/slave input data line 16. [_ Diagram of money execution - write operation and - read operation. First, the write operation control/W〇 and the read operation control are transmitted, then the target addresses A〇 and A1 are transmitted, and the valid data DO and D1 are finally transmitted. Moreover, the write operation control symbol /W, the read operation control symbol R1, the target address A0 and A1, and the valid data DO are transmitted by the host output/slave input data line 15, and the valid data D1 is input by the host input/slave data. Line 16 passes. [0040] 098 [0043] FIG. 8 is a schematic diagram of sequential execution - secondary read operation and - secondary write operation. First, transfer read operation control fine and write operation control (4) / W transfer destination address A0 and A1 ' last transmission of valid data (10) and ^. Moreover, the read operation control fine and write operation control, the target address _A1 and the valid data D1 are transmitted by the host output/slave input data line ι5, and the valid data (10) is transmitted by the host input/slave input data line 16. ~ Tian can understand that if the SPI bus system 1Q transmits data at a single speed, the write operation is performed as shown in Fig. 9, and the teaching operation is performed as shown in Fig. 9. With the present invention, the SPI, bus system 1Q can transmit 1 bit of data every half of the serial clock signal period. Compared with the conventional SPI bus system, it achieves a higher data transmission rate, for example, if the highest serial number The frequency of the clock signal is 32. The SPI bus system of the prior art can only reach the data transmission rate of ^(4)_8, and the bus system 10 of the present invention can achieve the data transmission rate of up to 64 Mbps. Moreover, the master controller 11 and the slave controller 12 _121) both support the single-speed carrier: the SPI bus system that is compatible with the conventional technology. In summary, the present invention meets the requirements of the invention patent, and the United States legally proposes a patent form bat spicy deletion 1 帛 I9 1 / a total of 37 pages 0982056595-0 201112002 application. The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited to the above-described embodiments, and equivalent modifications or variations made by those skilled in the art in light of the spirit of the present invention are It should be covered by the following patent application. BRIEF DESCRIPTION OF THE DRAWINGS [0044] FIG. 1 is a system architecture diagram of a preferred embodiment of a serial peripheral interface bus system. [0045] FIG. 2 is a detailed architecture diagram of a host controller in FIG. 3 is a detailed architecture diagram of the slave controller of FIG. 1. 4 is a schematic diagram of a preferred embodiment of a data transmission method based on a tandem peripheral interface bus of the present invention. 5 is a schematic diagram of two consecutive write operations when data is transmitted at twice the speed. [0049] FIG. 6 is a schematic diagram of two consecutive read operations when data is transmitted at twice the speed. [0050] FIG. A schematic diagram of performing a write operation and a read operation successively when transferring data at a double speed. [0051] FIG. 8 is a schematic diagram of performing a read operation and a write operation successively when data is transmitted at twice the speed. [0052] FIG. 9 is a schematic diagram of a write operation performed when data is transmitted at a single speed. [0053] FIG. 10 is a schematic diagram of a read operation performed when data is transmitted at a single speed. [Main component symbol description] 098133052 Form No. A0101 Page 20 of 37 0982056595-0 201112002

[0054] SPI匯流排系統10 [0055] 主機控制器11 [0056] 從機控制器12A-12D [0057] SPI匯流排13 [0058] 串列時鐘訊號線14 [0059] 主機輸出/從機輸入資料線 15 [0060] 主機輸入/從機輸出資料線 16 [0061] 從機選擇訊號線17A-17D [0062] 主機時鐘產生單元200 [0063] 從機選擇單元210 [0064] 主機時鐘分頻單元220 [0065] 主機時鐘計數單元230 : ; ; .丨;7 i| 气. [0066] 主機位址緩衝區2 40 !ii - , w *; [0067] 主機輸出資料緩衝區250 [0068] 主機輸入資料緩衝區260 [0069] 主機輸出控制邏輯單元270 [0070] 主機輸入控制邏輯單元280 [0071] 從機時鐘倍頻單元300 [0072] 從機時鐘計數單元310 098133052 表單編號A0101 第21頁/共37頁 201112002 [0073] 從機輸入控制邏輯單元320 [0074] 從機輸出控制邏輯單元330 [0075] 從機位址緩衝區340 [0076] 從機輸入資料缓衝區350 [0077] 從機輸出資料緩衝區360 [0078] 從機操作控制邏輯單元370 [0079] 從機目標記憶體380 〇 [0080] 生成主機内部時鐘S401 [0081] 從機選擇訊號置為有效S402 [0082] 發送串列時鐘訊號S403 [0083] 生成從機内部時鐘S404 [0084] 分別對主機内部時鐘以及從機内部時鐘計數S405 [0085] 傳輸讀/寫操作控制符及目標位址S406 1) [0086] 傳輸有效資料S407 [0087] 從機選擇訊號置為無效S408 098133052 表單編號Α0101 第22頁/共37頁 0982056595-0SPI Bus System 10 [0055] Host Controller 11 [0056] Slave Controller 12A-12D [0057] SPI Bus 13 [0058] Serial Clock Signal Line 14 [0059] Master Output/Slave Input Data Line 15 [0060] Master Input/Slave Output Data Line 16 [0061] Slave Select Signal Line 17A-17D [0062] Master Clock Generation Unit 200 [0063] Slave Select Unit 210 [0064] Host Clock Divider Unit 220 [0065] Host clock counting unit 230: ; ; .丨;7 i| gas. [0066] Host address buffer 2 40 ! ii - , w *; [0067] Host output data buffer 250 [0068] Host Input Data Buffer 260 [0069] Host Output Control Logic Unit 270 [0070] Master Input Control Logic Unit 280 [0071] Slave Clock Multiplier Unit 300 [0072] Slave Clock Counting Unit 310 098133052 Form Number A0101 Page 21 / 37-201112002 [0073] Slave Input Control Logic Unit 320 [0074] Slave Output Control Logic Unit 330 [0075] Slave Address Buffer 340 [0076] Slave Input Data Buffer 350 [0077] Slave Output Data Buffer 360 [0078] Slave Operation Logic unit 370 [0079] Slave target memory 380 〇 [0080] Generate host internal clock S401 [0081] Slave select signal is asserted S402 [0082] Transmit serial clock signal S403 [0083] Generate slave internal clock S404 [0084] respectively transmit the read/write operation control character and the target address S406 to the internal clock of the master and the slave internal clock S405 [0085] [0086] Transfer valid data S407 [0087] The slave select signal is invalid S408 098133052 Form number Α0101 Page 22 of 37 0982056595-0

Claims (1)

201112002 七、申請專利範圍: 1 . 一種基於串列週邊介面(.SPI)匯流排的主機控制器,可 以與基於SPI匯流排的從機控制器進行資料傳輸,該主機 控制器包括: 主機時鐘產生單元,用於生成主機内部時鐘; 從機選擇單元,用於選擇與主機控制器進行資料傳輸的從 機控制器; 主機時鐘分頻單元,用於將主機内部時鐘二分頻生成串列 時鐘訊號,並將該串列時鐘訊號發送給選擇的從機控制器 Ο 主機時鐘計數單元,用於對主機内部時鐘計數; 主機位址緩衝區,用於緩存發送給選擇的從機控制器的目 標位址; 主機輸出資料缓衝區,用於緩存發送給選擇的從機控制器 的有效資料, 主機輸出控制邏輯單元,用於生成讀/寫操作控制符,從 Q 主機位址緩衝區讀取發送給選擇的從機控制器的目標位址 ,從主機輸出資料緩衝區讀取發送給選擇的從機控制器的 有效資料,並根據主機内部時鐘及主機内部時鐘計數值按 照指定的順序將讀/寫操作控制符、目標位址以及有效資 料發送給選擇的從機控制器,其中所述讀/寫操作控制符 用於控制選擇的從機控制器執行相對應的讀/寫操作;及 主機輸入控制邏輯單元,用於根據主機内部時鐘及主機内 部時鐘計數值接收選擇的從機控制器發送來的有效資料, 並將接收的有效資料緩存到主機輸入資料緩衝區。 098133052 表單編號A0101 第23頁/共37頁 0982056595-0 201112002 2 .如申請專利範圍第1項所述之基於SPI匯流排的主機控制 器,其中所述主機時鐘計數單元在以兩倍速傳輸資料時每 經過一個主機内部時鐘週期將主機内部時鐘計數值加1, 在以單倍速傳輸資料時每經過兩個主機内部時鐘週期將主 機内部時鐘計數值加1。 3 .如申請專利範圍第1項所述之基於SPI匯流排的主機控制 器,其中所述主機輸出控制邏輯單元採用交錯傳輸的方式 發送讀/寫操作控制符、目標位址以及有效資料。 4 .如申請專利範圍第1項所述之基於SPI匯流排的主機控制 Ο 器,其中所述從機選擇單元根據主機時鐘計數單元的主機 内部時鐘計數值判斷是否資料傳輸完畢,若資料傳輸完畢 ,則結束對從機控制器的選擇。 5 . —種基於串列週邊介面(SPI)匯流排的從機控制器,可 以與基於SPI匯流排的主機控制器進行資料傳輸,該從機 控制器包括: 從機時鐘倍頻單元,用於接收主機控制器發送來的串列時 鐘訊號,將該串列時鐘訊號二倍頻生成從機内部時鐘; y 從機時鐘計數單元,用於當主機控制器選擇與該從機控制 器進行資料傳輸時,對從機内部時鐘計數; 從機輸入控制邏輯單元,用於根據從機内部時鐘及從機内 部時鐘計數值接收主機控制器發送的讀/寫操作控制符、 目標位址及有效資料,將接收的目標位址緩存到從機位址 緩衝區,將接收的有效資料緩存到從機輸入資料緩衝區, 並根據接收的讀/寫操作控制符產生相對應的讀/寫操作控 制訊號; 從機操作控制邏輯單元,用於當收到寫操作控制訊號時, 098133052 表單編號A0101 第24頁/共37頁 0982056595-0 201112002 讀取從機位址緩衝區緩存的目 衝區緩存的有效資料,並 π卩及從機輸入資料緩 體的目標位址所指定的館存單效資:儲存到從機目標記憶 訊號時,讀取從機 70,或者當收到讀操作控制 址指定的儲存單元t讀取有標位址,從目標位 到從機輸出資料緩衝區;及、並將该有效資料緩存 Ο ο ===::::,輪__緩存 _的有效_=::一_值 -種基於串列週邊介面(s “機控制。 用於在主)匯流排的資料傳輸方法, 用於在主機控制器與從機控制器之 法包括步驟:資枓傳輸,该方 主機控制器生成主機内部時鐘; . 主機控制器選擇進行資料傳輸的從機控制器. 將主機内部時鐘二分頻生成串列時鐘訊號,並 將該串列時鐘訊號發送給娜_挺制器. 從機控制器將串列時鐘訊號二倍麻成從機内部時鐘. 主機控制n對主機㈣時鐘計數,從機控制輯從機 時鐘計數; 主機控制器根據主機内部時鐘計數值以及主機内部時鐘按 照指定的順序發送讀/寫操作控制符及目標位址,從機控 制器根據從機内部時鐘計數值以及從機内部時鐘接收該讀 /寫操作控制符及目標位址; 與寫操作控制符相對應地,主機控制器根據主機内部時鐘 計數值以及主機内部時鐘按照指定的順序發送有效資料, 從機控制器根據從機内部時鐘計數值以及從機内部時鐘接· 098133052 表單編號A0101 第25頁/共37頁 0982056595-0 201112002 收有效貢料並將該有效資料寫入目的位址指定的儲存早元 ,或者與讀操作控制符相對應地,從機控制器從目標位址 指定的儲存單元讀取有效資料,並根據從機内部時鐘及從 機内部時鐘計數值將該有效資料按照指定的順序發送給主 機控制器,主機控制器根據主機内部時鐘及主機内部時鐘 計數值接收該有效資料;及 主機控制器結束對從機控制器的選擇。 7 .如申請專利範圍第6項所述之基於SPI匯流排的資料傳輸 方法,其中所述主機控制器對主機内部時鐘計數的步驟中 ,主機控制器在以兩倍速傳輸資料時每經過一個主機内部 時鐘週期將主機内部時鐘計數值加1,在以單倍速傳輸資 料時每經過兩個主機内部時鐘週期將主機内部時鐘計數值 加1。 8 .如申請專利範圍第6項所述之基於SPI匯流排的資料傳輸 方法,其中所述主機控制器根據主機内部時鐘計數值以及 主機内部時鐘按照指定的順序發送讀/寫操作控制符及目 標位址的步驟中,主機控制器採用交錯傳輸的方式發送讀 /寫操作控制符及目標位址,所述主機控制器根據主機内 部時鐘計數值以及主機内部時鐘按照指定的順序發送有效 資料的步驟中,主機控制器採用交錯傳輸的方式發送有效 資料。 9 .如申請專利範圍第6項所述之基於SPI匯流排的資料傳輸 方法,其中所述主機控制器結束對從機控制器的選擇的步 驟中,主機控制器根據主機内部時鐘計數值判斷是否資料 傳輸完畢,若資料傳輸完畢,則結束對從機控制器的選擇 098133052 表單編號A0101 第26頁/共37頁 201112002 10 .如申請專利範圍第6項所述之基於SPI匯流排的資料傳輸 方法,其中所述從機控制器將串列時鐘訊號二倍頻生成從 機内部時鐘的步驟中,從機控制器採用鎖相環電路將串列 時鐘訊號二倍頻。 Ο201112002 VII. Patent application scope: 1. A host controller based on a serial peripheral interface (.SPI) bus, which can perform data transmission with a slave controller based on SPI bus. The host controller includes: host clock generation a unit for generating a host internal clock; a slave selecting unit for selecting a slave controller for data transmission with the host controller; and a host clock dividing unit for dividing the internal clock of the host to generate a serial clock signal And sending the serial clock signal to the selected slave controller 主机 the host clock counting unit for counting the internal clock of the host; the host address buffer for buffering the target bit sent to the selected slave controller The host output data buffer is used to buffer the valid data sent to the selected slave controller, and the host output control logic unit is configured to generate a read/write operation control character, which is read and sent from the Q host address buffer. The target address of the selected slave controller is read from the host output data buffer and sent to the selected slave controller. Valid data, and send the read/write operation control character, the target address, and the valid data to the selected slave controller according to the internal clock of the host and the internal clock count value of the host, wherein the read/write operation control character The slave controller for controlling the selection performs a corresponding read/write operation; and the host input control logic unit is configured to receive the valid data sent by the selected slave controller according to the internal clock of the host and the internal clock count value of the host, The received valid data is cached in the host input data buffer. The SPI bus-based host controller of claim 1, wherein the host clock counting unit transmits data at twice the speed, as described in claim 1 of the invention. The host internal clock count is incremented by one each time a host internal clock cycle is passed, and the host internal clock count is incremented by one every two host internal clock cycles when transmitting data at a single rate. 3. The SPI bus-based host controller of claim 1, wherein the host output control logic unit transmits the read/write operation control character, the target address, and the valid data in an interleaved manner. 4. The SPI bus-based host control device according to claim 1, wherein the slave selection unit determines whether the data transmission is completed according to a host internal clock count value of the host clock counting unit, and if the data transmission is completed. , then the selection of the slave controller is ended. 5. A slave controller based on a serial peripheral interface (SPI) bus, which can perform data transfer with a host controller based on an SPI bus, the slave controller comprising: a slave clock multiplier unit for Receiving the serial clock signal sent by the host controller, generating the slave internal clock by double the frequency of the serial clock signal; y the slave clock counting unit, configured to perform data transmission with the slave controller when the host controller selects The slave internal clock is counted; the slave input control logic unit is configured to receive the read/write operation control character, the target address, and the valid data sent by the host controller according to the slave internal clock and the slave internal clock count value. Cache the received target address into the slave address buffer, buffer the received valid data into the slave input data buffer, and generate a corresponding read/write operation control signal according to the received read/write operation control character; The slave operation control logic unit is used when receiving the write operation control signal, 098133052 Form No. A0101 Page 24/37 Page 0982056595-0 201112002 Read the valid data of the buffer buffer of the slave address buffer buffer, and π卩 and the library address data specified by the target address of the slave input data buffer: when storing to the slave target memory signal, read The slave 70 is taken, or when the storage unit specified by the read operation control address is received, the tagged address is read, and the data buffer is output from the target bit to the slave; and the valid data is buffered ο ο ===: :::, round __cache_valid _=::__value-based on the serial peripheral interface (s "machine control. Used in the main" bus data transfer method, used in the host controller and The slave controller method includes the steps of: resource transfer, the host controller generates a host internal clock; the host controller selects a slave controller for data transmission. The host internal clock is divided by two to generate a serial clock signal. The serial clock signal is sent to the __ controller. The slave controller doubles the serial clock signal to the slave internal clock. The host control n pairs the host (four) clock count, the slave control master slave clock count ; The host controller is based on the host The clock count value and the host internal clock send the read/write operation control character and the target address in the specified order, and the slave controller receives the read/write operation control character and the target bit according to the internal clock count value of the slave and the internal clock of the slave. Corresponding to the write operation control character, the host controller sends valid data according to the internal clock count value of the host and the internal clock of the host in the specified order, and the slave controller selects according to the internal clock count value of the slave and the internal clock of the slave. 098133052 Form No. A0101 Page 25 of 37 0982056595-0 201112002 Receive valid tribute and write the valid data to the storage early element specified by the destination address, or corresponding to the read operation control, the slave controller The storage unit specified by the target address reads the valid data, and sends the valid data to the host controller according to the internal clock of the slave and the internal clock count value of the slave, and the host controller according to the internal clock of the host and the internal clock of the host The count value receives the valid data; and the host controller ends the selection of the slave controller Choose. 7. The SPI bus-based data transmission method according to claim 6, wherein in the step of the host controller counting the internal clock of the host, the host controller passes each host when transmitting data at twice the speed The internal clock cycle increments the host's internal clock count by one, incrementing the host's internal clock count by one every two host internal clock cycles when transferring data at a single rate. 8. The SPI bus-based data transmission method according to claim 6, wherein the host controller transmits a read/write operation control character and a target according to a host internal clock count value and a host internal clock in a specified order. In the step of address, the host controller sends the read/write operation control character and the target address in an interleaved manner, and the host controller sends the valid data according to the internal clock count value of the host and the internal clock of the host in a specified order. The host controller sends valid data by means of interleaved transmission. 9. The SPI bus-based data transmission method according to claim 6, wherein in the step of the host controller ending the selection of the slave controller, the host controller determines whether the host internal clock count value is After the data transmission is completed, if the data transmission is completed, the selection of the slave controller is ended. 098133052 Form No. A0101 Page 26 of 37 201112002 10 . SPI bus-based data transmission method as described in claim 6 The slave controller generates a slave clock signal by a factor of two times to generate a slave internal clock, and the slave controller uses a phase locked loop circuit to double the serial clock signal. Ο 098133052 表單編號Α0101098133052 Form number Α0101 !3!3 第27頁/共37頁 0982056595-0Page 27 of 37 0982056595-0
TW98133052A 2009-09-29 2009-09-29 Data transmission device and method based on serial peripheral interface TWI394050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98133052A TWI394050B (en) 2009-09-29 2009-09-29 Data transmission device and method based on serial peripheral interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98133052A TWI394050B (en) 2009-09-29 2009-09-29 Data transmission device and method based on serial peripheral interface

Publications (2)

Publication Number Publication Date
TW201112002A true TW201112002A (en) 2011-04-01
TWI394050B TWI394050B (en) 2013-04-21

Family

ID=44909093

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98133052A TWI394050B (en) 2009-09-29 2009-09-29 Data transmission device and method based on serial peripheral interface

Country Status (1)

Country Link
TW (1) TWI394050B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI497304B (en) * 2012-03-13 2015-08-21 Novatek Microelectronics Corp Serial interface transmitting method and related device
TWI645294B (en) * 2015-10-30 2018-12-21 美商美光科技公司 Method of operating memory system,apparatus for data transfer,electronic memory apparatus,and memory device
TWI701555B (en) * 2015-09-21 2020-08-11 美商高通公司 Master device, slave device and method for operating the same

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI750980B (en) * 2020-12-30 2021-12-21 新唐科技股份有限公司 Serial peripheral interface system and data transmssion method thereof

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI386813B (en) * 2006-07-06 2013-02-21 Macronix Int Co Ltd Method and apparatus for communicating a bit per half clock cycle over at least one pin of an spi bus
US8103936B2 (en) * 2007-10-17 2012-01-24 Micron Technology, Inc. System and method for data read of a synchronous serial interface NAND
US8102710B2 (en) * 2007-10-17 2012-01-24 Micron Technology, Inc. System and method for setting access and modification for synchronous serial interface NAND
TWI417728B (en) * 2008-02-15 2013-12-01 Hon Hai Prec Ind Co Ltd Serial peripheral interface communication circuit

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI497304B (en) * 2012-03-13 2015-08-21 Novatek Microelectronics Corp Serial interface transmitting method and related device
US9229519B2 (en) 2012-03-13 2016-01-05 Novatek Microelectronics Corp. Serial interface transmitting method and peripheral device chip
TWI701555B (en) * 2015-09-21 2020-08-11 美商高通公司 Master device, slave device and method for operating the same
TWI645294B (en) * 2015-10-30 2018-12-21 美商美光科技公司 Method of operating memory system,apparatus for data transfer,electronic memory apparatus,and memory device
US10162558B2 (en) 2015-10-30 2018-12-25 Micron Technology, Inc. Data transfer techniques for multiple devices on a shared bus
US10635342B2 (en) 2015-10-30 2020-04-28 Micron Technology, Inc. Data transfer techniques for multiple devices on a shared bus
US10671310B2 (en) 2015-10-30 2020-06-02 Micron Technology, Inc. Data transfer techniques for multiple devices on a shared bus
US11762570B2 (en) 2015-10-30 2023-09-19 Micron Technology, Inc. Data transfer techniques for multiple devices on a shared bus

Also Published As

Publication number Publication date
TWI394050B (en) 2013-04-21

Similar Documents

Publication Publication Date Title
TW311304B (en)
JP5629819B2 (en) Apparatus and method for using variable clock gating hysteresis in communication port
CN101599053B (en) Serial interface controller supporting multiple transport protocols and control method
KR100888597B1 (en) Apparatus and methods for controlling memory interface
TW201211766A (en) Critical word forwarding with adaptive prediction
KR101453608B1 (en) Slave mode transmit with zero delay for audio interface
JP5551512B2 (en) COMMUNICATION CONTROL DEVICE, DATA COMMUNICATION METHOD, AND PROGRAM
WO2023284169A1 (en) Method for writing data from axi bus to opb bus and method for reading data from axi bus to opb bus
CN103064805A (en) Serial Peripheral Interface (SPI) controller and communication method
TW201112002A (en) Data transmission device and method based on serial peripheral interface
CN108228498A (en) A kind of DMA control devices and image processor
JP3510618B2 (en) Bus bridge circuit and access control method therefor
CN116185935A (en) FPGA prototype verification method, system, medium and computing device of controller
JP6523707B2 (en) Memory subsystem that performs continuous reading from lap reading
WO2014169876A1 (en) Bus arbitration method and apparatus, and storage medium
US8868827B2 (en) FIFO apparatus for the boundary of clock trees and method thereof
JP4902640B2 (en) Integrated circuit and integrated circuit system
CN108667628A (en) A kind of interface switching device and interface conversion method
US11789884B2 (en) Bus system and method for operating a bus system
CN112637102B (en) Audio interface circuit, control method thereof and audio equipment
US6260119B1 (en) Memory cache management for isochronous memory access
CN103888211A (en) Method and device for data transmission between crossed chips
JP3400730B2 (en) Data transmission system and data transmission control device used for this data transmission system
JP2013196476A (en) Data processor and memory control device
CN101521671B (en) Data frame transmission chain table structure

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees