This application claims priority to Chinese Patent Application No. 201310314604.9 filed on Jul. 25, 2013 in the Chinese Intellectual Property Office, the contents of which are incorporated by reference herein.
Embodiments of the present disclosure generally relate to a monitoring apparatus for monitoring inter-integrated circuit (I2C) bus of computing devices.
Digital oscilloscopes can be used to monitor communication data on an inter-integrated circuit (I2C) bus while testing or debugging the I2C bus to determine if the communication of the I2C is normal. However, the digital oscilloscopes are expensive.
Implementations of the present technology will now be described, by way of example only, with reference to the attached figures.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures and components have not been described in detail so as not to obscure the related relevant feature being described. The drawings are not necessarily to scale and the proportions of certain parts may be exaggerated to better illustrate details and features. The description is not to be considered as limiting the scope of the embodiments described herein.
The term “coupled” is defined as connected, whether directly or indirectly through intervening components, and is not necessarily limited to physical connections. The connection can be such that the objects are permanently connected or releasably connected. The term “unit” used herein can be either software module or hardware module. A non-limiting example of the “unit” can be an integrated circuit or an integrated chip with software programs or firmware embedded therein.
The present disclosure is described in relation to an apparatus for monitoring an inter-integrated circuit (I2C) bus.
The signal obtaining unit 11 is electrically coupled with both a serial data (SDA) line and a serial clock (SCL) line of an I2C bus, and is configured to obtain data signals and clock signals transmitted by the I2C bus. In at least one embodiment, the signal obtaining unit 10 can include a current isolator to isolate current signals of the data signals and the clock signals, and then transmit the isolated data signals and clock signals to the data processing unit 11.
The data processing unit 11 analyzes the data signals and the clock signals obtained by the signal obtaining unit 10, and samples the data signals at time intervals. The sampled data signals are stored in the storage unit 12. The storage unit 12 can be a static random access memory (SRAM). Each time interval can be a high period or a low period of the clock signals.
In at least one embodiment, the data processing unit 11 first detects a start signal from the data signals and the clock signals obtained by the signal obtaining unit 10, and records the start signal using a first digital number such as “0x01”. The start signal denotes the beginning of a new data transfer. The start signal is defined as a high-to-low transition of the SDA line while the SCL line is in a high level (e.g., logical “1”). The first digital number is stored in the storage unit 12 representing the start signal. Then, when the start signal is detected, the data processing unit 11 samples each byte of the data signals and an acknowledge (ACK) bit following each byte of the data signals during each high period of the clock signals. Each byte of the data signals sampled by the data processing unit 11 are stored in odd addresses (e.g., X0001, X0003, X0005) of a predetermined storage section storage unit 12. Further, the data processing unit 11 detects if the ACK bit following each byte of the sampled data signals is high or low. If the ACK bit is low, the data processing unit 11 records the ACK bit in the storage unit 12 using a second digital number such as 0X02. If the
ACK bit is high, the data processing unit 11 records the ACK bit in the storage unit 12 using a third digital number such as 0X03. The second and third digital numbers are recorded in even addresses of the predetermined storage section of the storage unit 12. The ACK bit indicates if or not a slave device that is connected on the I2C bus has a response to a master device that is connected on the I2C bus. For example, if the ACK bit is “1” the slave device has no response to the master device. If the ACK bit is “0” the slave device has returned a response to the master device.
When a stop signal is detected by the data processing unit 11, the data processing unit 11 records the stop signal in the storage unit 12 using a fourth digital number such as 0X00. The stop signal is defined as a low-to-high transition of the SDA line while the SCL line is at logical “1”.
The display 13 is electrically coupled to the storage unit 12 and is configured to display data stored in the storage unit 12. Thus, the communication state of the I2C bus can be manually monitored according to the displayed data on the display 13. The display 13 can be a liquid crystal display (LCD) or a light emitting diode (LED) display.
The trigger button 14 is electrically coupled to the data processing unit 11 and configured to send a trigger signal to the data processing unit 11 when the trigger button 14 is operated. The data processing unit 11 starts or stops to sample the data signals of the I2C bus according to the trigger signal.
The data output unit 15 is further electrically coupled to the I2C bus and is configured to output the data stored in the storage unit 12 to the slave device connected on the I2C bus to control the slave device to perform corresponding operations. Thus, the monitoring apparatus 100 can simulate a master device connected on the I2C bus.
In addition, the display 13 is omitted in the second embodiment. The communication control unit 16 is electrically communicating with a computing device 200. The communication control unit 16 acquires the data stored in the storage unit 12 and transmits the data to the computing device 200 to display via a display device (e.g., an LCD). In at least one embodiment, the communication control unit 16 can communicate with the computing device 200 via a universal serial bus (USB) interface or a serial interface. The communication control unit 16 can be an integrated chip or a microprocessor.
The computing device 200 can send a control command to the communication control unit 16. The control command can be then transmitted to the data processing unit 11 controlling the data processing unit 11 to start or stop sampling the data signals from the I2C bus.
The embodiments shown and described above are only examples. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, including in matters of shape, size and arrangement of the parts within the principles of the present disclosure up to, and including, the full extent established by the broad general meaning of the terms used in the claims.
Number | Date | Country | Kind |
---|---|---|---|
2013103146049 | Jul 2013 | CN | national |