TW202022625A - Data transmission method, slave device with serial peripheral interface and data processing device wherein the data transmission method further includes performing a parallel-to-serial operation - Google Patents

Data transmission method, slave device with serial peripheral interface and data processing device wherein the data transmission method further includes performing a parallel-to-serial operation Download PDF

Info

Publication number
TW202022625A
TW202022625A TW107144342A TW107144342A TW202022625A TW 202022625 A TW202022625 A TW 202022625A TW 107144342 A TW107144342 A TW 107144342A TW 107144342 A TW107144342 A TW 107144342A TW 202022625 A TW202022625 A TW 202022625A
Authority
TW
Taiwan
Prior art keywords
serial
output terminal
buffer
data
clock
Prior art date
Application number
TW107144342A
Other languages
Chinese (zh)
Other versions
TWI687815B (en
Inventor
黃平
Original Assignee
大陸商北京集創北方科技股份有限公司
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 大陸商北京集創北方科技股份有限公司 filed Critical 大陸商北京集創北方科技股份有限公司
Priority to TW107144342A priority Critical patent/TWI687815B/en
Application granted granted Critical
Publication of TWI687815B publication Critical patent/TWI687815B/en
Publication of TW202022625A publication Critical patent/TW202022625A/en

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

A data transmission method for enabling a slave device with a serial peripheral interface to transmit serial data through a serial output terminal under the control of a first serial clock output by a master control device during an enabling period. The method includes using a first logic unit to perform a parallel-to-serial operation according to a system clock and temporarily store a first bit data; using a second logic unit to perform a bit buffer operation over the bit data generated by the parallel-to-serial operation based on a second serial clock to generate a second bit data. The second serial clock is an in-phase signal or an opposite phase signal of the first serial clock. The method further includes using a multiplexer to select outputting the first bit data or the second bit data to the serial output terminal under a control of a mode signal during an enabling period.

Description

資料發送方法、具有序列周邊介面之從屬裝置及資訊處理裝置Data sending method, slave device with serial peripheral interface and information processing device

本發明係關於一種資料發送方法,特別是關於具有序列周邊介面之從屬裝置發送資料的方法。The present invention relates to a data transmission method, in particular to a data transmission method for a slave device with a serial peripheral interface.

SPI(serial peripheral interface;序列周邊介面)為一種主從式同步串列通訊介面,其具有傳送速率快、結構簡單、可全雙工通訊等優點,因此被廣泛應用於諸多領域上。現有序列周邊介面從屬裝置在資料傳輸上可使用主入從出(master input slave output;MISO)、主出從入(master output slave input;MOSI)等不同方式。SPI (serial peripheral interface; serial peripheral interface) is a master-slave synchronous serial communication interface, which has the advantages of fast transmission rate, simple structure, full-duplex communication, etc., so it is widely used in many fields. The existing serial peripheral interface slave devices can use different methods such as master input slave output (MISO) and master output slave input (MOSI) in data transmission.

另外,SPI的工作模式可分為第一模式(包含模式0和模式2)和第二模式(包含模式1和模式3)。在第一模式中,由於需要在第一個SPI串列時鐘發送沿之前發送出第一位元資料,因此須鎖存好第一位元資料;及在第二模式中,由於第一位元資料是由第一個發送沿推送輸出,因此不須鎖存第一位元資料。In addition, the working mode of SPI can be divided into a first mode (including mode 0 and mode 2) and a second mode (including mode 1 and mode 3). In the first mode, because the first bit of data needs to be sent before the first SPI serial clock transmission edge, the first bit of data must be latched; and in the second mode, because the first bit of data The data is pushed out by the first sending edge, so there is no need to latch the first bit of data.

以下以表1說明SPI模式0-3區別:The following table 1 illustrates the difference between SPI mode 0-3:

表1

Figure 107144342-A0304-0001
Table 1
Figure 107144342-A0304-0001

其中,SPI模式0的推送時鐘與SPI串列時鐘反相;SPI模式1的推送時鐘與SPI串列時鐘同相;SPI模式2的推送時鐘與SPI串列時鐘同相;以及SPI模式3的推送時鐘與SPI串列時鐘反相。Among them, the push clock of SPI mode 0 is inverse to the SPI serial clock; the push clock of SPI mode 1 is in phase with the SPI serial clock; the push clock of SPI mode 2 is in phase with the SPI serial clock; and the push clock of SPI mode 3 is in phase with the SPI serial clock. The SPI serial clock is inverted.

以傳統的MISO傳輸方式為例,其結構圖如圖1所示,其中,一從屬裝置100內含一發送沿檢測模組110、一資料儲存模組120及一傳送邏輯模組130;而圖2繪示圖1從屬裝置100之一工作波形圖。Taking the traditional MISO transmission method as an example, its structure is shown in Figure 1. A slave device 100 contains a transmission edge detection module 110, a data storage module 120 and a transmission logic module 130; 2 shows a working waveform diagram of one of the slave devices 100 in FIG. 1.

從屬裝置100內部使用一個比SPI之串列時鐘SCLK頻率高數倍的系統時鐘SYSCLK,發送沿檢測模組110檢測串列時鐘SCLK的發送沿(drive edge)跳變以得到一發送沿信號SIG1。發送沿信號SIG1只維持系統時鐘SYSCLK的一個時鐘週期高電平有效,以驅動傳送邏輯模組130,從而將資料儲存模組120的輸出資料DATAOUT移位元然後輸出一個位元(bit)的資料到輸出端上。The slave device 100 internally uses a system clock SYSCLK that is several times higher in frequency than the serial clock SCLK of the SPI, and the transmission edge detection module 110 detects the drive edge transition of the serial clock SCLK to obtain a transmission edge signal SIG1. The sending edge signal SIG1 only maintains one clock cycle of the system clock SYSCLK to be active high to drive the transmission logic module 130, thereby shifting the output data DATAOUT of the data storage module 120 by the element and outputting one bit of data To the output.

圖2是SPI模式0的工作時序圖。串列時鐘SCLK通常只有SPI傳輸資料時(即接腳選擇CS有效期間)工作,其他時間通常保持固定電平不變化(即使有變化也可以用接腳選擇CS禁能)。另外,SPI需要在第一個串列時鐘SCLK到來的時候準備好資料DATAOUT,其無法以串列時鐘SCLK從資料儲存模組120讀出資料DATAOUT以進行資料發送的程式。Figure 2 is a working timing diagram of SPI mode 0. The serial clock SCLK usually only works when SPI is transmitting data (that is, when the pin is selected during the effective period of CS), and usually remains at a fixed level at other times (even if there is a change, you can use the pin to select CS to disable). In addition, the SPI needs to prepare the data DATAOUT when the first serial clock SCLK arrives, and it cannot read the data DATAOUT from the data storage module 120 with the serial clock SCLK to perform the data transmission program.

然而,由圖2可看出,由於MISO延遲時間是發生在發送沿之後,因此,在發送沿和採樣沿之間的時間須分配給MISO延遲時間、信號傳播延遲時間(由導電墊片(PAD)及電路板(board)造成)及MISO建立時間,也就是說,MISO建立時間會被壓縮,而使得在串列時鐘SCLK頻率固定的情況下,系統時鐘SYSCLK需要較高的頻率,或在系統時鐘SYSCLK固定的情況下,串列時鐘SCLK只能支援較低的頻率,也就是說,此情況會使得系統時鐘/串列時鐘的頻率比例較高。However, it can be seen from Figure 2 that since the MISO delay time occurs after the sending edge, the time between the sending edge and the sampling edge must be allocated to the MISO delay time and the signal propagation delay time (by the conductive pad (PAD) ) And the circuit board (board)) and MISO setup time, that is, the MISO setup time will be compressed, so that when the frequency of the serial clock SCLK is fixed, the system clock SYSCLK needs a higher frequency, or in the system When the clock SYSCLK is fixed, the serial clock SCLK can only support a lower frequency, that is, this situation will make the frequency ratio of the system clock/serial clock higher.

為解決上述問題,本領域亟需一種新穎的用於序列周邊介面從屬裝置的資料發送方法。To solve the above-mentioned problems, a novel data transmission method for serial peripheral interface slave devices is urgently needed in the art.

本發明之一目的在於提供一種用於序列周邊介面之從屬裝置之資料發送方法,其可藉由一緩衝機制緩衝欲發送至一主控裝置或另一從屬裝置的位元資料,以放寬該從屬裝置內的相關邏輯電路的時序要求,從而可在降低系統時鐘頻率的情形下正確完成串列資料的傳送。An object of the present invention is to provide a data transmission method for a slave device of a serial peripheral interface, which can buffer the bit data to be sent to a master device or another slave device by a buffer mechanism, so as to relax the slave device The timing requirements of the relevant logic circuits in the device can be used to correctly complete serial data transmission while reducing the system clock frequency.

本發明之另一目的在於提供一種具有序列周邊介面之從屬裝置,其可藉由一緩衝機制緩衝欲發送至一主控裝置或另一從屬裝置的位元資料,以放寬該從屬裝置內的相關邏輯電路的時序要求,從而可在降低系統時鐘頻率的情形下正確完成串列資料的傳送。Another object of the present invention is to provide a slave device with a serial peripheral interface, which can buffer the bit data to be sent to a master device or another slave device by a buffering mechanism, so as to relax the correlation in the slave device The timing requirements of the logic circuit enable the transmission of serial data to be correctly completed while reducing the system clock frequency.

本發明之又一目的在於提供一種資訊處理裝置,其可藉由前述的從屬裝置實現其內部之至少一周邊裝置,且所述周邊裝置可為一記憶體模組或一顯示器。Another object of the present invention is to provide an information processing device, which can realize at least one peripheral device inside the information processing device through the aforementioned slave device, and the peripheral device can be a memory module or a display.

為達上述目的,一種資料發送方法乃被提出,其係利用具有一序列周邊介面(Serial Peripheral Interface;SPI)之一從屬裝置(slave device)實現,該從屬裝置係在一致能期間,依一主控裝置輸出的一第一串列時鐘的控制以經由一串行輸出端傳送串列資料,該資料發送方法包含下列步驟:To achieve the above-mentioned purpose, a data transmission method is proposed, which is implemented by a slave device (Serial Peripheral Interface; SPI). The slave device is based on a master during a consistent performance period. A first serial clock output by the control device is controlled to transmit serial data via a serial output terminal. The data sending method includes the following steps:

利用一第一邏輯單元依一系統時鐘進行一並行轉串列操作,該並行轉串列操作包括:檢測該第一串列時鐘之各發送沿以獲得一發送沿信號,所述發送沿係一上升沿或一下降沿;依該發送沿信號的控制對複數個位元組資料依序進行一串列移位元操作,並以一移位輸出端依序提供一個輸出位元資料;以及利用一第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料並經由一第一緩衝輸出端以提供一第一緩衝位元資料;A first logic unit is used to perform a parallel-to-serial operation based on a system clock. The parallel-to-serial operation includes: detecting each transmission edge of the first serial clock to obtain a transmission edge signal, and the transmission edge is a A rising edge or a falling edge; according to the control of the sending edge signal, a serial shift element operation is sequentially performed on a plurality of byte data, and an output bit data is sequentially provided by a shift output terminal; and using A first buffer unit is coupled to the shift element output terminal to temporarily store one of the output bit data and provide a first buffer bit data through a first buffer output terminal;

利用一第二邏輯單元依一第二串列時鐘對該移位元輸出端進行一位緩衝操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,該第二串列時鐘係該第一串列時鐘的同相或反相信號;以及A second logic unit is used to perform a bit buffer operation on the shift element output terminal according to a second serial clock, and a second buffer bit data is sequentially provided through a second buffer output terminal, wherein the second The serial clock is the in-phase or inverted signal of the first serial clock; and

利用一多工器在該致能期間內依一模式信號的控制,選擇將該第一緩衝輸出端耦接至所述串行輸出端,或將該第二緩衝輸出端耦接至所述串行輸出端。Use a multiplexer to select the first buffer output terminal to be coupled to the serial output terminal or the second buffer output terminal to be coupled to the serial output terminal under the control of a mode signal during the enabling period Line output terminal.

在一實施例中,當該模式信號呈現一第一模式時,該多工器係在該致能期間內的一初始時間之前選擇將該第一緩衝輸出端耦接至所述串行輸出端,及在該初始時間之後選擇將該第二緩衝輸出端耦接至所述串行輸出端。In one embodiment, when the mode signal presents a first mode, the multiplexer selects to couple the first buffer output terminal to the serial output terminal before an initial time in the enabling period , And choosing to couple the second buffer output terminal to the serial output terminal after the initial time.

在一實施例中,當該模式信號呈現一第二模式時,該多工器係在該致能期間內選擇將該第二緩衝輸出端耦接至所述串行輸出端。In one embodiment, when the mode signal presents a second mode, the multiplexer selects to couple the second buffer output terminal to the serial output terminal during the enabling period.

為達上述目的,本發明進一步提出一種具有一序列周邊介面之從屬裝置,以實現一資料發送方法,該從屬裝置具有一串行輸出端、一第一邏輯單元、一第二邏輯單元及與該第一邏輯單元及該第二邏輯單元耦接之一多工器,以在一致能期間依一主控裝置輸出的一第一串列時鐘的控制,經由該串行輸出端傳送串列資料,該資料發送方法包含下列步驟:To achieve the above objective, the present invention further provides a slave device with a serial peripheral interface to implement a data transmission method. The slave device has a serial output terminal, a first logic unit, a second logic unit, and The first logic unit and the second logic unit are coupled to a multiplexer to transmit serial data through the serial output terminal under the control of a first serial clock output by a master control device during the unanimous period, The data sending method includes the following steps:

利用一第一邏輯單元依一系統時鐘進行一並行轉串列操作,該並行轉串列操作包括:檢測該第一串列時鐘之各發送沿以獲得一發送沿信號,所述發送沿係一上升沿或一下降沿;依該發送沿信號的控制對複數個位元組資料依序進行一串列移位元操作,並以一移位輸出端依序提供一個輸出位元資料;以及利用一第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料並經由一第一緩衝輸出端以提供一第一緩衝位元資料;A first logic unit is used to perform a parallel-to-serial operation based on a system clock. The parallel-to-serial operation includes: detecting each transmission edge of the first serial clock to obtain a transmission edge signal, and the transmission edge is a A rising edge or a falling edge; according to the control of the sending edge signal, a serial shift element operation is sequentially performed on a plurality of byte data, and an output bit data is sequentially provided by a shift output terminal; and using A first buffer unit is coupled to the shift element output terminal to temporarily store one of the output bit data and provide a first buffer bit data through a first buffer output terminal;

利用一第二邏輯單元依一第二串列時鐘對該移位元輸出端進行一位緩衝操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,該第二串列時鐘係該第一串列時鐘的同相或反相信號;以及A second logic unit is used to perform a bit buffer operation on the shift element output terminal according to a second serial clock, and a second buffer bit data is sequentially provided through a second buffer output terminal, wherein the second The serial clock is the in-phase or inverted signal of the first serial clock; and

利用一多工器在該致能期間內依一模式信號的控制,選擇將該第一緩衝輸出端耦接至所述串行輸出端,或將該第二緩衝輸出端耦接至所述串行輸出端。Use a multiplexer to select the first buffer output terminal to be coupled to the serial output terminal or the second buffer output terminal to be coupled to the serial output terminal under the control of a mode signal during the enabling period Line output terminal.

在一實施例中,當該模式信號呈現一第一模式時,該多工器係在該致能期間內的一初始時間之前選擇將該第一緩衝輸出端耦接至所述串行輸出端,及在該初始時間之後選擇將該第二緩衝輸出端耦接至所述串行輸出端。In one embodiment, when the mode signal presents a first mode, the multiplexer selects to couple the first buffer output terminal to the serial output terminal before an initial time in the enabling period , And choosing to couple the second buffer output terminal to the serial output terminal after the initial time.

在一實施例中,當該模式信號呈現一第二模式時,該多工器係在該致能期間內選擇將該第二緩衝輸出端耦接至所述串行輸出端。In one embodiment, when the mode signal presents a second mode, the multiplexer selects to couple the second buffer output terminal to the serial output terminal during the enabling period.

此外,本發明更揭露一種資訊處理裝置,其具有至少一個如前述之具有一序列周邊介面之從屬裝置。In addition, the present invention further discloses an information processing device, which has at least one slave device with a sequence of peripheral interfaces as described above.

為使  貴審查委員能進一步瞭解本發明之結構、特徵及其目的,茲附以圖式及較佳具體實施例之詳細說明如後。In order to enable your reviewer to further understand the structure, features and purpose of the present invention, drawings and detailed descriptions of preferred specific embodiments are attached as follows.

請參照圖3,其繪示本發明之資料發送方法之一實施例流程圖,其中,該資料發送方法係利用具有一序列周邊介面之一從屬裝置實現;該從屬裝置具有一系統時鐘SYSCLK;且該從屬裝置係在一致能期間,依一主控裝置輸出的一第一串列時鐘的控制以經由一串行輸出端傳送串列資料。Please refer to FIG. 3, which shows a flowchart of an embodiment of the data sending method of the present invention, wherein the data sending method is implemented by a slave device having a serial peripheral interface; the slave device has a system clock SYSCLK; and The slave device transmits serial data via a serial output terminal under the control of a first serial clock output by a master control device during the unanimous period.

如圖3所示,該實施例包括以下步驟:利用一第一邏輯單元依一系統時鐘進行一並行轉串列操作,並以一移位輸出端依序提供一個輸出位元資料,及利用一第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料並經由一第一緩衝輸出端以提供一第一緩衝位元資料 (步驟S302);利用一第二邏輯單元依一第二串列時鐘對該移位元輸出端進行一位緩衝操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,該第二串列時鐘係該第一串列時鐘的同相或反相信號(步驟S304);以及利用一多工器在該致能期間內依一模式信號的控制,選擇將該第一緩衝輸出端耦接至所述串行輸出端,或將該第二緩衝輸出端耦接至所述串行輸出端(步驟S306)。As shown in FIG. 3, this embodiment includes the following steps: using a first logic unit to perform a parallel-to-serial operation according to a system clock, and using a shift output terminal to sequentially provide an output bit data, and using a The first buffer unit is coupled to the shift element output terminal to temporarily store one of the output bit data and provide a first buffer bit data through a first buffer output terminal (step S302); use a second The logic unit performs a bit buffer operation on the shift element output terminal according to a second serial clock, and sequentially provides a second buffer bit data via a second buffer output terminal, wherein the second serial clock is The in-phase or inverted signal of the first serial clock (step S304); and using a multiplexer to select the first buffer output terminal to be coupled to the serial under the control of a mode signal during the enabling period Row output terminal, or couple the second buffer output terminal to the serial output terminal (step S306).

於步驟S302中,該並行轉串列操作包括:檢測該第一串列時鐘之各發送沿以獲得一發送沿信號,所述發送沿係一上升沿或一下降沿;依該發送沿信號的控制對複數個位元組資料依序進行一串列移位元操作,並以所述移位輸出端依序提供一個輸出位元資料;以及利用所述第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料,並經由所述第一緩衝輸出端提供所述第一緩衝位元資料。In step S302, the parallel-to-serial operation includes: detecting each transmission edge of the first serial clock to obtain a transmission edge signal, wherein the transmission edge is a rising edge or a falling edge; Control to sequentially perform a serial shift element operation on a plurality of byte data, and sequentially provide an output bit data with the shift output terminal; and use the first buffer unit and the shift element to output Terminal coupled to temporarily store one of the output bit data, and provide the first buffer bit data via the first buffer output terminal.

另外,於步驟S306中,當該模式信號呈現一第一模式時,該多工器係在該致能期間內的一初始時間之前選擇將該第一緩衝輸出端耦接至所述串行輸出端,及在該初始時間之後選擇將該第二緩衝輸出端耦接至所述串行輸出端;以及當該模式信號呈現一第二模式時,該多工器係在該致能期間內選擇將該第二緩衝輸出端耦接至所述串行輸出端。In addition, in step S306, when the mode signal presents a first mode, the multiplexer selects to couple the first buffer output terminal to the serial output before an initial time in the enabling period Terminal, and select to couple the second buffer output terminal to the serial output terminal after the initial time; and when the mode signal presents a second mode, the multiplexer selects during the enable period The second buffer output terminal is coupled to the serial output terminal.

詳細而言,請同時參考圖4及圖5,其中,圖4繪示本發明之從屬裝置之一實施例方塊圖;以及圖5繪示圖4之從屬裝置之一工作時序圖。In detail, please refer to FIG. 4 and FIG. 5 at the same time. FIG. 4 is a block diagram of an embodiment of the slave device of the present invention; and FIG. 5 is a working sequence diagram of the slave device of FIG. 4.

如圖4所示,一從屬裝置200包含:由一發送沿檢測模組210、一資料儲存模組220、一傳送邏輯模組230及一第一緩衝單元240所組成之一第一邏輯單元;由一第二緩衝單元250及一資料輸出選擇模組260所組成之一第二邏輯單元;一控制閘270;及一多工器280。As shown in FIG. 4, a slave device 200 includes: a first logic unit composed of a transmission edge detection module 210, a data storage module 220, a transmission logic module 230, and a first buffer unit 240; A second logic unit composed of a second buffer unit 250 and a data output selection module 260; a control gate 270; and a multiplexer 280.

在所述第一邏輯單元中,發送沿檢測模組210係用以自具有序列周邊介面之一主控裝置接收一串列時鐘SCLK,並檢測串列時鐘SCLK中的發送沿以獲得一發送沿信號SIG1,其中,所述發送沿可為一上升沿或一下降沿;傳送邏輯模組230係用以依發送沿信號SIG1的控制將資料儲存模組220所提供的位元組資料DATAOUT進行一串列移位元操作以在一移位輸出端依序提供一個輸出位元資料BITDATA;以及第一緩衝單元240係與該移位輸出端耦接,以暫存一個所述輸出位元資料BITDATA,並經由一第一緩衝輸出端提供一第一緩衝位元資料。In the first logic unit, the sending edge detection module 210 is used to receive a serial clock SCLK from a master control device having a serial peripheral interface, and detect the sending edge in the serial clock SCLK to obtain a sending edge Signal SIG1, wherein the sending edge can be a rising edge or a falling edge; the transmission logic module 230 is used to perform a byte data DATAOUT provided by the data storage module 220 under the control of the sending edge signal SIG1 The serial shift element is operated to sequentially provide one output bit data BITDATA to a shift output terminal; and the first buffer unit 240 is coupled to the shift output terminal to temporarily store one output bit data BITDATA , And provide a first buffer bit data through a first buffer output terminal.

在所述第二邏輯單元中,第二緩衝單元250係依一第二串列時鐘GSCLK對該移位元輸出端輸出的位元資料進行一位元緩衝操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,第二串列時鐘GSCLK係第一串列時鐘SCLK經控制閘270處理後的一時鐘信號,其係第一串列時鐘SCLK的同相或反相信號(由一模式信號MODE決定),且可由一致能信號CS致能或禁能;資料輸出選擇模組260係用以提供一選擇信號SEL以驅動多工器280,其中,當該模式信號MODE呈現一第一模式(模式0或2)時,該多工器280係在一致能期間(致能信號CS的作用期間)內的一初始時間之前選擇將該第一緩衝輸出端耦接至所述串行輸出端,及在該初始時間之後選擇將該第二緩衝輸出端耦接至所述串行輸出端,從而提供一串列資料信號MISO;當該模式信號MODE呈現一第二模式(模式1或3)時,該多工器280係在該致能期間內選擇將該第二緩衝輸出端耦接至所述串行輸出端,從而提供一串列資料信號MISO。In the second logic unit, the second buffer unit 250 performs a bit buffer operation on the bit data output from the shift element output terminal according to a second serial clock GSCLK, and passes through a second buffer output terminal Provide a second buffer bit data in sequence, where the second serial clock GSCLK is a clock signal processed by the control gate 270 of the first serial clock SCLK, which is the in-phase or inverted phase of the first serial clock SCLK Signal (determined by a mode signal MODE), and can be enabled or disabled by the enable signal CS; the data output selection module 260 is used to provide a selection signal SEL to drive the multiplexer 280, wherein, when the mode signal MODE When presenting a first mode (mode 0 or 2), the multiplexer 280 selects to couple the first buffer output terminal to all the first buffer output before an initial time in the unison period (the activation period of the enable signal CS) The serial output terminal, and after the initial time, choose to couple the second buffer output terminal to the serial output terminal, thereby providing a serial data signal MISO; when the mode signal MODE presents a second mode ( In mode 1 or 3), the multiplexer 280 selects to couple the second buffer output terminal to the serial output terminal during the enabling period to provide a serial data signal MISO.

另外,由圖5的模式0工作時序圖可看出,由於本發明將BITDATA設立時間移到發送沿之前,因此,與圖2的習知技術方案相比,本發明的技術方案乃可在發送沿和採樣沿之間提供較寬裕的時間比例給MISO建立時間,從而大幅降低系統時鐘/串列時鐘的頻率比例。In addition, it can be seen from the working sequence diagram of mode 0 in FIG. 5 that, because the present invention moves the BITDATA setup time before the sending edge, compared with the conventional technical solution in FIG. 2, the technical solution of the present invention can be used in sending Provide a generous time ratio between the edge and the sampling edge for the MISO setup time, thereby greatly reducing the frequency ratio of the system clock/serial clock.

另外,請參照表2及表3,其記錄了本發明與原方案(現有技術)的兩個比較結果。In addition, please refer to Table 2 and Table 3, which record two comparison results between the present invention and the original solution (prior art).

表2:SYSCLK為50MHz能支援的SPI SCLK最高頻率

Figure 107144342-A0304-0002
Table 2: SYSCLK is the highest frequency of SPI SCLK that 50MHz can support
Figure 107144342-A0304-0002

由表2可看出,同樣SYSCLK為50MHz,原方案支援SPI SCLK的最高頻率為6.25MHz,而本發明支援SPI SCLK的最高頻率可到16.6MHz。It can be seen from Table 2 that the same SYSCLK is 50MHz, the original solution supports the highest frequency of SPI SCLK is 6.25MHz, and the present invention supports the highest frequency of SPI SCLK to 16.6MHz.

表3:SPI SCLK為10MHz對SYSCLK的最低頻率要求

Figure 107144342-A0304-0003
Table 3: SPI SCLK is 10MHz minimum frequency requirement for SYSCLK
Figure 107144342-A0304-0003

同樣SPI SCLK為10MHz,原方案要求SYSCLK最低頻率為100MHz,本發明要求SYSCLK最低頻率為33MHz。Similarly, the SPI SCLK is 10 MHz, the original solution requires the minimum frequency of SYSCLK to be 100 MHz, and the present invention requires the minimum frequency of SYSCLK to be 33 MHz.

依上述的說明,本發明進一步提出一資訊處理裝置,其可藉由前述的從屬裝置實現其內部之至少一周邊裝置。Based on the above description, the present invention further provides an information processing device, which can realize at least one peripheral device inside the information processing device through the aforementioned slave device.

藉由前述所揭露的設計,本發明乃具有以下的優點:With the design disclosed above, the present invention has the following advantages:

1.可藉由內部高頻系統時鐘,根據檢測到的SPI串列時鐘發送沿,預先移位元準備好待發資料位元,以在SPI串列時鐘發送沿到來時即用該時鐘沿作用於推送觸發器,鎖存推送出該待發資料,並經選擇器選擇輸出。也就是說,藉由將發送資料的準備延遲轉移到了發送沿到來之前,發送資料在到達接收端的過程中只會有傳輸延遲(PAD/board delay),依此即可得到最寬鬆的發送資料建立時間,從而降低了高頻系統時鐘/SPI串列時鐘的頻率比例。1. With the internal high-frequency system clock, according to the detected SPI serial clock transmission edge, the pre-shift element prepares the data bits to be transmitted, so that the clock edge can be used when the SPI serial clock transmission edge arrives. In the push trigger, the data to be sent is latched and pushed, and output is selected by the selector. In other words, by shifting the preparation delay of sending data to before the arrival of the sending edge, the sending data will only have a PAD/board delay in the process of reaching the receiving end, so that the most relaxed sending data can be established. Time, thereby reducing the frequency ratio of the high-frequency system clock/SPI serial clock.

2.預先移位元準備待發資料是根據內部高頻系統時鐘檢測到的SPI串列時鐘發送沿進行的,其最大延遲時間為3個內部高頻系統時鐘週期,只要SPI串列時鐘的兩個發送沿間隔(即週期)大於3個內部高頻系統時鐘週期,用SPI串列時鐘的發送沿(按模式變換為推送時鐘)直接鎖存推送內部高頻系統時鐘預先移位元準備好的待發資料,就足以滿足推送觸發器的建立時間和保持時間要求,而可確保資料的正確發送。2. The pre-shift element prepares the data to be sent based on the transmission edge of the SPI serial clock detected by the internal high-frequency system clock. The maximum delay time is 3 cycles of the internal high-frequency system clock. A sending edge interval (that is, period) is greater than 3 internal high-frequency system clock cycles, and the sending edge of the SPI serial clock (converted to the push clock according to the mode) is used to directly latch and push the internal high-frequency system clock. The data to be sent is sufficient to meet the requirements of the establishment time and hold time of the push trigger, and ensure the correct delivery of the data.

3. 用內部高頻系統時鐘操作存儲模組,解決了SPI傳輸開始前無SPI串列時鐘情況下第一位元資料讀取、準備、發送的問題,以及記憶體模組在無SPI串列時鐘期間的操控問題(如清空、同步等)。3. Use the internal high-frequency system clock to operate the memory module, which solves the problem of reading, preparing, and sending the first bit data when there is no SPI serial clock before the SPI transmission starts, and the memory module does not have SPI serial Manipulation issues during the clock (such as clearing, synchronization, etc.).

4.增加第一位元資料鎖存模組,解決了SPI模式0/2第一位資料在第一個SPI串列時鐘發送沿之前發送的問題,且第一位元資料鎖存模組只用一個觸發器,開銷極小。4. Add the first bit data latch module to solve the problem that the first bit data of SPI mode 0/2 is sent before the first SPI serial clock transmission edge, and the first bit data latch module only With a trigger, the overhead is minimal.

5.增加移位元中繼資料鎖存推送模組,確保了每位元發送資料在每個SPI串列時鐘發送沿之後才發送出該發送資料位元,保證了發送資料在接收端的保持時間(hold time),確保了資料發送不至於錯位,且移位中繼資料鎖存推送模組只用一個觸發器,開銷極小。5. Increase the shift element relay data latch push module to ensure that each bit of the transmitted data is sent out after each SPI serial clock transmission edge, which ensures the retention time of the transmitted data at the receiving end (Hold time), to ensure that the data transmission will not be misaligned, and the shift relay data latch push module only uses one trigger, and the overhead is very small.

6.增加了選擇信號生成模組和資料選擇模組,確保了SPI模式0/2第一位元資料與移位元中繼資料位元的正確輸出,以及SPI模式1/3選擇移位中繼資料位元輸出。6. The selection signal generation module and the data selection module have been added to ensure the correct output of the first bit data of the SPI mode 0/2 and the bit of the shift element relay data, and the selection shift of the SPI mode 1/3 Following the data bit output.

本案所揭示者,乃較佳實施例,舉凡局部之變更或修飾而源於本案之技術思想而為熟習該項技藝之人所易於推知者,俱不脫本案之專利權範疇。The disclosure in this case is a preferred embodiment, and any partial changes or modifications that are derived from the technical ideas of the case and can be easily inferred by those familiar with the art will not deviate from the scope of the patent right of the case.

綜上所陳,本案無論目的、手段與功效,皆顯示其迥異于習知技術,且其首先發明合於實用,確實符合發明之專利要件,懇請  貴審查委員明察,並早日賜予專利俾嘉惠社會,是為至禱。To sum up, regardless of the purpose, means and effect of this case, it is shown that it is very different from the conventional technology, and its first invention is suitable for practicality, and it does meet the patent requirements of the invention. Please check it out and grant the patent as soon as possible. Society is for the best prayer.

100:從屬裝置110:發送沿檢測模組120:資料儲存模組130:傳送邏輯模組200:從屬裝置210:發送沿檢測模組220:資料儲存模組230:傳送邏輯模組240:第一緩衝單元250:第二緩衝單元260:資料輸出選擇模組270:控制閘280:多工器步驟S302:利用一第一邏輯單元依一系統時鐘進行一並行轉串列操作,該並行轉串列操作包括:檢測該第一串列時鐘之各發送沿以獲得一發送沿信號,所述發送沿係一上升沿或一下降沿;依該發送沿信號的控制對複數個位元組資料依序進行一串列移位元操作,並以一移位輸出端依序提供一個輸出位元資料;以及利用一第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料並經由一第一緩衝輸出端以提供一第一緩衝位元資料步驟S304:利用一第二邏輯單元依一第二串列時鐘對該移位元輸出端進行一位緩衝操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,該第二串列時鐘係該第一串列時鐘的同相或反相信號步驟S306:利用一多工器在該致能期間內依一模式信號的控制,選擇將該第一緩衝輸出端耦接至所述串列輸出端,或將該第二緩衝輸出端耦接至所述串列輸出端100: Slave device 110: Sending edge detection module 120: Data storage module 130: Transmission logic module 200: Slave device 210: Sending edge detection module 220: Data storage module 230: Transmission logic module 240: First Buffer unit 250: Second buffer unit 260: Data output selection module 270: Control gate 280: Multiplexer Step S302: Use a first logic unit to perform a parallel-to-serial operation according to a system clock, the parallel-to-serial The operation includes: detecting each sending edge of the first serial clock to obtain a sending edge signal, the sending edge being a rising edge or a falling edge; according to the control of the sending edge signal, a plurality of byte data are sequentially processed Perform a serial shift element operation, and sequentially provide an output bit data with a shift output terminal; and use a first buffer unit to couple with the shift element output terminal to temporarily store one output bit Metadata and provide a first buffer bit data through a first buffer output terminal. Step S304: Use a second logic unit to perform a bit buffer operation on the shift element output terminal according to a second serial clock, and pass A second buffer output terminal sequentially provides a second buffer bit data, wherein the second serial clock is the in-phase or inverted signal of the first serial clock. Step S306: Use a multiplexer to enable During the period, according to the control of a mode signal, it is selected to couple the first buffer output terminal to the serial output terminal, or to couple the second buffer output terminal to the serial output terminal

圖1繪示現有技術之從屬裝置之示意圖; 圖2繪示圖1之從屬裝置之一工作時序圖; 圖3繪示本發明之資料發送方法之一實施例流程圖; 圖4繪示本發明之從屬裝置之一實施例方塊圖;以及 圖5繪示圖4之從屬裝置之一工作時序圖。Fig. 1 shows a schematic diagram of a slave device in the prior art; Fig. 2 shows a working sequence diagram of a slave device in Fig. 1; Fig. 3 shows a flowchart of an embodiment of the data sending method of the present invention; Fig. 4 shows the present invention A block diagram of an embodiment of the slave device; and FIG. 5 shows a working sequence diagram of the slave device of FIG. 4.

步驟S302:利用一第一邏輯單元依一系統時鐘進行一並行轉串列操作,該並行轉串列操作包括:檢測該第一串列時鐘之各發送沿以獲得一發送沿信號,所述發送沿係一上升沿或一下降沿;依該發送沿信號的控制對複數個位元組資料依序進行一串列移位元操作,並以一移位輸出端依序提供一個輸出位元資料;以及利用一第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料並經由一第一緩衝輸出端以提供一第一緩衝位元資料 Step S302: Use a first logic unit to perform a parallel-to-serial operation according to a system clock. The parallel-to-serial operation includes: detecting each transmission edge of the first serial clock to obtain a transmission edge signal, the transmission The edge is a rising edge or a falling edge; according to the control of the sending edge signal, a serial shift element operation is sequentially performed on a plurality of byte data, and an output bit data is sequentially provided with a shift output terminal And using a first buffer unit coupled to the output end of the shift element to temporarily store one of the output bit data and provide a first buffer bit data via a first buffer output end

步驟S304:利用一第二邏輯單元依一第二串列時鐘對該移位元輸出端進行一位緩衝操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,該第二串列時鐘係該第一串列時鐘的同相或反相信號 Step S304: Use a second logic unit to perform a bit buffer operation on the shift element output terminal according to a second serial clock, and sequentially provide a second buffer bit data through a second buffer output terminal, wherein, The second serial clock is the in-phase or inverted signal of the first serial clock

步驟S306:利用一多工器在該致能期間內依一模式信號的控制,選擇將該第一緩衝輸出端耦接至所述串列輸出端,或將該第二緩衝輸出端耦接至所述串列輸出端 Step S306: Use a multiplexer to select whether to couple the first buffer output terminal to the serial output terminal or to couple the second buffer output terminal to the serial output terminal under the control of a mode signal during the enabling period The serial output

Claims (7)

一種資料發送方法,其係利用具有一序列周邊介面之一從 屬裝置實現,該從屬裝置係在一致能期間,依一主控裝置輸出的一第一串列時鐘的控制以經由一串行輸出端傳送串列資料,該資料發送方法包含下列步驟: 利用一第一邏輯單元依一系統時鐘進行一並行轉串列操作,該並行轉串列操作包括:檢測該第一串列時鐘之各發送沿以獲得一發送沿信號,所述發送沿係一上升沿或一下降沿;依該發送沿信號的控制對複數個位元組資料依序進行一串列移位元操作,並以一移位輸出端依序提供一個輸出位元資料;以及利用一第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料並經由一第一緩衝輸出端以提供一第一緩衝位元資料; 利用一第二邏輯單元依一第二串列時鐘對該移位元輸出端進行一位緩衝操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,該第二串列時鐘係該第一串列時鐘的同相或反相信號;以及 利用一多工器在該致能期間內依一模式信號的控制,選擇將該第一緩衝輸出端耦接至所述串行輸出端,或將該第二緩衝輸出端耦接至所述串行輸出端。A data transmission method is realized by using a slave device with a serial peripheral interface. The slave device is controlled by a first serial clock output by a master control device during a consistent energy period through a serial output terminal To transmit serial data, the data sending method includes the following steps: A first logic unit is used to perform a parallel-to-serial operation according to a system clock, and the parallel-to-serial operation includes: detecting each transmission edge of the first serial clock To obtain a sending edge signal, the sending edge is a rising edge or a falling edge; according to the control of the sending edge signal, a series of shift element operations are sequentially performed on a plurality of byte data, and a shift is performed The output terminal sequentially provides an output bit data; and a first buffer unit is used to couple the shift element output terminal to temporarily store one of the output bit data and provide a second output bit data through a first buffer output terminal A buffer bit data; a second logic unit is used to perform a bit buffer operation on the shift element output terminal according to a second serial clock, and a second buffer bit data is sequentially provided through a second buffer output terminal , Wherein the second serial clock is the in-phase or inverted signal of the first serial clock; and a multiplexer is used to select the first buffer output terminal under the control of a mode signal during the enabling period Is coupled to the serial output terminal, or the second buffer output terminal is coupled to the serial output terminal. 如請求項1所述之資料發送方法,其中,當該模式信號呈 現一第一模式時,該多工器係在該致能期間內的一初始時間之前選擇將該第一緩衝輸出端耦接至所述串行輸出端,及在該初始時間之後選擇將該第二緩衝輸出端耦接至所述串行輸出端。The data transmission method according to claim 1, wherein when the mode signal presents a first mode, the multiplexer selects to couple the first buffer output terminal before an initial time in the enabling period To the serial output terminal, and select to couple the second buffer output terminal to the serial output terminal after the initial time. 如請求項1所述之資料發送方法,其中,當該模式信號呈 現一第二模式時,該多工器係在該致能期間內選擇將該第二緩衝輸出端耦接至所述串行輸出端。The data transmission method according to claim 1, wherein when the mode signal presents a second mode, the multiplexer selects to couple the second buffer output terminal to the serial port during the enabling period The output terminal. 一種具有一序列周邊介面之從屬裝置,用以實現一資料發 送方法,該從屬裝置具有一串行輸出端、一第一邏輯單元、一第二邏輯單元及與該第一邏輯單元及該第二邏輯單元耦接之一多工器,以在一致能期間依一主控裝置輸出的一第一串列時鐘的控制,經由該串行輸出端傳送串列資料,該資料發送方法包含下列步驟: 利用一第一邏輯單元依一系統時鐘進行一並行轉串列操作,該並行轉串列 操作包括:檢測該第一串列時鐘之各發送沿以獲得一發送沿信號,所述發送沿係一上升沿或一下降沿;依該發送沿信號的控制對複數個位元組資料依序進行一串列移位元操作,並以一移位輸出端依序提供一個輸出位元資料;以及利用一第一緩衝單元與該移位元輸出端耦接,以暫存一個所述輸出位元資料並經由一第一緩衝輸出端以提供一第一緩衝位元資料; 利用一第二邏輯單元依一第二串列時鐘對該移位元輸出端進行一位緩衝 操作,並經由一第二緩衝輸出端依序提供一第二緩衝位元資料,其中,該第二串列時鐘係該第一串列時鐘的同相或反相信號;以及         利用一多工器在該致能期間內依一模式信號的控制,選擇將該第一緩衝輸出端耦接至所述串行輸出端,或將該第二緩衝輸出端耦接至所述串行輸出端。A slave device with a serial peripheral interface for realizing a data transmission method. The slave device has a serial output terminal, a first logic unit, a second logic unit, and the first logic unit and the second logic unit. The logic unit is coupled to a multiplexer to transmit serial data through the serial output terminal under the control of a first serial clock output by a master control device during the unanimous period. The data transmission method includes the following steps: A first logic unit is used to perform a parallel-to-serial operation based on a system clock. The parallel-to-serial operation includes: detecting each transmission edge of the first serial clock to obtain a transmission edge signal, and the transmission edge is a A rising edge or a falling edge; according to the control of the sending edge signal, a serial shift element operation is sequentially performed on a plurality of byte data, and an output bit data is sequentially provided by a shift output terminal; and using A first buffer unit is coupled to the shift element output terminal to temporarily store one of the output bit data and provide a first buffer bit data through a first buffer output terminal; a second logic unit is used according to A second serial clock performs a bit buffer operation on the shift element output terminal, and sequentially provides a second buffer bit data through a second buffer output terminal, wherein the second serial clock is the first The in-phase or inverted signal of the serial clock; and the use of a multiplexer in the enabling period under the control of a mode signal to select whether the first buffer output terminal is coupled to the serial output terminal, or the The second buffer output terminal is coupled to the serial output terminal. 如請求項4所述之具有一序列周邊介面之從屬裝置,其 中,當該模式信號呈現一第一模式時,該多工器係在該致能期間內的一初始時間之前選擇將該第一緩衝輸出端耦接至所述串行輸出端,及在該初始時間之後選擇將該第二緩衝輸出端耦接至所述串行輸出端。The slave device with a sequence of peripheral interfaces according to claim 4, wherein, when the mode signal presents a first mode, the multiplexer selects the first mode before an initial time in the enable period The buffer output terminal is coupled to the serial output terminal, and the second buffer output terminal is selected to be coupled to the serial output terminal after the initial time. 如請求項4所述之具有一序列周邊介面之從屬裝置,其 中,當該模式信號呈現一第二模式時,該多工器係在該致能期間內選擇將該第二緩衝輸出端耦接至所述串行輸出端The slave device with a serial peripheral interface as described in claim 4, wherein, when the mode signal presents a second mode, the multiplexer selects to couple the second buffer output terminal during the enabling period To the serial output 一種資訊處理裝置,其具有至少一個如申請專利範圍第4-6 項中任一項所述之具有一序列周邊介面之從屬裝置。An information processing device, which has at least one slave device with a sequence of peripheral interfaces as described in any one of items 4-6 of the scope of patent application.
TW107144342A 2018-12-10 2018-12-10 Data transmission method, slave device with serial peripheral interface and information processing device TWI687815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW107144342A TWI687815B (en) 2018-12-10 2018-12-10 Data transmission method, slave device with serial peripheral interface and information processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW107144342A TWI687815B (en) 2018-12-10 2018-12-10 Data transmission method, slave device with serial peripheral interface and information processing device

Publications (2)

Publication Number Publication Date
TWI687815B TWI687815B (en) 2020-03-11
TW202022625A true TW202022625A (en) 2020-06-16

Family

ID=70766846

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107144342A TWI687815B (en) 2018-12-10 2018-12-10 Data transmission method, slave device with serial peripheral interface and information processing device

Country Status (1)

Country Link
TW (1) TWI687815B (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8429329B2 (en) * 2007-10-17 2013-04-23 Micron Technology, Inc. Serial interface NAND
US8341330B2 (en) * 2008-01-07 2012-12-25 Macronix International Co., Ltd. Method and system for enhanced read performance in serial peripheral interface
US8909841B2 (en) * 2012-10-04 2014-12-09 Linear Technology Corporation Configurable serial interface
US9356567B2 (en) * 2013-03-08 2016-05-31 Invensense, Inc. Integrated audio amplification circuit with multi-functional external terminals
CN104714908B (en) * 2013-12-13 2017-12-19 上海华虹集成电路有限责任公司 Support the SPI interface of master slave mode
US9582441B2 (en) * 2014-02-27 2017-02-28 Infineon Technologies Ag Clockless serial slave device
US10077472B2 (en) * 2014-12-18 2018-09-18 Life Technologies Corporation High data rate integrated circuit with power management

Also Published As

Publication number Publication date
TWI687815B (en) 2020-03-11

Similar Documents

Publication Publication Date Title
WO2020118950A1 (en) Slave device for serial communications, and method
CN101599053B (en) Serial interface controller supporting multiple transport protocols and control method
US7058799B2 (en) Apparatus and method for clock domain crossing with integrated decode
US20060153326A1 (en) Serial data communication apparatus and methods of using a single line
US8520464B2 (en) Interface circuit and semiconductor device incorporating same
KR20090061515A (en) High performance wrapper circuit for globally asynchronous locally synchronous system
JPH0678019A (en) Interface device
US7882474B2 (en) Testing phase error of multiple on-die clocks
US7793021B2 (en) Method for synchronizing a transmission of information and a device having synchronizing capabilities
TW201407175A (en) Circuit test system and circuit test method thereof
TW202022625A (en) Data transmission method, slave device with serial peripheral interface and data processing device wherein the data transmission method further includes performing a parallel-to-serial operation
TWI644218B (en) Controller-phy connection using intra-chip serdes
JP2017531942A (en) Clock-free dual data rate link with built-in flow control
US20080168200A1 (en) Method of compensating for propagation delay of tri-state bidirectional bus in a semiconductor device
US10170166B1 (en) Data transmission apparatus for memory and data transmission method thereof
JP2007312321A (en) Semiconductor integrated circuit for serial/parallel conversion
US9378175B2 (en) Data transfer between a master and slave
US9191182B2 (en) Data transmission method and associated signal transmitter
KR101987304B1 (en) Semiconductor Memory Apparatus
CN111435340B (en) Internet bus unit, data transmission method, wishbone Internet module and chip
US7526017B2 (en) Transmitting device, receiving device, transmission system, and transmission method
TWI739294B (en) Signal transceiving system and method
JP2010141703A (en) Circuit and method for transmitting parallel data
CN108932210B (en) Data transmission device and data receiving device of serial peripheral interface
JP2006221348A (en) Serial data transfer device and serial transfer system