GB2457147A - Reading back data on an I2C bus to detect transmission errors - Google Patents
Reading back data on an I2C bus to detect transmission errors Download PDFInfo
- Publication number
- GB2457147A GB2457147A GB0900800A GB0900800A GB2457147A GB 2457147 A GB2457147 A GB 2457147A GB 0900800 A GB0900800 A GB 0900800A GB 0900800 A GB0900800 A GB 0900800A GB 2457147 A GB2457147 A GB 2457147A
- Authority
- GB
- United Kingdom
- Prior art keywords
- data
- slave
- read
- register
- master
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
- 230000005540 biological transmission Effects 0.000 title abstract 2
- 238000000034 method Methods 0.000 claims description 26
- 238000012795 verification Methods 0.000 claims description 8
- 238000012546 transfer Methods 0.000 abstract description 4
- 238000001514 detection method Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000007257 malfunction Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1443—Transmit or communication errors
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1405—Saving, restoring, recovering or retrying at machine instruction level
- G06F11/141—Saving, restoring, recovering or retrying at machine instruction level for bus or memory accesses
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
Data is written by a master device to a slave device using an I2C bus and then read back to verify that there were no transmission errors. The data may be transferred from a command register 21 on the master into one or more staging registers 23 on the slave, read back from the staging registers and verified by the master. If the data is successfully verified, the master may send a commit command 24 to cause the slave to transfer the data to the corresponding device register 22. After the data is processed, the master may send a copy back command 25 to copy the data back to the staging register. The master may then read the data once more and verify that it is still valid.
Description
DESCRIPTION
Method to write data from an 12C master to an 12C slave
Technical field:
The present invention relates to Inter-Integrated Circuit bus (12C bus) data transfr and more particularly to a Method for failure tolerant data communication via an 12C bus.
Background of the invention:
The 12C bus is a standard developed by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, or celiphone. In the document "The 12C-Bus specification, Version 2.1, January 2000" is given some introduction to the running of such 12C-Bus. This protocol has no error detection or error correction implemented.
Thereby attention must be paid that such error detection or correction is different to collision detection, which is a standard mechanism implemented in 12C to allow multiple 12C masters to access to the same bus. The collision detection is used for arbitration if more than one 12C masters access the 12C bus at the same time. But this cannot help to correct errors in case of electrical disturbances, which is one possibility that 12C data transfers can be tampered due to errors in the signal path. If such erroneous or corrupted data is then used unchecked in the 12c device it can create a major malfunction of the device or even the whole system.
Thus today I2C is used in applications, which can accept failures during operation. If failsafe systems are designed, 12C cannot be used of the shelf or the system must be designed for maximum signal integrity.
From EP 1 607 864 A]. it is known to implement a watchdog timer for the data communication via the 12C bus in order to provide an efficient and convenient way of ensuring that the 12C bus will not be stuck low during data communication between a master and a slave, e.g. between a TV microprocessor and a DVD module microprocessor in a TV-DVD combo device.
Object of the invention: It is thus an object of the invention to develop a method to write data from an 12C master to an 12C slave via an 12C bus, which method and device allow to detect and correct possible corrupted data before using such data for operation.
Summary of the invention:
The shortcomings of the prior art are overcome and
additional advantages are provided by a method to write data from an 12C master to an 12C slave, according to which method in order to detect and correct possible corrupted data before being used for operation, on the master side the data gets sent and read back.
A main idea of the invention is to detect and correct possible corrupted data before being used for operation. The proposed solution is based on the standard 12C protocol.
Data are transferred into a slave staging register before being read back. It is possible to increase the safety of the operation by adding some verification step.
According to a preferred embodiment of the invention, the data are transferred into a slave staging register before being read back.
According to another preferred embodiment of the invention, the safety of the operation is increased by adding at least one verification step.
Thereby it is thinkable that a verification step is performed by comparing the sent and read back data, wherein in case of a match a commit command is sent to the slave, telling the slave to issue the requested transaction.
According to an additional preferred embodiment of the invention, to perform the sending and back reading as well as the comparison, the 12C protocol is expanded. According to the state of the art the 12C protocol schedules an 12C frame comprising a start bit, which defines a start condition, a device address byte and one or more data bytes plus a stop bit which is the 12C stop condition. According to the invention the 12C protocol preferably is at least expanded in a way that two device address bytes are foreseen, wherein in order to allow failure detection, the first device address byte is e.g. error coded and the second device address byte is inverted. The same is performed with the data bytes. Thus regarding the device address bytes only, in comparison to the state of the art, where if an 12C device only needs one device address byte, the second device address byte does not exist and is used as a data byte, according to the invention both device address bytes comprise the same information, wherein e.g. the bits of the second device address byte are inverted to allow an error detection. The same is foreseen for the data bytes. Thereby according to the invention at least some of the data bytes can also be used for other purposes, like e.g. addressing the staging registers and the like.
This extension preferably on both sides, the master and the slave sides, is implemented either in hardware or firmware.
Preferably in small 12C slave devices this change will be implemented in hardware.
According to a particularly preferred embodiment of the invention, the method comprises the following steps: -in a first step data is written to one or more specified slave staging registers; -in a second step data is read from said one or more specified slave staging registers data is written to in step; -in a third step a comparison of the written and read data takes place, wherein in case of a compare error during this verification step the first, the second and the third steps can be retried several times; -in a fourth step a commit command is sent which copies the data from the at least one slave staging register to at least one slave device register; -in a fifth step a copy back command is sent which copies the data from the at least one slave device register back to the at least one slave staging register.
It can be foreseen that in an additional sixth step the data is read from the slave device register which in a seventh step is compared with the data written in the first step, wherein if this comparison is error-free, the procedure ends, and wherein the procedure starts again with the first step if the comparison shows an error, i.e. a data corruption.
The foregoing, together with other objects, features, and advantages of this invention can be better appreciated with reference to the following specification, claims and drawings.
Brief description of the drawings, with:
Fig. 1 showing a high level flow diagram of a method to write data from an 12C master to an 12C slave.
Fig. 2 showing a slave staging-register mechanism performing a method to write data from an 12C master to an 12C slave.
Fig. 3 showing an abstract view of an 12C frame 30.
Detailed description of the drawings:
12c data can be corrupted during transfer via the 12C bus and issue unwanted actions on an 12C device. To make 12C controlled devices safe, according to the invention the handling of the data transmitted according to the 12C protocol is expanded. This expansion concerns two necessary changes: (I) On the master side the data gets sent and read back.
(II) The sent and read back values are compared and in case of a match a commit command is sent to a slave device. This commit command tells the device to issue the requested transaction.
The extension on both sides can either be implemented in hardware or firmware.
Preferably in small 12C slave devices this change will be implemented in hardware.
A high level flow diagram 10 of a method to write data from an 12C master to an 12C slave is shown in Fig. 1. In the following, said method is described with reference to Figs. 1 and 2.
In a first step 01 it is foreseen that a command Write_data() writes data to one or more specified slave staging registers 23.
In a second step 02 it is foreseen that a command Read_data() reads data from said one or more specified slave staging registers 23 data is written to in step 01.
In a third step 03 a comparison of the written and read data takes place. In case of a compare error during this verification step 03 the first step 01, the second step 02 and the third step 03 can be retried several times.
Since an error, i.e. a data corruption, can also occur during read, it is thinkable to read several times, e.g. two times data from said one or more specified slave staging registers 23 data is written to in step 01 and to compare said data read. If the read data are identical, it is assumed that no read error occurred. If the data read differ, a read error is assumed and preferably the reading is retried or the first step 01 and the second step 02 are repeated.
In a fourth step 04 it is foreseen that a command Send_commjt() sends a commit command 24 which copies the data from the at least one slave staging register 23 to at least one slave device register 22.
In a fifth step 05 it is foreseen that a command Send_copy_back() sends a copy back command 25 which Copies the data from the at least one slave device register 22 back to the at least one slave staging register 23.
In a sixth step 06 a command Read_data() reads the data from the slave staging register 23 which in a seventh step 07 are compared with the data written in the first step 01. If this comparison is error-free, the procedure ends in an eight step 08. If the comparison in the seventh step 07 shows an error, i.e. a data corruption, the procedure starts again with the first step 01.
In the sixth step 06 also a reading error can occur as already described with reference to the second step 02. Thus it is also thinkable to read several times, e.g. two times data from said one or more specified slave staging registers 23 and to compare said data read. If the read data are identical, it is assumed that no read error occurred. If the data read differ, a read error is assumed and preferably the reading is retried.
An abstract view of a slave staging register mechanism 20 performing the method described above is shown in Fig. 2.
Thereby the commit command 24 and the copy back command 25 are write sequences to a command register 21.
In order to make the transfer to the command register 21 safe, the first half of a command 24, 25 is bit coded and all bits are inverted in the second half of the command 24, 25.
Fig. 3 represents an 12C frame 30 comprising data to be transmitted via the 12C bus. Each frame 30 for example consists of a two byte device address 31, 32, a two byte register offset 33, 34 and one or more data bytes 35. The frame 30 starts with the 12C start condition 36 and ends with the 12C stop condition 37. Preferably the device address 31, 32 and the register offset 33, 34 are sent twice, for example the second part 32, 34 can be inverted or not. It is also thinkable to send the device address only once, i.e. that the device address 32 is not necessary, i.e. is optional.
It is important to mention that also additional commands can be exchanged between 12C master and slave.
While the present invention has been described in detail, in conjunction with specific preferred embodiments, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art in light of the foregoing description. it is therefore contemplated that the appended claims will embrace any such alternatives, modifications and variations as falling within the true scope and spirit of the present invention.
Claims (8)
- CLAIMS1. Method to write data from an 12C master to an 12C slave characterized in that in order to detect and correct possible corrupted data before being used for operation, on the master side the data gets sent and read back.
- 2. Method according to claim 1, characterized in that the data are transferred into a slave staging register (23) before being read back.
- 3. Method according to claim 1 or 2, characterized by increasing the safety of the operation by adding at least one verification step.
- 4. Method according to claim 3, characterized in that a verification step is performed by comparing the sent and read back data, wherein in case of a match a commit command is sent to the slave, telling the slave to issue the requested transaction.
- 5. Method according to one of the previous claims, characterized in that to perform the sending and back reading as well as the comparison, the 12C protocol is expanded.
- 6. Method according to claim 5, characterized in that the extension on the master and the slave sides is implemented either in hardware or firmware.
- 7. Method according to one of the previous claims, characterized in that: -10 - -in a first step (01) data is written to one or more specified slave staging registers (23); -in a second step (02) data is read from said one or more specified slave staging registers (23) data is written to in step 01; -in a third step (03) a comparison of the written and read data takes place, wherein in case of a compare error during this verification step (03) this can be retried several times; -in a fourth step (04) a commit command (24) is sent which copies the data from the at least one slave staging register (23) to at least one slave device register (22); -in a fifth step (05) a copy back command (25) is sent which copies the data from the at least one slave device register (22) back to the at least one slave staging register (23).
- 8. Method according to claim, 7, characterized in that in an additional sixth step (06) the data is read from the slave staging register (23) which in a seventh step (07) is compared with the data written in the first step (01), wherein if this comparsion is error-free, the procedure ends, and wherein the procedure starts again with the first step (01) if the comparsion shows an error.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP08151212 | 2008-02-08 |
Publications (3)
Publication Number | Publication Date |
---|---|
GB0900800D0 GB0900800D0 (en) | 2009-03-04 |
GB2457147A true GB2457147A (en) | 2009-08-12 |
GB2457147B GB2457147B (en) | 2012-05-02 |
Family
ID=40445972
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
GB0900800.4A Active GB2457147B (en) | 2008-02-08 | 2009-01-19 | Method to write data from an I2C master to an I2C slave |
Country Status (1)
Country | Link |
---|---|
GB (1) | GB2457147B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107291645A (en) * | 2016-04-01 | 2017-10-24 | 昆达电脑科技(昆山)有限公司 | The data transmission method of dual controller |
US10275299B2 (en) | 2017-02-02 | 2019-04-30 | International Business Machines Corporation | Efficient transfer of data from CPU to onboard management device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5696776A (en) * | 1994-07-16 | 1997-12-09 | Temic Telefunken Microelectronic Gmbh | Data transmission method in a real-time data processing system |
US6353908B1 (en) * | 1997-11-24 | 2002-03-05 | Stmicroelectronics Gmbh | Method of and circuit arrangement for digitally transferring bit sequences in selective manner |
US6496900B1 (en) * | 2000-09-12 | 2002-12-17 | 3Ware, Inc. | Disk array system, controller, and method for verifying command data written to disk drives |
-
2009
- 2009-01-19 GB GB0900800.4A patent/GB2457147B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5696776A (en) * | 1994-07-16 | 1997-12-09 | Temic Telefunken Microelectronic Gmbh | Data transmission method in a real-time data processing system |
US6353908B1 (en) * | 1997-11-24 | 2002-03-05 | Stmicroelectronics Gmbh | Method of and circuit arrangement for digitally transferring bit sequences in selective manner |
US6496900B1 (en) * | 2000-09-12 | 2002-12-17 | 3Ware, Inc. | Disk array system, controller, and method for verifying command data written to disk drives |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107291645A (en) * | 2016-04-01 | 2017-10-24 | 昆达电脑科技(昆山)有限公司 | The data transmission method of dual controller |
CN107291645B (en) * | 2016-04-01 | 2020-05-01 | 昆达电脑科技(昆山)有限公司 | Data transmission method of double controllers |
US10275299B2 (en) | 2017-02-02 | 2019-04-30 | International Business Machines Corporation | Efficient transfer of data from CPU to onboard management device |
Also Published As
Publication number | Publication date |
---|---|
GB0900800D0 (en) | 2009-03-04 |
GB2457147B (en) | 2012-05-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019136595A1 (en) | Method for handling i2c bus deadlock, electronic device, and communication system | |
CN1139036C (en) | Intensified error handling for I/O loading/storing operation of -PCI apparatus | |
US9378076B2 (en) | Serial communication test device, system including the same and method thereof | |
JP2988901B2 (en) | Error detection device and error detection method on IC having parallel serial port | |
KR100640037B1 (en) | File control system and file control device | |
US6948031B2 (en) | Methods and apparatus for transferring a data element within a data storage system | |
US10761923B2 (en) | Collision detection for slave storage devices | |
US20090106636A1 (en) | Method and architecture to prevent corrupt data propagation from a pci express retry buffer | |
US9104564B2 (en) | Early data delivery prior to error detection completion | |
US6915446B2 (en) | Supporting error correction and improving error detection dynamically on the PCI-X bus | |
US9542251B2 (en) | Error detection on a low pin count bus | |
US4858234A (en) | Method and apparatus for error recovery in a multibus computer system | |
US6938188B1 (en) | Method for verifying functional integrity of computer hardware, particularly data storage devices | |
US4837767A (en) | Bus adapter module with improved error recovery in a multibus computer system | |
GB2457147A (en) | Reading back data on an I2C bus to detect transmission errors | |
JP2001202295A (en) | Subsystem | |
CN116501536A (en) | AXI interconnection module checking, checking and protecting method, device and storage medium | |
WO2007052147A2 (en) | Error detection in high speed asymmetric interfaces | |
US7526714B2 (en) | Apparatus for checking data coherence, raid controller and storage system having the same, and method therefor | |
CN112445744A (en) | I2C communication | |
JP4782406B2 (en) | Duplex system | |
US20050204185A1 (en) | Detecting and identifying data loss | |
US7343522B2 (en) | Apparatus having a transfer mode abnormality detecting function, storage controlling apparatus, and interface module for the storage controlling apparatus | |
JP3696689B2 (en) | Memory copy device for information processing system | |
JPH01298454A (en) | Method for checking parity of bus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
746 | Register noted 'licences of right' (sect. 46/1977) |
Effective date: 20130226 |