Protocol conversion method and image acquisition system

By establishing an interactive interface and bus controller between the host and the slave device, seamless and efficient protocol conversion is achieved, solving the problem of low communication efficiency between devices that do not support the I³C bus protocol and sensors that do support the I³C bus protocol. This simplifies host operation and supports image sensor testing in image acquisition systems.

CN117354381BActive Publication Date: 2026-11-27SHENZHEN CZTEK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311067502.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2026-11-27
Estimated Expiration
2043-08-23

AI Technical Summary

Technical Problem

In existing technologies, the problem of low protocol conversion efficiency, especially in the connection and communication between devices that do not support the I³C bus protocol and sensors/devices that do support the I³C bus protocol, leads to reduced data transmission efficiency and increased host workload.

Method used

By establishing a first interactive interface and a second interactive interface between the host and the slave device, and using the host to communicate with the first bus controller to transmit change information to the slave device, the second interactive interface is kept consistent with the first interactive interface. The second bus controller executes the target action according to the updated interactive interface, realizes protocol conversion, and simplifies the operation process of the host.

Benefits of technology

It achieves seamless and efficient protocol conversion, solves the communication problem between hosts that do not support the I³C bus protocol and sensors that do support the I³C bus protocol, simplifies the workload of the host, improves data transmission efficiency, and supports image sensor testing in image acquisition systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117354381B_ABST
    Figure CN117354381B_ABST
Patent Text Reader

Abstract

The application provides a protocol conversion method and an image acquisition system, and relates to the technical field of bus protocol conversion. The method comprises the following steps: interaction between a host and a first interaction interface, and the first interaction interface obtains change information; the first interaction interface is provided by the host for controlling a second bus controller; the change information is used for indicating that the second bus controller communicates with a second bus slave device; the host and a lower computer perform first bus communication through a first bus controller, and the change information is transmitted to the lower computer; a second interaction interface is updated according to the change information, so that the second interaction interface and the first interaction interface are consistent; the second interaction interface is provided by the lower computer for controlling the second bus controller; and the second bus controller performs a target action according to the updated second interaction interface. The application solves the problem of low protocol conversion efficiency in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of bus protocol conversion technology, and more specifically, to a protocol conversion method and an image acquisition system. Background Technology

[0002] I 3 C (Improved Inter-Integrated Circuit) is in I 2 A serial bus protocol developed based on C (Inter-Integrated Circuit), its speed is higher than that of I. 2 C offers a several-fold improvement, and its power consumption is also significantly lower than that of I. 2 The C-bus is cheaper, yet retains the advantage of a minimum of two wires in circuit routing. Therefore, more and more sensors and devices are beginning to adopt the I-bus. 3 The C-bus protocol is used. However, many devices, due to their early design or cost control reasons, do not support I-bus. 3 C bus protocol, these do not support I 3 C's devices cannot use I 3 C connects and communicates with sensors / devices, therefore protocol conversion is required to overcome bus protocol incompatibility issues.

[0003] Protocol conversion can be achieved using specialized hardware or software. Software-based methods have low transmission rates and are only suitable for scenarios with low transmission rate requirements. Using specialized external hardware requires frequent operation and control of the external hardware to complete the transmission task, which greatly increases the workload of the host and the uncertainty of transmission, thus reducing data transmission efficiency.

[0004] As can be seen from the above, the existing technology suffers from low protocol conversion efficiency. Summary of the Invention

[0005] This application provides a protocol conversion method and an image acquisition system, which can solve the problem of low protocol conversion efficiency in related technologies. The technical solution is as follows:

[0006] According to one aspect of this application, a protocol conversion method is applied to an image acquisition system, the image acquisition system including a protocol conversion system, the protocol conversion system including a host and a slave device, the host including a first bus controller, and the slave device including a second bus controller, the method comprising: interaction between the host and a first interactive interface, the first interactive interface receiving change information; the first interactive interface being provided by the host for controlling the second bus controller; the change information being used to instruct the second bus controller to perform a target action; the host and the slave device communicating via a first bus through the first bus controller, transmitting the change information to the slave device; the second interactive interface being updated according to the change information, such that the second interactive interface and the first interactive interface are consistent; the second interactive interface being provided by the slave device for controlling the second bus controller; and the second bus controller performing the target action according to the updated second interactive interface.

[0007] In one exemplary embodiment, the method further includes: the second bus controller communicating with the second bus slave device to obtain a communication result; the second bus controller transmitting the communication result to the second interactive interface; the slave device communicating with the host device via the first bus controller through a first bus to transmit the communication result to the host device, so that the first interactive interface is updated according to the communication result to maintain consistency with the second interactive interface; and the host device obtaining the communication result from the updated first interactive interface.

[0008] In an exemplary embodiment, the lower-level machine and the host communicate via a first bus through the first bus controller, and transmit the communication result to the host, including: if the lower-level machine detects that the second interactive interface writes the communication result, it initiates a communication request to the first bus controller; the first bus controller responds to the communication request and establishes a communication connection between the lower-level machine and the host based on the first bus, so that the lower-level machine transmits the communication result to the host.

[0009] In one exemplary embodiment, the process of generating the second interactive interface includes: determining operation information related to the second bus controller; abstracting at least one register based on the operation information; and obtaining the second interactive interface from each of the registers.

[0010] In an exemplary embodiment, the first interactive interface includes a plurality of virtual registers corresponding to each of the aforementioned registers; the interaction between the host and the first interactive interface, wherein the first interactive interface obtains change information, includes: the host obtaining the change information in response to a write operation performed on the virtual registers in the first interactive interface.

[0011] In an exemplary embodiment, the data format of the first bus communication includes a first mode and a second mode; the host and the lower-level machine communicate via the first bus controller to transmit the change information to the lower-level machine, including: when the change information indicates that a single virtual register of the first interactive interface has changed, the host transmits the change information to the lower-level machine via the first bus communication with the first mode of data format; when the change information indicates that multiple virtual registers of the first interactive interface have changed, the host transmits the change information to the lower-level machine via the first bus communication with the second mode of data format.

[0012] In one exemplary embodiment, the second interactive interface is obtained from each register, and each register is abstracted from operation information related to the second bus controller; the first interactive interface includes a plurality of virtual registers corresponding to each of the registers; the host obtains the communication result from the updated first interactive interface, including: the host obtains the communication result in response to a read operation performed on the virtual registers in the first interactive interface.

[0013] In one exemplary embodiment, the second bus controller performs a target action based on the updated second interactive interface, including: the second bus controller obtaining a control command from the updated second interactive interface; and the second bus controller performing the corresponding target action in response to the control command.

[0014] According to one aspect of this application, an image acquisition system is provided for implementing the protocol conversion method as described above. The image acquisition system includes a protocol conversion system, which includes a host and a slave device. The host includes a first bus controller for controlling communication between the host and the slave device via a first bus. The slave device includes a second bus controller for controlling communication between the slave device and a second bus slave device via a second bus.

[0015] In one exemplary embodiment, the protocol conversion system further includes an adjustable potentiometer, which serves as a pull-up resistor for the second bus to change the level of the second bus to a high level.

[0016] In one exemplary embodiment, the first bus controller is an SPI controller, a UART controller, or an I... 2 C controller; the second bus controller is I 3 C controller.

[0017] The beneficial effects of the technical solution provided in this application are:

[0018] In the above technical solution, the host interacts with the first interactive interface, causing the first interactive interface to generate change information. Based on the first bus communication between the host and the lower-level machine, the change information is transmitted to the lower-level machine, making the second interactive interface synchronized with the first interactive interface. The second bus controller executes the target action according to the second interactive interface, realizing the protocol conversion method, allowing a host without a second bus controller to connect and communicate with the second bus slave device. The second interactive interface is the entry point for external control of the second bus controller. The second interactive interface is simulated in the host to obtain the first interactive interface. The host directly faces the first interactive interface, just like directly controlling the second bus controller. The host can configure, control, and transmit data to the second bus controller by reading or writing to the first interactive interface, thereby realizing communication with the second bus slave device without considering the protocol conversion problem. This solves the problem of increased host workload caused by current external second bus controller solutions, and realizes a protocol conversion scheme that is imperceptible and efficient, thus effectively solving the problem of low protocol conversion efficiency in related technologies.

[0019] Furthermore, the protocol conversion method provided in this application can be applied to image acquisition systems, solving the problem of many systems currently not supporting I / O. 3 C's host and supporting I 3 The inability of C-type image sensors to communicate effectively makes these sensors, which do not support I-type sensors, vulnerable to communication problems. 3 C's host can be from I-supporting 3 C's image sensor acquires images and performs image testing, enabling testing of the image sensor. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram based on the implementation environment involved in this application;

[0022] Figure 2This is a flowchart illustrating a protocol conversion method according to an exemplary embodiment;

[0023] Figure 3 yes Figure 2 A flowchart of step 230 in one embodiment corresponds to the following example;

[0024] Figure 4 yes Figure 2 A flowchart of an embodiment following step 230 in the corresponding example;

[0025] Figure 5 yes Figure 4 A flowchart of step 420 in one embodiment corresponds to the following example;

[0026] Figure 6 This is a flowchart illustrating the process of generating a second interactive interface according to an exemplary embodiment;

[0027] Figure 7 yes Figure 2 In one embodiment, step 200 is shown in a flowchart.

[0028] Figure 8 yes Figure 4 A flowchart of step 430 in one embodiment corresponds to the following example;

[0029] Figure 9 yes Figure 2 A flowchart of step 210 in one embodiment corresponds to the following example;

[0030] Figure 10 This is a schematic diagram illustrating an image acquisition system according to an exemplary embodiment;

[0031] Figure 11A This is a schematic diagram illustrating the specific implementation of a protocol conversion method in an application scenario;

[0032] Figure 11B This is a host application and simulation I illustrated according to an exemplary embodiment. 3 Interaction diagram of the C controller's interactive interface;

[0033] Figure 11C This is a simulation I illustrated according to an exemplary embodiment. 3 Communication block diagram between the C controller interface and the SPI controller;

[0034] Figure 11D This is a schematic diagram of the data format of an SPI bus according to an exemplary embodiment;

[0035] Figure 11E This is an exemplary embodiment illustrating the FPGA lower-level machine FPGA logic circuit and the actual I / O. 3Interaction diagram of the C controller interface. Detailed Implementation

[0036] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0037] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this disclosure means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0038] The following is an introduction and explanation of several terms used in this application:

[0039] A bus controller is a circuit or chip used to control bus communication. It is responsible for generating and parsing the communication protocol on the bus and controlling the transmission and reception of data. Bus controllers typically include functions such as state machines, registers, and clocks.

[0040] A host computer is a device that plays a central role in a computer system or other electronic system. It is responsible for controlling and managing the various components of the system and providing computing and processing capabilities. Host computers typically have higher computing and processing power and are capable of performing complex tasks and operations. For example, a host computer can be a personal computer, a laptop, a server, or even an integrated circuit testing device; no specific limitations are made here.

[0041] A slave device is a device connected to a host computer that provides specific functions or services by communicating with the host computer. For example, a slave device can be an FPGA chip, a microcontroller, a single-chip microcomputer, etc., without making any specific restrictions here.

[0042] CIS (CMOS image sensor) chip is a complementary metal-oxide-semiconductor image sensor, also known as a CMOS image sensor.

[0043] CIS test equipment refers to equipment used for semiconductor testing of CIS chips, which realizes the testing process by communicating with the CIS chip.

[0044] An image acquisition system consists of a host computer and an image sensor. The host computer is the control center of the system, responsible for receiving and processing image data from the image sensor.

[0045] As mentioned earlier, existing technologies suffer from low protocol conversion efficiency.

[0046] I 3 The C bus protocol also has another name: SenseWire, I 3 The C protocol is widely used in the interfaces of sensors and control devices. 3 The C protocol offers higher speed, lower power consumption, and more flexible configuration and control options, enabling sensor / control devices (I / O) to achieve higher speeds, lower power consumption, and more flexible configuration and control options. 3 Communication between slave devices and the master is more efficient and reliable. However, there are still many devices that do not support I / O. 3 The host uses the C protocol, and this phenomenon will persist for the foreseeable future; therefore, it is necessary to convert the host's existing communication methods to I. 3 C can be combined with I 3 C communicates with devices (such as sensors / control devices), which means that protocol conversion is required.

[0047] Existing protocol conversion solutions are mainly divided into two types: software simulation and external hardware.

[0048] Software simulation has advantages such as low cost and low technical difficulty, but its biggest drawback is low transmission rate, making it only suitable for scenarios with low transmission rate requirements.

[0049] External hardware solutions involve placing a dedicated bus controller (such as I) around the host computer. 3 The host computer uses a chip with a built-in bus interface (such as I2C controller) to communicate with the controller. 2 (C, UART, SPI) are used to control and support this chip, thereby enabling the host to communicate with a specific bus (such as I...) 3 Communication between devices on the C-bus is achieved through protocol conversion. While external hardware solutions offer higher speeds than software emulation solutions, the host still needs to frequently operate the chip (a specific bus controller) to complete the transmission task, resulting in low protocol conversion efficiency.

[0050] UART to I 3 Taking C as an example, for the host, it directly operates the built-in UART controller and the external I... 3 For the C controller to communicate, it must simultaneously support both UART and I... 3The characteristics of the two buses, C and D, mean that the data transmitted on UART must be based on I. 3 The transmission status on the C bus is used to change the rate, direction, or even retransmit. In addition, frequent access to external I / O pins is required. 3 The C controller leads to reduced data transmission efficiency and greatly increases the workload of the host and the uncertainty of transmission.

[0051] As can be seen from the above, the related technologies still suffer from low protocol conversion efficiency.

[0052] Therefore, the protocol conversion method provided in this application can effectively improve the efficiency of protocol conversion.

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0054] Figure 1 This is a schematic diagram of an implementation environment involved in a protocol conversion method. The implementation environment includes an image acquisition system, which includes a protocol conversion system, comprising a host computer 1 and a slave computer 2.

[0055] The host 1 includes a first bus controller 11, and the slave 2 includes a second bus controller 21.

[0056] The host device 1 can be a desktop computer, laptop computer, server, etc., or it can be an integrated circuit testing device (e.g., a CIS testing device), without specific limitations. The first bus controller can be an SPI controller, a UART controller, or an I2C controller. 2 C controllers, etc., are not specifically limited here.

[0057] The lower-level device 2 can be an FPGA chip, microcontroller, single-chip microcomputer, etc., without specific limitations. The second bus controller can be an SPI controller, UART controller, I... 3 C controller or I 2 The C controller is not specifically defined here.

[0058] The first interactive interface 11 is provided by the host 1 for controlling the second bus controller 21, and the second interactive interface 22 is provided by the slave device 2 for controlling the second bus controller 21.

[0059] In one possible implementation, host 1 is a CIS test device, and correspondingly, slave devices 1, 2 to n on the second bus are all CIS chips (i.e., chips under test). The slave device 2 is an FPGA. By connecting an FPGA board to host 1, the second bus protocol is supported, and communication connection with the CIS chip is realized, so that the functional correctness of the CIS chip can be verified.

[0060] Through the interaction between the host 1 and the first interactive interface 12, the first interactive interface 12 receives change information, which is used to instruct the second bus controller 21 to perform a target action (e.g., communicate with the second bus slave device). The host 1 communicates with the lower-level machine 2 through the first bus controller 11 on the first bus (at this time, the lower-level machine 2 can also be regarded as a slave device on the first bus), transmitting the change information to the lower-level machine 2. The second interactive interface 22 is then updated according to the change information, so that the second interactive interface 22 and the first interactive interface 12 are consistent. The second bus controller 21 performs the target action (e.g., communicate with the second bus slave device) according to the updated second interactive interface 22.

[0061] Please see Figure 2 This application provides a protocol conversion method, which is applicable to, for example, Figure 1 The image acquisition system shown.

[0062] like Figure 2 As shown, the method may include the following steps:

[0063] Step 200: Through the interaction between the host and the first interactive interface, the first interactive interface obtains the change information.

[0064] The host can be a desktop computer, laptop computer, server, or integrated circuit testing equipment; no specific limitation is made here.

[0065] The first interactive interface is provided by the host to control the second bus controller. The change information is used to instruct the second bus controller to perform the target action (such as communicating with the second bus slave device).

[0066] In one possible implementation, the first interactive interface includes a series of virtual registers, each corresponding to a specific memory address in the second bus controller. The host reads or writes to the virtual registers of the first interactive interface, causing the first interactive interface to generate change information. The change information may include information about the virtual registers that have been read or written (such as the virtual register for writing communication instructions).

[0067] Step 210: The host and the slave device communicate via the first bus controller to transmit change information to the slave device.

[0068] The lower-level device can be an FPGA chip, microcontroller, single-chip microcomputer, etc., without specific limitations.

[0069] The first bus controller can be an SPI controller, a UART controller, or an I2C controller. 3 C controller or I 2 C controllers, etc., are not specifically limited here.

[0070] During the communication between the host and the slave device via the first bus controller, the slave device can be regarded as a slave device on the first bus.

[0071] For example, if the first bus controller is an SPI controller, then the host will transmit change information to the lower-level machine through the SPI bus.

[0072] Step 220: The second interactive interface is updated according to the changed information to ensure that the second interactive interface is consistent with the first interactive interface.

[0073] The second interactive interface is provided by the lower-level machine to control the second bus controller, and the second interactive interface is always consistent with the first interactive interface.

[0074] In one possible implementation, the second interactive interface includes a series of virtual registers, each corresponding to a specific memory address in the second bus controller. Based on this, the second bus controller can obtain instructions and data according to the second interactive interface.

[0075] Step 230: The second bus controller executes the target action according to the updated second interactive interface.

[0076] The second bus controller can be an SPI controller, a UART controller, or an I2C controller. 3 C controller or I 2 C controllers, etc., are not specifically limited here.

[0077] The second bus slave device can be any peripheral device, such as a printer, scanner, camera, audio device, etc., without any specific limitations.

[0078] The target action can be reading and writing data to the second bus slave device, controlling the access permissions of the second bus, and setting the order and rate of data transmission, etc., without being specifically limited here.

[0079] like Figure 3 As shown, step 230 may include the following steps:

[0080] Step 300: The second bus controller obtains control commands from the updated second interactive interface.

[0081] The updated second interactive interface is consistent with the first interactive interface.

[0082] For example, if a control instruction is to read data from a register of a second bus device, the control instruction includes the slave device address, the slave device register address, and the read command. This is not a specific limitation, but merely an example.

[0083] Step 310: The second bus controller responds to the control command and executes the corresponding target action.

[0084] Through the above process, the host interacts with the first interactive interface, causing the first interactive interface to generate change information. Based on the first bus communication between the host and the lower-level machine, the change information is transmitted to the lower-level machine, making the second interactive interface synchronized with the first interactive interface. The second bus controller executes the target action (e.g., communicating with the second bus slave device) according to the second interactive interface, realizing the protocol conversion method, allowing the host without a second bus controller to connect and communicate with the second bus slave device. The second interactive interface is the entry point for external control of the second bus controller. The first interactive interface is obtained by simulating the second interactive interface in the host. The host directly faces the first interactive interface, just like directly controlling the second bus controller. The host can configure, control, and transmit data to the second bus controller by reading or writing to the first interactive interface, thereby realizing communication with the second bus slave device without considering the protocol conversion problem. This solves the problem of increased host workload caused by current external second bus controller solutions, and realizes a protocol conversion scheme that is imperceptible and efficient. Furthermore, the protocol conversion method provided in this application can be applied to image acquisition systems, solving the problem of many systems that do not support I / O. 3 C's host and supporting I 3 The inability of C-type image sensors to communicate effectively makes these sensors, which do not support I-type sensors, vulnerable to communication problems. 3 C's host can be from I-supporting 3 C's image sensor acquires images and performs image testing, enabling testing of the image sensor.

[0085] During the protocol conversion process, the host only needs to operate the first interactive interface without having to consider the intermediate protocol conversion process. It is as if the host has a built-in second bus controller, which simplifies the work of the host application and facilitates the porting of the application.

[0086] Please see Figure 4 In an exemplary embodiment, after step 230, the method may further include the following steps:

[0087] Step 400: The second bus controller communicates with the second bus slave device to obtain the communication result.

[0088] The second bus controller can perform bus communication based on instructions obtained from the second interactive interface, and control data transmission and communication operations on the bus, such as reading and writing to any second bus slave device.

[0089] The communication results may include data and status obtained from reading operations on the second bus slave device.

[0090] Step 410: The second bus controller transmits the communication results to the second interactive interface.

[0091] Step 420: The lower-level machine communicates with the host via the first bus controller and transmits the communication result to the host, so that the first interactive interface is updated according to the communication result and keeps consistent with the second interactive interface.

[0092] like Figure 5 As shown, step 420 may include the following steps:

[0093] Step 500: If the lower-level machine detects that the communication result is written to the second interactive interface, it initiates a communication request to the first bus controller.

[0094] During the communication between the lower-level machine and the host via the first bus controller, the lower-level machine is usually passive and needs the host (first bus controller) to actively initiate the first bus communication. That is, the lower-level machine can only send data when the host (first bus controller) requests data.

[0095] Therefore, the lower-level machine needs to send a communication request to the host (first bus controller) so that the host (first bus controller) can initiate the first bus communication.

[0096] Optionally, the lower-level device can initiate a communication request to the first bus controller by using an interrupt line.

[0097] Step 510: In response to the communication request, the first bus controller establishes a communication connection between the lower-level machine and the host based on the first bus, so that the lower-level machine transmits the communication result to the host.

[0098] Step 430: The host obtains the communication result from the updated first interactive interface.

[0099] Under the above embodiments, after the second bus controller transmits the communication results to the second interactive interface, the first interactive interface will be updated accordingly to maintain consistency with the second interactive interface. The host obtains the communication results from the first interactive interface as if directly controlling the second bus controller, without needing to consider the protocol conversion process. This simplifies the host's work and facilitates the porting of applications on the host. In the first bus, the lower-level device (which can be regarded as a slave device of the first bus) is usually passive. Through the interrupt line, the slave device (lower-level device) can actively communicate, enabling the slave device (lower-level device) to send communication requests to the host when needed. Furthermore, using the interrupt line can reduce the host's polling time and improve communication efficiency. The lower-level device can actively notify the host using the interrupt line as needed, without having to wait for the master device's request.

[0100] Please see Figure 6In one exemplary embodiment, the process of generating the second interactive interface includes the following steps:

[0101] Step 600: Determine the operation information related to the second bus controller.

[0102] Operational information related to the bus controller includes controller configuration, write commands, read status, write data, read data, receive interrupts, etc., which are not intended to constitute specific limitations.

[0103] Step 610: At least one register is abstracted based on the operation information, and a second interactive interface is obtained from each register.

[0104] It should be noted that bus controllers typically include registers to store information and status related to the control bus. By reading and writing to these registers, operations can be performed on the bus controller. For example, reading from the bus controller registers allows access to the current status of the bus controller, various configuration parameters, and information related to transmitted data; writing to the bus controller registers allows modification of the bus controller's configuration parameters, initiation or termination of transmissions, and other control operations.

[0105] Therefore, all operations related to the second bus controller can be abstracted into reading and writing operations on a certain memory address in the bus controller, and then at least one register can be abstracted based on the operation information, and the second interactive interface can be obtained from the abstracted register.

[0106] In the second interactive interface, read and write operations on the second bus controller are performed by reading and writing virtual registers. Read operations retrieve the current value of the register, while write operations modify the register value.

[0107] In one possible implementation, the first interactive interface includes multiple virtual registers corresponding to the registers in the second interactive interface, such as... Figure 7 As shown, step 200 may include the following steps:

[0108] In step 700, the host responds to the write operation performed on the virtual register in the first interactive interface and obtains the change information.

[0109] In one possible implementation, such as Figure 8 As shown, step 430 may include the following steps:

[0110] In step 800, the host responds to the read operation performed on the virtual register in the first interactive interface and obtains the communication result.

[0111] Through the above embodiments, controlling the second bus controller essentially involves reading and writing to the registers in the second bus controller. Based on this, a second interactive interface is designed, and a first interactive interface consistent with the second interactive interface is simulated in the host. The host can directly operate the first interactive interface and perform write / read operations on the virtual registers in the first interactive interface to issue instructions (change information) and receive communication results without having to consider the intermediate protocol conversion process. This simplifies the host's work and facilitates the porting of host applications.

[0112] In one possible implementation, the data format of the first bus communication includes a first mode and a second mode, such as... Figure 9 As shown, step 210 may include the following steps:

[0113] Step 900: When the change information indicates that a single virtual register of the first interactive interface has changed, the host transmits the change information to the lower-level machine through the first bus communication with the data format in the first mode.

[0114] As mentioned earlier, the first interactive interface is obtained by the host mimicking the second interactive interface. The first interactive interface includes virtual registers corresponding to the register information of the second bus controller. When only a single virtual register of the first interactive interface is changed (such as being written with instructions and data), the change information includes the address and data of the single register. When transmitting the changed data through the first bus communication, the data format of the first mode is adopted.

[0115] The first mode can be a single address, single data mode.

[0116] Step 910: When the change information indicates that multiple virtual registers of the first interactive interface have changed, the host transmits the change information to the lower-level machine through the first bus communication with the data format in the second mode.

[0117] Multiple virtual registers refer to multiple virtual registers with consecutive addresses.

[0118] The second mode could be a single address multiple data mode. When multiple consecutive virtual registers in the first interactive interface change, the resulting change information includes multiple register addresses and multiple register data. In this case, the single address multiple data mode is used to transmit the change information, and only the starting address of the multiple consecutive virtual registers is retained.

[0119] Under the above embodiments, the data format of the first bus communication is divided into a first mode and a second mode (such as single address single data and single address multiple data modes). The first mode or the second mode is flexibly selected for transmission based on the changed information to be transmitted. When the host only modifies a single virtual register of the first interactive interface, the first mode (such as single address single data) is used to transmit the changed information. When the host modifies a large number of virtual registers of the first interactive interface and the addresses are continuous, the second mode (such as single address multiple data) is used to transmit the changed information. This improves the efficiency of communication between the host and the lower-level machine, reduces the synchronization delay between the first interactive interface and the second interactive interface, achieves extremely low latency synchronization, and reduces the efficiency loss of protocol conversion.

[0120] Please see Figure 10 This application provides an image acquisition system for implementing the protocol conversion method described above. The image acquisition system includes a protocol conversion system, such as... Figure 10 As shown, the protocol conversion system includes a host 1010 and a slave device 1030.

[0121] The host 1010 includes a first bus controller 1011, which is used to control the communication between the host 1010 and the slave device 1030 through the first bus.

[0122] The lower-level machine 1030 includes a second bus controller 1031, which is used to control the communication between the lower-level machine 1030 and the second bus slave device 1070 through the second bus.

[0123] A slave device 1030 is deployed around the host 1010 to implement protocol conversion, thereby supporting the second bus protocol. The protocol conversion method provided in this application is implemented in the protocol conversion system, so that the host application does not need to consider the protocol conversion problem at all. The host application directly operates the first interactive interface to realize the second bus communication (e.g., communication with the second bus slave device). This allows the application to be directly ported to the host that natively supports the second bus protocol in subsequent upgrades, avoiding multiple developments and enabling the host manufacturer to achieve a seamless transition.

[0124] In one possible implementation, the protocol conversion system also includes an adjustable potentiometer 1050, which acts as a pull-up resistor for the second bus to change the level of the second bus to a high level.

[0125] The adjustable potentiometer 1050 is controlled by the lower-level machine 1030. The lower-level machine 1030 can flexibly adjust the adjustable potentiometer 1050 according to the transmission situation on the second bus, thereby improving the stability of the protocol conversion system and reducing the overall energy consumption.

[0126] In one possible implementation, the first bus controller 1011 is an SPI controller, a UART controller, or an I / O controller. 2 C controller, the second bus controller 1031 is I 3 C controller.

[0127] SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver / Transmitter), and I 2 The C (serial bus) controller is a common communication interface in host computers. In comparison, the I... 3 C (Enhanced Type I) 2 C) is a relatively new communication protocol. Due to the slow iteration of host systems, there will be many systems that do not support I in the present and for some time to come. 3 The host uses the C bus protocol; however, many external devices and sensors are gradually supporting I... 3 C bus protocol.

[0128] This embodiment uses an I... 3 The lower-level machine of the C controller implements SPI, UART, and I... 2 C to I 3 C, to resolve the lack of support for I 3 C's host cannot communicate with I 3 The issue of communication between C and the device. Furthermore, the host can be an integrated circuit testing device (e.g., a CIS testing device). Through this embodiment, efficient protocol conversion (such as SPI to I) can be achieved. 3 C), which in turn enables support for I 3 C's chip testing task.

[0129] Figures 11A to 11E This is a schematic diagram illustrating the specific implementation of a protocol conversion method in an application scenario.

[0130] Figure 11A The overall design block diagram of the protocol conversion method is shown, including both hardware and software components.

[0131] In terms of hardware, the host is an ARM host including an SPI controller, and the slave device is an ARM host including an I... 3 C controller (compatible with I) 2 C) FPGA chip,

[0132] The ARM host and the lower-level FPGA communicate via a high-speed full-duplex SPI bus. The SPI bus includes four lines: CS (chip select), CLK (clock), MOSI (master output slave input), and MISO (master input slave output). An additional INT (interrupt) line is added to allow the FPGA to actively notify the ARM host to initiate communication. The FPGA uses I... 3 C bus and I 3 C connects and communicates with the device, I 3 The C bus has only two wires (SCL and SDA), which greatly simplifies the routing on the circuit board. 3 C-bus (SCL and SDA) can provide I 3 C protocol and I 2 The C protocol is shared, therefore this I 3 The C bus (SCL and SDA) can also connect to I 2 C is from the device. I 3 C and I 2 The C bus always has an open-drain (OD) mode, so a pull-up resistor is needed to output a high level, but I 3 C requires high pull-up capability due to its high speed, which leads to... 3 Pull-up resistors on the C bus consume a lot of power, while I... 2 C-type transmission does not require strong pull-up capabilities. Therefore, in this application scenario, I... 3 C, I 2 An adjustable potentiometer is configured on the C-shared bus as a pull-up resistor. The FPGA lower-level device itself performs I / O operations based on the shared bus. 3 C or I 2 The size of the adjustable potentiometer can be dynamically adjusted by changing the transmission rate or transmission speed, which can improve system stability and reduce overall energy consumption.

[0133] In terms of software, for an I 3 The use of the C controller includes operations such as controller configuration, writing commands, reading status, writing data, reading data, and receiving interrupts. These operations are essentially operations on the I... 3 The C controller performs read and write operations on a specific register. Based on this, the FPGA lower-level machine performs read and write operations according to I... 3 The C controller's registers create corresponding virtual registers to obtain the real I... 3 The C controller interface is simulated in the ARM host, creating an identical interface. 3 C controller interactive interface.

[0134] like Figure 11BAs shown, it illustrates the host application and simulation I. 3 The interactive block diagram of the C controller's interactive interface. Operations one, two, and three of the application correspond to different I... 3 C-transmission scenarios, such as when a host application needs to read I... 3 Data from a specific register of a slave device on the C bus can be directly written to the analog I / O bus using information such as the slave device address, slave device register address, and read command. 3 C controller interface,

[0135] like Figure 11C As shown, it illustrates simulation I. 3 The communication block diagram between the C controller's interactive interface and the SPI controller. Among them, the analog I... 3 The C controller's interactive interface backend needs to sense the application's operations in real time, i.e., the application's read and write operations, immediately package the changes, and send the changes to the FPGA lower-level machine via the SPI bus through the SPI controller.

[0136] like Figure 11D As shown, it illustrates a schematic diagram of the SPI bus data format.

[0137] The data format on the SPI bus is divided into two modes: single-address single-data and single-address multiple-data. When the host application modifies the analog I / O... 3 When accessing a specific register on the C controller's interactive interface, a single-address, single-data transfer mode is required, such as... Figure 11D As shown, first, the CS (chip select) signal is pulled low to notify the FPGA lower-level machine that data transmission is about to begin. Then, the ARM host outputs the modified address and corresponding data on the MOSI line. Figure 11D (The clock signal is omitted in the text), and finally the CS signal is pulled high to end the transmission.

[0138] in I 3 In scenarios involving large-scale data transfer, the host application may modify a large number of registers at once, and the addresses are consecutive. In this case, a single-address, multiple-data transfer mode is required. The address in this mode represents the starting address of the data, and the FPGA lower-level device defaults to accumulating the addresses of subsequent data.

[0139] During MOSI data transmission, the MISO line may also return changed data from the FPGA lower-level machine, such as data changes related to reading a certain I. 3 C is the data obtained from the device.

[0140] The above describes the scenario where the ARM host initiates SPI communication. In practical applications, there may also be situations where the FPGA slave initiates communication first. Since the CS signal and clock signal can only be initiated by the ARM host, it is necessary to add an INT (interrupt) line controlled by the FPGA slave to the SPI bus. Whenever the FPGA slave needs to send data, it pulls the INT line low. After the ARM host's SPI controller detects the signal, it immediately starts communicating with the FPGA slave.

[0141] like Figure 11E As shown, it illustrates the FPGA lower-level machine's FPGA logic circuit and the actual I / O pin. 3 The interactive block diagram of the C controller interface. The FPGA logic circuit also functions as an SPI slave device, writing received data into the real I / O pin. 3 C controller interactive interface, while simultaneously displaying the real I 3 Changes to the C controller's interactive interface are sent to the ARM host.

[0142] In this application scenario, the protocol conversion function is implemented by placing an FPGA chip (as a lower-level device) around the ARM host.

[0143] Based on operation I 3 The actual operation of the C controller is all about I. 3 To read and write to a specific memory address in the C controller, design a real I / O... 3 C controller interactive interface (as an external user control I) 3 (using a C controller approach), while simultaneously simulating an identical interactive interface on the ARM host (i.e., a virtual I / O interface). 3 (C controller interactive interface). The ARM host communicates with the connected FPGA slave device via full-duplex high-speed SPI, synchronizing the analog I / O in real time. 3 C controller interface and real I 3 C controller interactive interface, enabling analog I 3 C controller interface and real I 3 The C controller's interface remains consistent. The host application interacts directly with this analog I... 3 Interacting with the C controller's interface is just like directly manipulating a real I / O controller. 3 Like the C controller, it completely avoids contact with the SPI controller, simplifying application operation and facilitating application porting.

[0144] I 3 The C controller then depends on the actual I 3 The commands and data obtained from the C controller's interactive interface are in I 3 Perform corresponding actions on the C bus and return the bus status and data to the real I bus. 3C controller interface, based on analog I 3 C controller interface and real I 3 The C controller's interactive interface remains consistent, and the host application can also use it via emulation. 3 The C controller interface obtains bus status and data. Due to the analog I / O... 3 The existence of the C controller's interactive interface allows host applications to directly operate the interface without considering the intermediate protocol conversion process. This protocol conversion process is separate from the operation of the built-in I / O interface on the ARM host. 3 The C controller is exactly the same, which simplifies the work of the host application and also facilitates application porting.

[0145] Furthermore, in the ARM host's emulation I 3 C controller interactive interface and FPGA lower-level machine real I 3 Between the C controller interface and the SPI controller and FPGA logic circuit, a specific transmission protocol enables high-speed data synchronization between them, which not only makes the analog I / O interface more efficient but also... 3 C controller interface and real I 3 The C controller interface can synchronize in real time and reduce analog I / O. 3 C controller interface and real I 3 The synchronization delay between the C controller interface and the host application enables seamless control of the real I / O interface by the host application. 3 C controller.

[0146] Compared with related technologies, this application has the following advantages:

[0147] 1. The host interacts with the first interactive interface, causing the first interactive interface to generate change information. Based on the first bus communication between the host and the slave device, the change information is transmitted to the slave device, making the second interactive interface synchronized with the first interactive interface. The second bus controller executes the target action according to the second interactive interface, implementing a protocol conversion method that allows a host without a second bus controller to connect and communicate with the second bus slave device. The second interactive interface is the entry point for external control of the second bus controller. The host simulates the second interactive interface to obtain the first interactive interface. The host directly faces the first interactive interface, just like directly controlling the second bus controller. By reading or writing to the first interactive interface, the host can configure, control, and transmit data to the second bus controller, thereby realizing communication with the second bus slave device without considering the protocol conversion problem. This solves the problem of increased host workload caused by current external second bus controller solutions, and realizes a protocol conversion solution that is imperceptible and highly efficient.

[0148] Furthermore, the protocol conversion method provided in this application can be applied to image acquisition systems, solving the problem that many hosts that do not support I3C cannot communicate with image sensors that support I3C. This enables these hosts that do not support I3C to acquire images from image sensors that support I3C and perform image testing, thus enabling testing of image sensors.

[0149] 2. After the second bus controller transmits the communication results to the second interactive interface, the first interactive interface will be updated accordingly to maintain consistency with the second interactive interface. The host obtains the communication results from the first interactive interface as if directly controlling the second bus controller, without needing to consider the protocol conversion process. This simplifies the host's work and facilitates the porting of applications on the host. In the first bus, the lower-level device (which can be considered a slave device) is usually passive. Interrupt lines enable the slave device (lower-level device) to actively communicate, allowing it to send communication requests to the host when needed. Using interrupt lines also reduces the host's polling time and improves communication efficiency. The lower-level device can actively notify the host using interrupt lines as needed, without waiting for requests from the master device.

[0150] 3. The data format of the first bus communication is divided into a first mode and a second mode (such as single address single data and single address multiple data). The first mode or the second mode is flexibly selected for transmission based on the changed information to be transmitted. When the host only modifies a single virtual register of the first interactive interface, the first mode (such as single address single data) is used to transmit the changed information. When the host modifies a large number of virtual registers of the first interactive interface and the addresses are continuous, the second mode (such as single address multiple data) is used to transmit the changed information. This improves the communication efficiency between the host and the lower-level machine, reduces the synchronization delay between the first interactive interface and the second interactive interface, achieves extremely low latency synchronization, and reduces the efficiency loss of protocol conversion.

[0151] 4. SPI (Serial Peripheral Interface), UART (Universal Asynchronous Receiver / Transmitter), and I... 2 The C (serial bus) controller is a common communication interface in host computers. In comparison, the I... 3 C (Enhanced Type I) 2 C) is a relatively new communication protocol. Due to the slow iteration of host systems, there will be many systems that do not support I in the present and for some time to come. 3 The host uses the C bus protocol; however, many external devices and sensors are gradually supporting I... 3 C bus protocol.

[0152] This embodiment uses an I... 3 The lower-level machine of the C controller implements SPI, UART, and I... 2 C to I 3 C, to resolve the lack of support for I3 C's host cannot communicate with I 3 The issue of communication between C and the device. Furthermore, the host can be an integrated circuit testing device (e.g., a CIS testing device). Through this embodiment, efficient protocol conversion (such as SPI to I) can be achieved. 3 C), which in turn enables support for I 3 C's chip testing task.

[0153] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0154] The above description is only a partial embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A protocol conversion method, characterized in that, The method is applied to an image acquisition system, which includes a protocol conversion system. The protocol conversion system includes a host computer and a slave computer. The host computer includes a first bus controller, and the slave computer includes a second bus controller. Through the interaction between the host and the first interactive interface, the first interactive interface receives change information; the first interactive interface is provided by the host for controlling the second bus controller; the change information is used to instruct the second bus controller to perform a target action. The host and the slave device communicate via the first bus controller through the first bus controller, and the host transmits the change information to the slave device. The second interactive interface is updated according to the change information to ensure that the second interactive interface is consistent with the first interactive interface; the second interactive interface is provided by the lower-level machine to control the second bus controller; The second bus controller executes the target action according to the updated second interactive interface; The process of generating the second interactive interface includes: determining operation information related to the second bus controller; abstracting at least one register based on the operation information; and obtaining the second interactive interface from each of the registers. The first interactive interface includes multiple virtual registers corresponding to each of the aforementioned registers; the interaction between the host and the first interactive interface, wherein the first interactive interface obtains change information, includes: the host obtaining the change information in response to a write operation performed on the virtual registers in the first interactive interface.

2. The method as described in claim 1, characterized in that, The method further includes: The second bus controller communicates with the second bus slave device to obtain the communication result; The second bus controller transmits the communication results to the second interactive interface; The lower-level machine communicates with the host through the first bus controller via the first bus controller, and transmits the communication result to the host, so that the first interactive interface is updated according to the communication result and remains consistent with the second interactive interface; The host obtains the communication result from the updated first interactive interface.

3. The method as described in claim 2, characterized in that, The lower-level machine communicates with the host via the first bus controller through a first bus, and transmits the communication result to the host, including: If the lower-level machine detects that the communication result is written to the second interactive interface, it initiates a communication request to the first bus controller; In response to the communication request, the first bus controller establishes a communication connection between the lower-level machine and the host based on the first bus, so that the lower-level machine transmits the communication result to the host.

4. The method as described in claim 1, characterized in that, The data format for the first bus communication includes a first mode and a second mode; The host and the slave device communicate via the first bus controller through a first bus to transmit the change information to the slave device, including: When the change information indicates that a single virtual register of the first interactive interface has changed, the host transmits the change information to the lower-level machine through the first bus communication with the data format in the first mode; When the change information indicates that a plurality of the virtual registers of the first interactive interface have changed, the host transmits the change information to the lower-level machine through the first bus communication with the data format in the second mode.

5. The method as described in claim 2, characterized in that, The second interactive interface is obtained from each register, and each register is abstracted from the operation information related to the second bus controller; the first interactive interface includes multiple virtual registers corresponding to each of the registers respectively; The host obtains the communication result from the updated first interactive interface, including: The host responds to a read operation performed on the virtual register in the first interactive interface to obtain the communication result.

6. The method according to any one of claims 1 to 5, characterized in that, The second bus controller executes the target action based on the updated second interactive interface, including: The second bus controller obtains control commands from the updated second interactive interface; The second bus controller executes the corresponding target action in response to the control command.

7. An image acquisition system for implementing the method as described in any one of claims 1 to 6, characterized in that, The image acquisition system includes a protocol conversion system, which includes a host computer and a slave computer. The host includes a first bus controller, which is used to control the communication between the host and the slave device through the first bus; The lower-level machine includes a second bus controller, which is used to control the communication between the lower-level machine and the second bus slave device through the second bus.

8. The image acquisition system as described in claim 7, characterized in that, The first bus controller is an SPI controller, a UART controller, or an I2C controller; the second bus controller is an I3C controller.

Citation Information

Patent Citations

  • Multi-scene interaction data visualization system and working method thereof

    CN113536008A

  • Protocol converter module system and method of using the same

    CN114641763A