TWI762900B - Electrical device and communication method - Google Patents

Electrical device and communication method Download PDF

Info

Publication number
TWI762900B
TWI762900B TW109111652A TW109111652A TWI762900B TW I762900 B TWI762900 B TW I762900B TW 109111652 A TW109111652 A TW 109111652A TW 109111652 A TW109111652 A TW 109111652A TW I762900 B TWI762900 B TW I762900B
Authority
TW
Taiwan
Prior art keywords
electronic device
address
data
procedure
addresses
Prior art date
Application number
TW109111652A
Other languages
Chinese (zh)
Other versions
TW202132981A (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 瑞昱半導體股份有限公司
Publication of TW202132981A publication Critical patent/TW202132981A/en
Application granted granted Critical
Publication of TWI762900B publication Critical patent/TWI762900B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4291Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Systems (AREA)

Abstract

An electrical device is coupled to another electrical device via a communication interface. The electrical device executes a writing process to the another electrical device via the communication interface. If a writing failure occurs, the electrical device establishes a related address list associated with the writing process, verifies multiple related addresses in the related address list, and executes the writing process again.

Description

電子裝置以及通訊方法 Electronic device and communication method

本案中所述實施例內容是有關於一種通訊技術,特別關於一種電子裝置以及通訊方法。 The content of the embodiments described in this case relates to a communication technology, especially an electronic device and a communication method.

隨著通訊技術的發展,兩電子裝置之間可透過各種通訊介面進行訊號傳輸。然而,基於一些因素,訊號傳輸的過程可能會發生干擾。這些干擾會影響到訊號的正確性。倘若所傳輸的訊號或所接收到的訊號不正確,將會使得系統異常運作。 With the development of communication technology, signals can be transmitted between two electronic devices through various communication interfaces. However, due to some factors, the process of signal transmission may be disturbed. These disturbances can affect the correctness of the signal. If the transmitted signal or the received signal is incorrect, the system will function abnormally.

本案之一些實施方式是關於一種電子裝置。電子裝置透過一通訊介面耦接一另一電子裝置。電子裝置透過通訊介面對另一電子裝置執行一寫入程序。若一寫入失敗發生,電子裝置建立相關於寫入程序的一相關位址列表,校驗相關位址列表中的複數相關位址,且重新執行寫入程序。 Some embodiments of the present case relate to an electronic device. The electronic device is coupled to another electronic device through a communication interface. The electronic device executes a writing program to another electronic device through the communication interface. If a write failure occurs, the electronic device creates a related address list related to the write process, verifies the plural related addresses in the related address list, and re-executes the write process.

本案之一些實施方式是關於一種通訊方法。通訊方法包含:藉由一電子裝置透過一通訊介面對一另一電子裝置執行一寫入程序;若一寫入失敗發生,藉由電子裝置建立相關於寫入程序的一相關位址列表;以及藉由電子裝置校驗相關位址列表中的複數相關位址,且重新執行寫入程序。 Some embodiments of the present case relate to a method of communication. The communication method includes: executing a writing procedure by an electronic device to another electronic device through a communication interface; if a writing failure occurs, establishing a relevant address list related to the writing procedure by the electronic device; and The plurality of related addresses in the related address list are checked by the electronic device, and the writing procedure is re-executed.

綜上所述,本案的電子裝置以及通訊方法,可利用軟體方式進行校驗,且優先校驗相關位址列表中的相關位址。相較於校驗所有位址,本案的電子裝置以及通訊方法可縮短校驗時間,且不需更動硬體架構。 To sum up, the electronic device and the communication method in this case can be verified by software, and the related addresses in the related address list can be checked first. Compared with verifying all addresses, the electronic device and communication method of the present application can shorten the verification time without changing the hardware structure.

100:通訊系統 100: Communication System

700:通訊方法 700: Communication method

E1:電子裝置 E1: Electronic device

E2:電子裝置 E2: Electronic Devices

IF:通訊介面 IF: communication interface

CS:選擇訊號 CS: select signal

SCLK:時脈訊號 SCLK: clock signal

SI:輸入資料 SI: input data

SO:輸出資料 SO: output data

CM1:指令 CM1: Command

CM2:指令 CM2: Command

AD1:位址 AD1: address

AD2:位址 AD2: address

DATA1:資料 DATA1: data

DATA2:資料 DATA2: data

S410:操作 S410: Operation

S420:操作 S420: Operation

S510:操作 S510: Operation

S520:操作 S520: Operation

S530:操作 S530: Operation

S540:操作 S540: Operation

S550:操作 S550: Operation

S610:操作 S610: Operation

S620:操作 S620: Operation

S630:操作 S630: Operation

S640:操作 S640: Operation

S710:操作 S710: Operation

S720:操作 S720: Operation

S730:操作 S730: Operation

為讓本案之上述和其他目的、特徵、優點與實施例能夠更明顯易懂,所附圖式之說明如下: In order to make the above and other objects, features, advantages and embodiments of the present case more clearly understood, the accompanying drawings are described as follows:

第1圖是依照本案一些實施例所繪示的一通訊系統的示意圖; FIG. 1 is a schematic diagram of a communication system according to some embodiments of the present application;

第2圖是依照本案一些實施例所繪示的一讀取程序的示意圖; FIG. 2 is a schematic diagram of a reading process according to some embodiments of the present application;

第3圖是依照本案一些實施例所繪示的一寫入程序的示意圖; FIG. 3 is a schematic diagram of a writing process according to some embodiments of the present application;

第4圖依照本案一些實施例所繪示的校驗讀取程序的流程圖; FIG. 4 is a flowchart of a verification reading procedure according to some embodiments of the present application;

第5圖依照本案一些實施例所繪示的校驗寫入程序的流程圖; FIG. 5 is a flowchart of a verification writing procedure according to some embodiments of the present application;

第6圖是依照本案一些實施例所繪示的一反相程序的流程圖;以及 FIG. 6 is a flowchart of an inversion process according to some embodiments of the present application; and

第7圖是依照本案一些實施例所繪示的一通訊方法的流程圖。 FIG. 7 is a flowchart of a communication method according to some embodiments of the present application.

在本文中所使用的用詞『耦接』亦可指『電性耦接』,且用詞『連接』亦可指『電性連接』。『耦接』及『連接』亦可指二個或多個元件相互配合或相互互動。 As used herein, the term "coupled" may also refer to "electrically coupled," and the term "connected" may also refer to "electrically connected." "Coupled" and "connected" may also refer to two or more elements cooperating or interacting with each other.

參考第1圖。第1圖是依照本案一些實施例所繪示的通訊系統100的示意圖。以第1圖示例而言,通訊系統100包含電子裝置E1以及電子裝置E2。 Refer to Figure 1. FIG. 1 is a schematic diagram of a communication system 100 according to some embodiments of the present application. In the example of FIG. 1, the communication system 100 includes an electronic device E1 and an electronic device E2.

在一些實施例中,電子裝置E1為主(master)設備,而電子裝置E2為從(slave)設備。電子裝置E1可透過通訊介面IF耦接電子裝置E2,以與電子裝置E2通訊連接。據此,電子裝置E1可透過通訊介面IF與電子裝置E2進行溝通。舉例而言,電子裝置E1可透過通訊介面IF對電子裝置E2執行讀取程序或寫入程序。也就是說,電子裝置E1可透過通訊介面IF將資料寫入電子裝置E2或讀取電子裝置E2中的資料。在一些實施例中,電子裝置E2可為複數個,且電子裝置E1透過通訊介面IF耦接該些電子裝置E2。 In some embodiments, electronic device E1 is a master device and electronic device E2 is a slave device. The electronic device E1 can be coupled to the electronic device E2 through the communication interface IF to communicate with the electronic device E2. Accordingly, the electronic device E1 can communicate with the electronic device E2 through the communication interface IF. For example, the electronic device E1 can execute a reading process or a writing process on the electronic device E2 through the communication interface IF. That is, the electronic device E1 can write data into the electronic device E2 or read data in the electronic device E2 through the communication interface IF. In some embodiments, the electronic devices E2 may be plural, and the electronic devices E1 are coupled to the electronic devices E2 through the communication interface IF.

在一些實施例中,通訊介面IF可由序列外設介面(Serial Peripheral Interface,SPI)實現,且電子裝置E1以及電子裝置E2可由序列外設介面設備實現。由於序 列外設介面技術僅占用四個訊號線,因此採用序列外設介面技術,可節省晶片面積。 In some embodiments, the communication interface IF can be implemented by a serial peripheral interface (SPI), and the electronic device E1 and the electronic device E2 can be implemented by a serial peripheral interface device. due to the order The column peripheral interface technology only occupies four signal lines, so the use of the serial peripheral interface technology can save the chip area.

第2圖是依照本案一些實施例所繪示的一讀取程序的示意圖。如前所述,序列外設介面晶片僅占用四個訊號線。據此,電子裝置E1(或電子裝置E2)可包含四個訊號接腳(pin)。一為選擇接腳,用以接收選擇訊號CS。一為時脈接腳,用以接收時脈訊號SCLK。一為資料輸入接腳,用以接收輸入資料SI。一為資料輸出接腳,用以將輸出資料SO輸出。 FIG. 2 is a schematic diagram of a reading process according to some embodiments of the present application. As mentioned earlier, the serial peripheral interface chip occupies only four signal lines. Accordingly, the electronic device E1 (or the electronic device E2 ) may include four signal pins. One is a selection pin for receiving the selection signal CS. One is a clock pin for receiving the clock signal SCLK. One is a data input pin for receiving input data SI. One is the data output pin, which is used to output the output data SO.

在一些實施例中,當電子裝置E1耦接複數個電子裝置E2時,而選擇訊號CS可用以決定哪個電子裝置E2被選中且電子裝置E1可與此被選中電子裝置E2進行訊號傳輸。以第2圖示例而言,若第2圖所繪示的是其中一電子裝置E2的四個訊號接腳的訊號,當選擇訊號CS具有低邏輯位準時,代表此電子裝置E2被選中。輸入資料SI為此電子裝置E2所接收到的資料。輸出資料SO為此電子裝置E2所輸出的資料。時脈訊號SCLK用以控制資料的接收/傳輸。舉例而言,此電子裝置E2所接收的輸入資料SI可在時脈訊號SCLK的上升邊緣(rising edge)或下降邊緣(falling edge)被接收,或此電子裝置E2所輸出的輸出資料SO可在時脈訊號SCLK的上升邊緣或下降邊緣被輸出。 In some embodiments, when the electronic device E1 is coupled to a plurality of electronic devices E2, the selection signal CS can be used to determine which electronic device E2 is selected and the electronic device E1 can perform signal transmission with the selected electronic device E2. Taking the example of Figure 2 as an example, if Figure 2 shows the signals of the four signal pins of one of the electronic devices E2, when the selection signal CS has a low logic level, it means that the electronic device E2 is selected . The input data SI is the data received by this electronic device E2. The output data SO is the data output by the electronic device E2. The clock signal SCLK is used to control the reception/transmission of data. For example, the input data SI received by the electronic device E2 may be received at the rising edge or the falling edge of the clock signal SCLK, or the output data SO output by the electronic device E2 may be at The rising edge or falling edge of the clock signal SCLK is output.

以第2圖示例而言,若電子裝置E1執行讀取程序,電子裝置E1會將輸入訊號SI輸出給電子裝置E2。輸入訊號SI包含指令CM1(0x01)以及位址AD1。據此,電子裝 置E2可依據指令CM1以及位址AD1將相應於位址AD1的資料DATA1輸出給電子裝置E1,以完成電子裝置E1所執行的讀取程序。 Taking the example of FIG. 2 as an example, if the electronic device E1 executes the reading procedure, the electronic device E1 will output the input signal SI to the electronic device E2. The input signal SI includes the command CM1 (0x01) and the address AD1. Accordingly, electronic equipment The setting E2 can output the data DATA1 corresponding to the address AD1 to the electronic device E1 according to the command CM1 and the address AD1, so as to complete the reading procedure executed by the electronic device E1.

參考第3圖。第3圖是依照本案一些實施例所繪示的一寫入程序的示意圖。 Refer to Figure 3. FIG. 3 is a schematic diagram of a writing process according to some embodiments of the present application.

以第3圖示例而言,若電子裝置E1執行寫入程序,電子裝置E1會將輸入訊號SI輸出給電子裝置E2。輸入訊號SI包含指令CM2(0x02)、位址AD2以及資料DATA2。據此,依據指令CM2,來自電子裝置E1的資料DATA2將寫入電子裝置E2的位址AD2,以完成電子裝置E1所執行的寫入程序。 Taking the example of FIG. 3 as an example, if the electronic device E1 executes the writing procedure, the electronic device E1 will output the input signal SI to the electronic device E2. The input signal SI includes the command CM2 (0x02), the address AD2 and the data DATA2. Accordingly, according to the command CM2, the data DATA2 from the electronic device E1 will be written into the address AD2 of the electronic device E2, so as to complete the writing procedure executed by the electronic device E1.

然而,在訊號傳輸過程中,可能會因為干擾使得訊號發生改變。在這個情況下,通訊系統100可能會異常運作。 However, during the signal transmission process, the signal may be changed due to interference. In this case, the communication system 100 may operate abnormally.

一併參考第2圖以及第4圖。第4圖依照本案一些實施例所繪示的校驗讀取程序的流程圖。在讀取過程中,若指令CM1、位址AD1或資料DATA1的電位發生改變,可能會造成讀取到的資料錯誤。針對此,本案的通訊系統100可利用軟體的方式校驗讀取程序。 Refer to Fig. 2 and Fig. 4 together. FIG. 4 is a flow chart of a verification reading procedure according to some embodiments of the present application. During the reading process, if the potential of the command CM1, the address AD1 or the data DATA1 changes, the read data may be wrong. In view of this, the communication system 100 of the present case can verify the reading program by means of software.

在操作S410中,電子裝置E1對電子裝置E2執行讀取程序,以分別於兩個時間點讀取電子裝置E2的位址AD1中的已寫入資料。 In operation S410, the electronic device E1 executes a reading procedure on the electronic device E2 to read the written data in the address AD1 of the electronic device E2 at two time points respectively.

在操作S420中,判斷於第一時間點以及第二時間點所分別讀取到的兩讀取資料是否相同,以判斷讀取程序 是否成功。舉例而言,若兩時間點的讀取資料相同,代表讀取程序成功。若兩時間點的讀取資料不相同,代表讀取程序失敗。在讀取程序失敗的情況下,將再次進入操作S410以重新執行讀取程序。也就是說,電子裝置E1會分別於再接下來的兩個時間點再次讀取電子裝置E2的位址AD1的已寫入資料。接著,再次進入操作S420。 In operation S420, it is determined whether the two read data respectively read at the first time point and the second time point are the same, so as to determine the read procedure whether succeed. For example, if the read data at the two time points are the same, the read procedure is successful. If the read data at the two time points are different, it means that the read procedure fails. In the case that the reading procedure fails, operation S410 will be entered again to re-execute the reading procedure. That is to say, the electronic device E1 will read the written data of the address AD1 of the electronic device E2 again at the next two time points respectively. Next, enter operation S420 again.

一併參考第3圖以及第5圖。第5圖依照本案一些實施例所繪示的校驗寫入程序的流程圖。在寫入取過程中,若指令CM2或資料DATA2的電位發生改變,可能會造成寫入的資料錯誤。若位址AD2的電位發生改變,可能會造成將資料寫入錯誤的位址。針對此,本案的通訊系統100可利用軟體的方式校驗寫入程序。 Refer to Fig. 3 and Fig. 5 together. FIG. 5 is a flowchart of a verification writing procedure according to some embodiments of the present application. In the process of writing and reading, if the electric potential of the command CM2 or the data DATA2 changes, the written data may be wrong. If the potential of the address AD2 changes, it may cause data to be written to the wrong address. In view of this, the communication system 100 of the present application can verify the writing program by means of software.

在操作S510中,電子裝置E1將指令CM2、位址AD2以及預設要寫入的資料DATA2傳送至電子裝置E2。基於指令CM2,預設要寫入的資料DATA2被寫入電子裝置E2的位址AD2。 In operation S510, the electronic device E1 transmits the command CM2, the address AD2 and the preset data DATA2 to be written to the electronic device E2. Based on the command CM2, the predetermined data DATA2 to be written is written to the address AD2 of the electronic device E2.

在操作S520中,電子裝置E1判斷是否寫入成功。舉例而言,電子裝置E1讀取位址AD2中的已寫入資料,且判斷已寫入資料是否相同於預設要寫入的資料DATA2。若位址AD2中的已寫入資料相同於預設要寫入的資料DATA2,判斷寫入成功。在這個情況下,寫入程序結束。若位址AD2中的已寫入資料相異於預設要寫入的資料DATA2,判斷寫入失敗。在這個情況下,進入操作S530。 In operation S520, the electronic device E1 determines whether the writing is successful. For example, the electronic device E1 reads the written data in the address AD2, and determines whether the written data is the same as the preset data DATA2 to be written. If the written data in the address AD2 is the same as the preset data DATA2 to be written, it is judged that the writing is successful. In this case, the writing procedure ends. If the written data in the address AD2 is different from the preset data DATA2 to be written, it is judged that the writing fails. In this case, it proceeds to operation S530.

在操作S530中,電子裝置E1更判斷位址AD2中的已寫入資料是否相同於位址AD2的原始資料。若位址AD2中的已寫入資料相異於位址AD2的原始資料,再次進入操作S510。電子裝置E1依據指令CM2將資料DATA2重新寫入電子裝置E2的位址AD2。也就是說,當判斷位址AD2中的已寫入資料不同於位址AD2的原始資料時,就直接進行重寫。若已寫入資料相同於位址AD2的原始資料,進入操作S540。 In operation S530, the electronic device E1 further determines whether the written data in the address AD2 is the same as the original data in the address AD2. If the written data in the address AD2 is different from the original data in the address AD2, operation S510 is entered again. The electronic device E1 rewrites the data DATA2 to the address AD2 of the electronic device E2 according to the command CM2. That is to say, when it is judged that the written data in the address AD2 is different from the original data in the address AD2, rewriting is performed directly. If the written data is the same as the original data at the address AD2, go to operation S540.

在操作S540中,基於位址AD2,建立相關於寫入程序的相關位址列表。具體而言,若此寫入程序的位址AD2有N個(例如:8個)位元,該N個(例如:8個)位元將分別執行反相程序,以產生電子裝置E2的N個(例如:8個)相關位址。此N個(例如:8個)相關位址用以建立此寫入程序的相關位址列表。 In operation S540, based on the address AD2, a related address list related to the write program is established. Specifically, if the address AD2 of the writing procedure has N (eg: 8) bits, the N (eg: 8) bits will perform an inversion procedure respectively to generate the N (eg: 8) bits of the electronic device E2 (eg: 8) associated addresses. The N (eg: 8) related addresses are used to create the related address list of the write procedure.

參考第6圖。第6圖是依照本案一些實施例所繪示的一反相程序的流程圖。在操作S610中,n對應於位址AD2的第n個位元且將n設為1。在操作S620中,將第n個位元的邏輯值反相(例如:邏輯值1轉為邏輯值0,邏輯值0轉為邏輯值1)。在操作S630中,將n+1設為新的n。在操作S640中,判斷新的n(原n+1)是否大於N。若是,反相程序結束。若否,回到操作S620,以依據更新後的n對第n個位元執行反相程序,進而分析出至少一相關位址。 Refer to Figure 6. FIG. 6 is a flowchart of an inversion process according to some embodiments of the present application. In operation S610, n corresponds to the n-th bit of the address AD2 and n is set to 1. In operation S620, the logical value of the n-th bit is inverted (eg, logical value 1 is converted to logical value 0, and logical value 0 is converted to logical value 1). In operation S630, n+1 is set as a new n. In operation S640, it is determined whether the new n (original n+1) is greater than N. If so, the inversion procedure ends. If not, go back to operation S620 to perform an inversion procedure on the n-th bit according to the updated n, and then analyze at least one relevant address.

舉例而言。若位址AD2為0 0 0 0 1 0 0 1,將第1個位元進行反相後產生第一個相關位址為0 0 0 0 1 0 0 0,將第2 個位元進行反相後產生第二個相關位址為0 0 0 0 1 0 1 1,將第3個位元進行反相後產生第三個相關位址為0 0 0 0 1 1 0 1,將第4個位元進行反相後產生第四個相關位址為0 0 0 0 0 0 0 1,將第5個位元進行反相後產生第五個相關位址為0 0 0 1 1 0 0 1,將第6個位元進行反相後產生第六個相關位址為0 0 1 0 1 0 0 1,將第7個位元進行反相後產生第七個相關位址為0 1 0 0 1 0 0 1,將第8個位元進行反相後產生第八個相關位址1 0 0 0 1 0 0 1。等效而言,上述產生的相關位址中的其中一位元與位址AD2的相應位元不相同,相關位址中的其他位元與位址AD2的其他相應位元相同。上述8個相關位址可用以建立相關位址列表。換句話說,相關位址列表包含上述8個相關位址。 For example. If the address AD2 is 0 0 0 0 1 0 0 1, invert the first bit to generate the first related address as 0 0 0 0 1 0 0 0, and the second After inverting the bits, the second relative address is 0 0 0 0 1 0 1 1, and the third bit is inverted to produce the third relative address 0 0 0 0 1 1 0 1 , invert the fourth bit to generate the fourth related address as 0 0 0 0 0 0 0 1, and invert the fifth bit to generate the fifth related address as 0 0 0 1 1 0 0 1, invert the sixth bit to generate the sixth related address as 0 0 1 0 1 0 0 1, invert the seventh bit to generate the seventh related address as 0 1 0 0 1 0 0 1, invert the eighth bit to generate the eighth related address 1 0 0 0 1 0 0 1. Equivalently speaking, one of the bits in the above-generated relevant address is different from the corresponding bit in the address AD2, and the other bits in the relevant address are the same as the other corresponding bits in the address AD2. The above 8 related addresses can be used to build a related address list. In other words, the relevant address list contains the above 8 relevant addresses.

再次參考第5圖。在操作S550中,電子裝置E1讀取相關位址列表中的相關位址,以判斷該N個相關位址是否發生資料異常。若其中一個相關位址被判斷出發生資料異常,將此相關位址的已寫入資料回復為此相關位址的原始資料,且再次進入操作S510。在一些實施中,相關位址或所有位址的原始資料均會備份,當操作S520判斷為寫入成功後,位址AD2於備份中相應的內容才會更新成資料DATA2。 Refer again to Figure 5. In operation S550, the electronic device E1 reads the relevant addresses in the relevant address list to determine whether data abnormality occurs in the N relevant addresses. If it is determined that a data abnormality occurs in one of the relevant addresses, the written data of the relevant address is returned to the original data of the relevant address, and operation S510 is entered again. In some implementations, the original data of the relevant address or all the addresses will be backed up. When operation S520 determines that the writing is successful, the corresponding content of the address AD2 in the backup will be updated to the data DATA2.

電子裝置E1依據指令CM2將資料DATA2重新寫入電子裝置E2的位址AD2。也就是說,在判斷寫入失敗發生且建立好相關位址列表後,電子裝置E1會校驗相關位址 列表中的該些(例如:8個)相關位址,且重新執行該寫入程序。 The electronic device E1 rewrites the data DATA2 to the address AD2 of the electronic device E2 according to the command CM2. That is to say, after judging that the write failure has occurred and the related address list is established, the electronic device E1 will verify the related address The (eg: 8) associated addresses in the list, and the write procedure is re-executed.

在一些相關技術中,是配置額外的校驗電路以進行校驗。然而,大部分的協定或設備並不支援額外的校驗電路。另外,配置額外的校驗電路會有成本上升以及電路面積變大的問題。相較於此些相關技術,本案的通訊系100是利用軟體方式對訊號的正確性進行校驗。也就是說,本案的通訊系100不需配置額外的校驗電路。 In some related technologies, additional verification circuits are configured for verification. However, most protocols or devices do not support additional verification circuits. In addition, there are problems in that the additional verification circuit is configured and the cost increases and the circuit area becomes large. Compared with these related technologies, the communication system 100 of the present application uses software to verify the correctness of the signal. That is to say, the communication system 100 of the present case does not need to configure an additional verification circuit.

再者,本案的電子裝置E1優先校驗相關位址列表中的相關位址,而非校驗所有位址。在一些實施例中,由於訊號錯誤的機率很低,因此大部分的錯誤可在校驗完相關位址列表中的相關位址(例如:上述8個相關位址)後即能確認。據此,本案的通訊系100可在不必校驗所有位址的情況下確認寫入錯誤,進而縮短校驗時間。 Furthermore, the electronic device E1 of the present case preferentially checks the relevant addresses in the relevant address list instead of checking all the addresses. In some embodiments, since the probability of signal error is very low, most errors can be confirmed after checking the relevant addresses in the relevant address list (eg, the above 8 relevant addresses). Accordingly, the communication system 100 of the present application can confirm write errors without verifying all addresses, thereby shortening the verification time.

參考第7圖。第7圖是依照本案一些實施例所繪示的通訊方法700的流程圖。通訊方法700包含操作S710、S720以及S730。在一些實施例中,通訊方法700被應用於第1圖的通訊系統100中,但本案不以此為限。為易於理解,通訊方法700將搭配第1圖進行討論。 Refer to Figure 7. FIG. 7 is a flowchart of a communication method 700 according to some embodiments of the present application. The communication method 700 includes operations S710, S720 and S730. In some embodiments, the communication method 700 is applied to the communication system 100 of FIG. 1 , but the present application is not limited thereto. For ease of understanding, the communication method 700 will be discussed in conjunction with FIG. 1 .

在操作S710中,藉由電子裝置E1透過通訊介面IF對電子裝置E2執行寫入程序。在一些實施例中,通訊介面IF由序列外設介面實現。 In operation S710, the electronic device E1 executes the writing procedure to the electronic device E2 through the communication interface IF. In some embodiments, the communication interface IF is implemented by a serial peripheral interface.

在操作S720中,若寫入失敗發生,藉由電子裝置E1建立相關於寫入程序的相關位址列表。在一些實施例 中,將寫入程序的位址AD2的N個(例如:8個)位元分別執行反相程序,以產生N個(例如:8個)相關位址,進而依據此N個(例如:8個)相關位址建立相關位址列表。 In operation S720, if the writing failure occurs, the electronic device E1 creates a related address list related to the writing procedure. In some embodiments , perform an inversion procedure on the N (eg: 8) bits of the address AD2 written in the program, respectively, to generate N (eg: 8) related addresses, and then according to the N (eg: 8) bits ) related addresses to create a list of related addresses.

在操作S730中,藉由電子裝置E1校驗相關位址列表中的該N個相關位址,且重新執行寫入程序。 In operation S730, the N relevant addresses in the relevant address list are checked by the electronic device E1, and the writing procedure is re-executed.

綜上所述,本案的電子裝置以及通訊方法,可利用軟體方式進行校驗,且優先校驗相關位址列表中的相關位址。相較於校驗所有位址,本案的電子裝置以及通訊方法可縮短校驗時間,且不需更動硬體架構。 To sum up, the electronic device and the communication method in this case can be verified by software, and the related addresses in the related address list can be checked first. Compared with verifying all addresses, the electronic device and communication method of the present application can shorten the verification time without changing the hardware structure.

各種功能性元件和方塊已於此公開。對於本技術領域具通常知識者而言,功能方塊可由電路(不論是專用電路,或是於一或多個處理器及編碼指令控制下操作的通用電路)實現,其一般而言包含用以相應於此處描述的功能及操作對電氣迴路的操作進行控制之電晶體或其他電路元件。如將進一步理解地,一般而言電路元件的具體結構與互連,可由編譯器(compiler),例如暫存器傳遞語言(Register Transfer Language,RTL)編譯器決定。暫存器傳遞語言編譯器對與組合語言代碼(assembly language code)相當相似的指令碼(script)進行操作,將指令碼編譯為用於佈局或製作最終電路的形式。確實地,暫存器傳遞語言以其促進電子和數位系統設計過程中的所扮演的角色和用途而聞名。 Various functional elements and blocks have been disclosed herein. To those of ordinary skill in the art, functional blocks may be implemented by circuits (whether special purpose circuits or general purpose circuits operating under the control of one or more processors and coded instructions), which generally include means for corresponding A transistor or other circuit element that controls the operation of an electrical circuit with the functions and operations described herein. As will be further understood, in general the specific structure and interconnection of circuit elements can be determined by a compiler, such as a Register Transfer Language (RTL) compiler. Scratchpad-pass language compilers operate on scripts that are fairly similar to assembly language code, compiling the script into a form that is used to place or make final circuits. Indeed, the register transfer language is known for its role and use in facilitating the design process of electronic and digital systems.

雖然本案已以實施方式揭示如上,然其並非用以限定本案,任何本領域具通常知識者,在不脫離本案之精神 和範圍內,當可作各種之更動與潤飾,因此本案之保護範圍當視後附之申請專利範圍所界定者為準。 Although the present case has been disclosed above in terms of implementation, it is not intended to limit the present case. Anyone with ordinary knowledge in the art will not depart from the spirit of the present case. Various alterations and modifications can be made within the scope of the patent application and the scope of protection in this case.

100:通訊系統 100: Communication System

E1:電子裝置 E1: Electronic device

E2:電子裝置 E2: Electronic Devices

IF:通訊介面 IF: communication interface

Claims (10)

一種電子裝置,透過一通訊介面耦接一另一電子裝置,其中該電子裝置透過該通訊介面對該另一電子裝置執行一寫入程序,其中若一寫入失敗發生,該電子裝置建立相關於該寫入程序的一相關位址列表,校驗該相關位址列表中的複數相關位址,且重新執行該寫入程序。 An electronic device is coupled to another electronic device through a communication interface, wherein the electronic device executes a writing procedure to the other electronic device through the communication interface, wherein if a writing failure occurs, the electronic device establishes a related A related address list of the write procedure, the plurality of related addresses in the related address list are checked, and the write procedure is re-executed. 如請求項1所述的電子裝置,其中若相應於該寫入失敗的一位址具有N個位元,該些相關位址的數量為N,其中N為正整數。 The electronic device of claim 1, wherein if an address corresponding to the write failure has N bits, the number of the relevant addresses is N, where N is a positive integer. 如請求項1所述的電子裝置,其中該電子裝置於該寫入程序將一預設資料寫入該另一電子裝置的一位址,讀取該位址中的一已寫入資料,且判斷該已寫入資料是否相同於該預設資料,以判斷該寫入失敗是否發生。 The electronic device of claim 1, wherein the electronic device writes a preset data into an address of the other electronic device in the writing procedure, reads a written data in the address, and It is judged whether the written data is the same as the default data, so as to judge whether the write failure occurs. 如請求項3所述的電子裝置,其中若該已寫入資料相異於該預設資料,判斷該寫入失敗發生,該電子裝置判斷該已寫入資料是否相同於該位址的一原始資料。 The electronic device of claim 3, wherein if the written data is different from the default data, it is determined that the write failure occurs, and the electronic device determines whether the written data is the same as an original of the address material. 如請求項4所述的電子裝置,其中若該已寫入資料相同於該原始資料,該位址的N個位元的各者分別地執行一反相程序以產生該另一電子裝置的N個相關位址,其中該相關位址列表基於該N個相關位址而建立,其中N 為正整數。 The electronic device of claim 4, wherein if the written data is the same as the original data, each of the N bits of the address separately performs an inversion process to generate N of the other electronic device related addresses, where the list of related addresses is built based on the N related addresses, where N is a positive integer. 如請求項5所述的電子裝置,其中該電子裝置對該N個相關位址進行讀取,以判斷該N個相關位址的一者是否發生一資料異常,其中若該N個相關位址的其中該者發生該資料異常,相應於該其中一者的該已寫入資料被回復,且該電子裝置將該預設資料重新寫入該另一電子裝置的該位址。 The electronic device according to claim 5, wherein the electronic device reads the N related addresses to determine whether a data abnormality occurs in one of the N related addresses, wherein if the N related addresses of which the data exception occurs, the written data corresponding to the one is restored, and the electronic device rewrites the default data to the address of the other electronic device. 如請求項4所述的電子裝置,其中若該已寫入資料相異於該原始資料,該電子裝置將該預設資料重新寫入該另一電子裝置的該位址。 The electronic device of claim 4, wherein if the written data is different from the original data, the electronic device rewrites the default data to the address of the other electronic device. 如請求項1所述的電子裝置,其中該電子裝置透過該通訊介面對該另一電子裝置執行一讀取程序,其中於該讀取程序中,該電子裝置分別於一第一時間點以及一第二時間點讀取該另一電子裝置的一位址的一已寫入資料,且判斷於該第一時間點以及該第二時間點所分別讀取到的兩讀取資料是否相同,以判斷該讀取程序是否成功。 The electronic device of claim 1, wherein the electronic device executes a reading procedure to the other electronic device through the communication interface, wherein in the reading procedure, the electronic device is at a first time point and a A written data of an address of the other electronic device is read at a second time point, and it is determined whether the two read data respectively read at the first time point and the second time point are the same, so as to Determine whether the read procedure is successful. 如請求項1所述的電子裝置,其中該通訊介面為序列外設介面(Serial Peripheral Interface,SPI)。 The electronic device of claim 1, wherein the communication interface is a Serial Peripheral Interface (SPI). 一種通訊方法,包含: A method of communication comprising: 藉由一電子裝置透過一通訊介面對一另一電子裝置執行一寫入程序; Execute a writing procedure to another electronic device through a communication interface by an electronic device; 若一寫入失敗發生,藉由該電子裝置建立相關於該寫入程序的一相關位址列表;以及 If a write failure occurs, establishing, by the electronic device, a related address list related to the write procedure; and 藉由該電子裝置校驗該相關位址列表中的複數相關位址,且重新執行該寫入程序。 The plurality of related addresses in the related address list are checked by the electronic device, and the writing procedure is re-executed.
TW109111652A 2020-02-27 2020-04-07 Electrical device and communication method TWI762900B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010122202.9 2020-02-27
CN202010122202.9A CN113312294A (en) 2020-02-27 2020-02-27 Electronic device and communication method

Publications (2)

Publication Number Publication Date
TW202132981A TW202132981A (en) 2021-09-01
TWI762900B true TWI762900B (en) 2022-05-01

Family

ID=77370740

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109111652A TWI762900B (en) 2020-02-27 2020-04-07 Electrical device and communication method

Country Status (2)

Country Link
CN (1) CN113312294A (en)
TW (1) TWI762900B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI263229B (en) * 2005-03-17 2006-10-01 Sunplus Technology Co Ltd Memory device with interface for serial transmission and error correction method for serial transmission interface
TWI319140B (en) * 2003-06-10 2010-01-01 Mitac Int Corp A fast detection method for the accuracy of the data
TWI335529B (en) * 2007-08-15 2011-01-01 Inventec Corp Method for checking read/write function of the storage device
CN104331381A (en) * 2014-11-21 2015-02-04 湖南先步信息股份有限公司 Anti-interference output method for SPI (serial peripheral interface) chips
US20150128011A1 (en) * 2013-11-06 2015-05-07 Spansion Llc Methods, circuits, systems and computer executable instruction sets for providing error correction of stored data and data storage devices utilizing same
US20150160993A1 (en) * 2013-12-10 2015-06-11 Hyundai Motor Company Serial communication test device, system including the same and method thereof
CN105260260A (en) * 2015-09-21 2016-01-20 上海斐讯数据通信技术有限公司 SPI data transmission device with data check function and data check method
TWI658465B (en) * 2018-02-02 2019-05-01 華邦電子股份有限公司 Memory device and program/erase method thereof

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001067271A (en) * 1999-08-25 2001-03-16 Nec Network Sensa Kk Check method of memory circuit
US8452929B2 (en) * 2005-04-21 2013-05-28 Violin Memory Inc. Method and system for storage of data in non-volatile media
US8756486B2 (en) * 2008-07-02 2014-06-17 Micron Technology, Inc. Method and apparatus for repairing high capacity/high bandwidth memory devices
FR3038752B1 (en) * 2015-07-10 2018-07-27 Stmicroelectronics (Rousset) Sas METHOD AND CIRCUIT FOR PROTECTING AND VERIFYING ADDRESS DATA
TWI647566B (en) * 2018-01-19 2019-01-11 慧榮科技股份有限公司 Data storage device and data processing method
CN110442298B (en) * 2018-05-02 2021-01-12 杭州海康威视系统技术有限公司 Storage equipment abnormality detection method and device and distributed storage system
CN110764947B (en) * 2018-07-27 2023-10-20 深圳大心电子科技有限公司 Data writing method and memory controller
CN109597821A (en) * 2018-12-12 2019-04-09 北京谷数科技有限公司 A kind of method of calibration of storing data consistency

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI319140B (en) * 2003-06-10 2010-01-01 Mitac Int Corp A fast detection method for the accuracy of the data
TWI263229B (en) * 2005-03-17 2006-10-01 Sunplus Technology Co Ltd Memory device with interface for serial transmission and error correction method for serial transmission interface
TWI335529B (en) * 2007-08-15 2011-01-01 Inventec Corp Method for checking read/write function of the storage device
US20150128011A1 (en) * 2013-11-06 2015-05-07 Spansion Llc Methods, circuits, systems and computer executable instruction sets for providing error correction of stored data and data storage devices utilizing same
US20150160993A1 (en) * 2013-12-10 2015-06-11 Hyundai Motor Company Serial communication test device, system including the same and method thereof
CN104331381A (en) * 2014-11-21 2015-02-04 湖南先步信息股份有限公司 Anti-interference output method for SPI (serial peripheral interface) chips
CN105260260A (en) * 2015-09-21 2016-01-20 上海斐讯数据通信技术有限公司 SPI data transmission device with data check function and data check method
TWI658465B (en) * 2018-02-02 2019-05-01 華邦電子股份有限公司 Memory device and program/erase method thereof

Also Published As

Publication number Publication date
TW202132981A (en) 2021-09-01
CN113312294A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
EP3822840B1 (en) Method, apparatus, computer storage medium and program for authenticating a chip design
KR101696124B1 (en) High performance interconnect physical layer
CN102999350B (en) A kind of FPGA program upgrading download online method in digital signal processing platform
US20190272252A1 (en) Method of processing deadlock of i2c bus, electronic device and communication system
US8015449B2 (en) Computer, and method for error-detecting and booting of BIOS thereof
CN107066746B (en) Method for realizing PCA9555 function through CPLD based on I2C interface
US9846625B2 (en) Method and device for debugging a MIPS-structure CPU with southbridge and northbridge chipsets
KR20110124617A (en) System-on-chip and debugging method thereof
CN110347529B (en) Memory device and method for performing error detection protocol
US8239708B2 (en) System on chip (SoC) device verification system using memory interface
CN111078614B (en) FPGA-based functional module
US20080288231A1 (en) Apparatus and method for cooperation verification
TWI762900B (en) Electrical device and communication method
US7363565B2 (en) Method of testing apparatus having master logic unit and slave logic unit
CN105138308A (en) Method and device for updating register
JPH06180657A (en) Method and equipment for testing computer system board
CN206209364U (en) Control circuit device based on DSP Yu FPGA
US11450398B2 (en) Method of testing slave device of inter-integrated circuit bus
CN116226012A (en) Serial peripheral interface integrated circuit and method of operation thereof
CN114115957A (en) FPGA (field programmable Gate array) online updating method with backup and system thereof
US20180307424A1 (en) Updating a memory
CN112534414A (en) Software trace message receiver peripheral
CN113765827B (en) Switch firmware protection system
TWI715294B (en) Method for performing reading and writing operation to i2c memory based on system management bus interface
CN117171097A (en) Remote loading method and system for field programmable gate array