Nothing Special   »   [go: up one dir, main page]

CN113268443A - SMI bus communication method, device, electronic equipment and medium - Google Patents

SMI bus communication method, device, electronic equipment and medium Download PDF

Info

Publication number
CN113268443A
CN113268443A CN202110641533.8A CN202110641533A CN113268443A CN 113268443 A CN113268443 A CN 113268443A CN 202110641533 A CN202110641533 A CN 202110641533A CN 113268443 A CN113268443 A CN 113268443A
Authority
CN
China
Prior art keywords
target
equipment
voltage
sending
data signal
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.)
Pending
Application number
CN202110641533.8A
Other languages
Chinese (zh)
Inventor
谢飞
刘奕辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing CHJ Automobile Technology Co Ltd
Original Assignee
Beijing CHJ Automobile Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing CHJ Automobile Technology Co Ltd filed Critical Beijing CHJ Automobile Technology Co Ltd
Priority to CN202110641533.8A priority Critical patent/CN113268443A/en
Publication of CN113268443A publication Critical patent/CN113268443A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/36Handling requests for interconnection or transfer for access to common bus or bus system
    • G06F13/368Handling requests for interconnection or transfer for access to common bus or bus system with decentralised access control
    • G06F13/376Handling requests for interconnection or transfer for access to common bus or bus system with decentralised access control using a contention resolving method, e.g. collision detection, collision avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

The present disclosure relates to an SMI bus communication method, apparatus, electronic device and medium; wherein, the method comprises the following steps: receiving a data communication request of a target sending device; the data communication request is generated by writing a data signal on a serial management interface SMI bus according to target sending equipment; the data communication request comprises target data and an identification of a target receiving device; receiving a clock signal sent by target sending equipment; and sending the target data to the target receiving equipment based on the level state of the data signal of the target sending equipment and the level state of the data signal of the target receiving equipment determined in advance according to a preset logic rule. The embodiment of the disclosure can avoid the problem of SMI bus conflict when a plurality of sending devices and a plurality of receiving devices carry out data communication, thereby realizing time-sharing multiplexing of multi-channel communication on the SMI bus.

Description

SMI bus communication method, device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of SMI bus communication, and in particular, to an SMI bus communication method, apparatus, electronic device, and medium.
Background
With the rapid development of the vehicle-mounted ethernet, a Serial Management Interface (SMI) is often used in an automotive control system, and includes a Micro Control Unit (MCU) and an ethernet SWITCH chip (SWITCH), or a SWITCH and an ethernet physical layer chip (PHY); the SMI bus consists of a Clock signal (MDC) and a Data signal (MDIO), and the bus distinguishes master and slave devices; as more than one MCU or SWITCH is often used in a controller, multiple masters to multiple slaves are often present; a reasonable solution to the problem of multiple masters and multiple slaves in the prior art has not yet been provided.
When the situation that multiple masters correspond to multiple slaves occurs, confusion of vehicle-mounted communication can be caused.
Disclosure of Invention
To solve the above technical problem or at least partially solve the above technical problem, the present disclosure provides an SMI bus communication method, apparatus, electronic device, and medium.
In a first aspect, the present disclosure provides an SMI bus communication method, including:
receiving a data communication request of a target sending device; the data communication request is generated by writing a data signal on a serial management interface SMI bus by the target sending equipment; the data communication request comprises target data and an identification of a target receiving device;
receiving a clock signal sent by the target sending equipment;
and sending the target data to the target receiving equipment based on the level state of the data signal of the target sending equipment and the level state of the data signal of the target receiving equipment determined in advance according to a preset logic rule.
Optionally, before receiving the clock signal sent by the target sending device, the method further includes:
setting the level state of the data signal of the target receiving equipment according to the level state of the data signal of the target sending equipment based on a preset logic rule;
wherein the level state comprises a high level, a low level or a high resistance.
Optionally, the setting, based on the preset logic rule, the level state of the data signal of the target receiving device according to the level state of the data signal of the target sending device includes:
if the level state of the data signal of the target sending equipment is high level, setting the level state of the data signal of the target receiving equipment to be high resistance;
and if the level state of the data signal of the target sending equipment is low level, setting the level state of the data signal of the target receiving equipment to be low level.
Optionally, the target receiving device includes a target master device or a target slave device, and the target sending device includes a target slave device or a target master device.
Optionally, the setting, based on the preset logic rule, the level state of the data signal of the target receiving device according to the level state of the data signal of the target sending device includes:
if the target sending equipment is target master equipment and the target receiving equipment is target slave equipment, setting the level state of the data signal of the target slave equipment according to the level state of the data signal of the target master equipment on the basis of a preset logic rule;
and if the target sending equipment is target slave equipment and the target receiving equipment is target master equipment, setting the level state of the data signal of the target master equipment according to the level state of the data signal of the target slave equipment based on a preset logic rule.
Optionally, before sending the target data to the target receiving device, the method further includes:
detecting whether the input/output (IO) voltage of the target sending equipment is matched with the IO voltage of the target receiving equipment;
if not, the IO voltage of the target sending device is adjusted according to the magnitude relation between the IO voltage of the target sending device and the IO voltage of the target receiving device, or the IO voltage of the target receiving device is adjusted according to the magnitude relation between the IO voltage of the target sending device and the IO voltage of the target receiving device.
Optionally, the adjusting the IO voltage of the target sending device according to the magnitude relationship between the IO voltage of the target sending device and the IO voltage of the target receiving device includes:
if the IO voltage of the target sending equipment is detected to be larger than the IO voltage of the target receiving equipment, the IO voltage of the target sending equipment is adjusted to be the IO voltage of the target receiving equipment;
the adjusting the IO voltage of the target receiving device according to the magnitude relation between the IO voltage of the target sending device and the IO voltage of the target receiving device includes:
if the IO voltage of the target sending device is smaller than the IO voltage of the target receiving device, the IO voltage of the target receiving device is adjusted to be the IO voltage of the target sending device.
Optionally, after the target data is sent to the target receiving device, the method further includes:
if the target data is detected to be successfully transmitted, receiving a new data communication request of new target transmitting equipment; the new data communication request is generated by writing a data signal on a serial management interface SMI bus by the new target sending equipment; to transmit the new target data to the new target receiving device.
Optionally, before receiving the data communication request of the target sending device, the method further includes:
and determining the target sending equipment from at least two sending equipments according to the equipment priority.
In a second aspect, the present disclosure provides an SMI bus communication device comprising:
the request receiving module is used for receiving a data communication request of the target sending equipment; the data communication request is generated by writing a data signal on a serial management interface SMI bus by the target sending equipment; the data communication request comprises target data and an identification of a target receiving device;
the signal receiving module is used for receiving the clock signal sent by the target sending equipment;
and the data sending module is used for sending the target data to the target receiving equipment based on the level state of the data signal of the target sending equipment and the level state of the data signal of the target receiving equipment determined in advance according to a preset logic rule.
Optionally, the method further includes: a state setting module;
the state setting module is used for setting the level state of the data signal of the target receiving equipment according to the level state of the data signal of the target sending equipment based on a preset logic rule; wherein the level state comprises a high level, a low level or a high resistance.
Optionally, the state setting module is specifically configured to:
if the level state of the data signal of the target sending equipment is high level, setting the level state of the data signal of the target receiving equipment to be high resistance;
and if the level state of the data signal of the target sending equipment is low level, setting the level state of the data signal of the target receiving equipment to be low level.
Optionally, the target receiving device includes a target master device or a target slave device, and the target sending device includes a target slave device or a target master device.
Optionally, the state setting module is specifically configured to:
if the target sending equipment is target master equipment and the target receiving equipment is target slave equipment, setting the level state of the data signal of the target slave equipment according to the level state of the data signal of the target master equipment on the basis of a preset logic rule;
and if the target sending equipment is target slave equipment and the target receiving equipment is target master equipment, setting the level state of the data signal of the target master equipment according to the level state of the data signal of the target slave equipment based on a preset logic rule.
Optionally, the method further includes: the voltage detection module and the voltage adjustment module;
the voltage detection module is used for detecting whether the input/output (IO) voltage of the target sending equipment is matched with the IO voltage of the target receiving equipment or not;
and if not, adjusting the IO voltage of the target transmitting device according to the magnitude relation between the IO voltage of the target transmitting device and the IO voltage of the target receiving device, or adjusting the IO voltage of the target receiving device according to the magnitude relation between the IO voltage of the target transmitting device and the IO voltage of the target receiving device.
Optionally, the voltage adjusting module is specifically configured to:
if the IO voltage of the target sending equipment is detected to be larger than the IO voltage of the target receiving equipment, the IO voltage of the target sending equipment is adjusted to be the IO voltage of the target receiving equipment;
if the IO voltage of the target sending device is smaller than the IO voltage of the target receiving device, the IO voltage of the target receiving device is adjusted to be the IO voltage of the target sending device.
Optionally, the request receiving module is further configured to receive a new data communication request of a new target sending device if it is detected that the target data is successfully sent; the new data communication request is generated by writing a data signal on a serial management interface SMI bus by the new target sending equipment; to transmit the new target data to the new target receiving device.
Optionally, the method further includes: a device determination module;
and the equipment determining module is used for determining target sending equipment from at least two pieces of sending equipment according to the equipment priority.
In a third aspect, the present disclosure also provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the SMI bus communication method according to any of the embodiments of the present invention.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the SMI bus communication method according to any one of the embodiments of the present invention.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: the level state of the data signal of the sending equipment and the level state of the data signal of the receiving equipment can be preset, so that the SMI bus is prevented from generating conflict during data communication, and time-sharing multiplexing of multiple masters and multiple slaves is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of an SMI bus communication method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another SMI bus communication method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another SMI bus communication method according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of another SMI bus communication method according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of data communication;
fig. 6 is a schematic structural diagram of an SMI bus communication apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
In the research and development of the vehicle-mounted ethernet, for an automobile control system, an SMI interface is a common interface, which can be used between a master device and a master device, or between a master device and a slave device, such as between an MCU and a SWITCH chip, and between a SWITCH chip and a PHY chip, so as to implement effective communication between the master device and the master device, or between the master device and the slave device.
The SMI bus is composed of a clock signal MDC and a data signal MDIO, and the bus distinguishes master and slave devices, wherein the MDC and the MDIO are two signal lines included in the SMI interface. However, in the actual operation process of the automobile control system, a plurality of master devices and a plurality of slave devices often occur in the controller without an MCU or SWITCH chip, and therefore, data communication between the plurality of master devices and the plurality of slave devices and data communication between the plurality of master devices and one slave device often occur.
In an automobile control system, under normal conditions, the communication relationship between a master device and a slave device is one-to-many; however, when the communication relationship between the master device and the slave device is changed from one-to-many to many-to-many, communication confusion between the master device and the slave device of the automobile can be caused. The communication of multiple masters and multiple slaves is always a big problem to be solved.
Therefore, in view of the above problems, the present embodiment implements a multi-master and multi-slave communication method by establishing a rule for correspondence between the level state of the data signal of the master device and the level state of the data signal of the slave device, and solves a problem that the SMI bus is prone to generating bus collision during multi-master and multi-slave communication. Specifically, see fig. 1 below.
Fig. 1 is a schematic flowchart of an SMI bus communication method according to an embodiment of the present disclosure. The embodiment is applicable to the case of performing sequential interactive communication between a plurality of transmitting devices and a plurality of receiving devices. The method of the embodiment may be executed by an SMI bus communication apparatus, which may be implemented in hardware and/or software and may be configured in an electronic device. The SMI bus communication method can be realized according to any embodiment of the application. As shown in fig. 1, the method specifically includes the following steps:
s110, receiving a data communication request of the target sending equipment.
The data communication request is generated by writing a data signal on a serial management interface SMI bus according to target sending equipment; the data communication request comprises target data and an identification of a target receiving device;
in this embodiment, the target transmission device is selected from devices included in a controller of the vehicle control system according to a preset rule. The data communication request is a request for the target transmission device to transmit data to a reception device via the SMI bus.
The preset rule may be a priority among the devices included in the controller, or an importance level of each device; specifically, the priority among the devices or the importance level of each device may be manually specified according to the function implemented by the vehicle control system, or manually divided according to the task of each device.
When the target sending equipment writes a data signal into the SMI bus, the data signal needs to be written before the rising edge of a clock signal, so that accurate sampling is guaranteed; after the target sending device writes the data signal into the SMI bus, the clock signal can be sent after waiting for the preset time length to indicate data transmission.
The preset time length can be determined according to the target sending equipment, and if the target sending equipment is a CPU, the preset time length can be set to be between 10ns and 20 ns; if the target transmission device is a PHP chip, the actual setting needs to be performed according to different chips, for example, the preset duration may be set to 100ns-300 ns.
However, in this embodiment, the delay operation can be implemented by using logic codes, that is, a self-contained PLL clock or frequency division of MDC can be used as the delay processing, so that flexible and convenient delay operation can be implemented.
And S120, receiving the clock signal sent by the target sending equipment.
In this embodiment, the delay time between the write data signal and the transmission clock signal may be set according to the logic code, and the inconsistency of the delay time due to the self-attribute of the device may not be considered, so that the accurate sampling of the data may be ensured.
And S130, transmitting the target data to the target receiving equipment based on the level state of the data signal of the target transmitting equipment and the level state of the data signal of the target receiving equipment determined in advance according to a preset logic rule.
Due to the special nature of the SMI bus, the level states of the data signals of the sending device and the receiving device communicating thereon may each comprise three types, i.e. a high level, a low level and a high impedance.
Furthermore, the clock signal penetration performance determines the level state of input and output, namely the level state of the data signal of the target sending device is equal to the level state of the data signal of the target receiving device at any time; however, when the target transmission device transmits data to the target reception device, the data signal of the target transmission device and the data signal of the target reception device need to be transferred in both directions, and therefore, when the level states of the data signals of the target transmission device and the target reception device do not match each other during data communication, if one end of the SMI bus is at a high level and the other end thereof is at a low level, SMI bus collision may occur.
Therefore, the present embodiment can effectively solve the problem of bus collision by setting the level state of the data signal of the target receiving device to be low level or high impedance according to the level state of the data signal of the target transmitting device, thereby realizing effective transmission of the target data.
The method comprises the steps of receiving a data communication request of target sending equipment; receiving a clock signal sent by target sending equipment; and sending the target data to the target receiving equipment based on the level state of the data signal of the target sending equipment and the level state of the data signal of the target receiving equipment determined in advance according to a preset logic rule. The embodiment of the disclosure can preset the level state of the data signal of the sending device and the level state of the data signal of the receiving device, so that the SMI bus is prevented from generating conflict during data communication, and time-sharing multiplexing of multiple masters and multiple slaves is realized.
In this embodiment, optionally, before receiving the data communication request of the target sending device, the method of this embodiment further includes:
and determining the target sending equipment from at least two sending equipments according to the equipment priority.
And one target sending device is selected from the plurality of sending devices to carry out data communication first, so that the problem of communication failure caused by the fact that the plurality of sending devices occupy the bus at the same time can be avoided.
Determining the target sending device from the at least two sending devices according to the device priorities may include: acquiring the equipment priority of each sending equipment in at least two sending equipments; and taking the sending equipment corresponding to the highest equipment priority as target sending equipment. The device priority may be indicated by a number or letter.
The device priority is exemplified as a number. The device priority of the sending device 1 is 1, the device priority of the sending device 2 is 3, the device priority of the sending device 3 is 4, and the device priority of the sending device 4 is 2; wherein, the smaller the number is, the maximum priority of the equipment is represented; the target transmission apparatus obtained in the transmission apparatus 1, the transmission apparatus 2, the transmission apparatus 3, and the transmission apparatus 4 is selected as the transmission apparatus 1 according to the apparatus priority.
In this embodiment, the device priority of each sending device is used as the criterion of the target sending device, so that the sending device with higher device priority can perform data communication in advance, and thus important data can be effectively transmitted.
Fig. 2 is a schematic flowchart of another SMI bus communication method according to an embodiment of the present disclosure. The present embodiment is based on the foregoing embodiment, and further before step S120, the method may further include:
and S111, setting the level state of the data signal of the target receiving device according to the level state of the data signal of the target sending device based on a preset logic rule.
Wherein, the level state includes high level, low level or high resistance.
In this embodiment, the preset logic rule is a correspondence rule between a level state of a data signal of the target transmitting device and a level state of a data signal of the target receiving device; specifically, the level states of the data signals of the target transmission device may include a high level and a low level, and the level states of the corresponding target received data signals may include a high impedance and a low level.
The embodiment can ensure that the level state of the data signal of the target sending device and the level state of the data signal of the target receiving device are not opposite on the SMI bus based on the preset logic rule, so that the target sending device can effectively send the target data to the target receiving device.
In this embodiment, optionally, setting the level state of the data signal of the target receiving device according to the level state of the data signal of the target sending device based on a preset logic rule includes:
if the level state of the data signal of the target sending equipment is high level, setting the level state of the data signal of the target receiving equipment to be high resistance;
and if the level state of the data signal of the target sending equipment is low level, setting the level state of the data signal of the target receiving equipment to be low level.
In the embodiment, the situation that one signal is pulled up and one signal is low due to the fact that the level state of the data signal of the target sending device is opposite to the level state of the target receiving device is avoided; accordingly, the level state of the data signal of the set target transmission device may be a high level or a low level, so that the level state of the data signal of the set target reception device corresponds to a high impedance at the high level and a low level at the low level. Therefore, the data signal of the target device and the data signal of the target receiving device can be effectively balanced to be stable on the SMI bus.
In this embodiment, optionally, the target receiving device includes a target master device or a target slave device, and the target sending device includes a target slave device or a target master device.
The master device and the slave device can communicate with each other, and the master device and the slave device can also communicate with each other, so that the master device and the slave device can effectively interact with each other.
When the target sending device is the target master device, the target receiving device can be the target slave device or the target master device; when the target transmitting device is a target slave device, the target receiving device may be a target master device.
In this embodiment, optionally, setting the level state of the data signal of the target receiving device according to the level state of the data signal of the target sending device based on a preset logic rule includes:
if the target sending equipment is the target master equipment and the target receiving equipment is the target slave equipment, setting the level state of the data signal of the target slave equipment according to the level state of the data signal of the target master equipment on the basis of a preset logic rule;
and if the target sending equipment is the target slave equipment and the target receiving equipment is the target master equipment, setting the level state of the data signal of the target master equipment according to the level state of the data signal of the target slave equipment based on a preset logic rule.
For data transmission from the master device to the slave device, if the sender is the target master device and the receiver is the target slave device, the level state of the data signal of the target slave device needs to be adjusted according to the level state of the data signal of the target master device.
Illustratively, if the level state of the data signal of the target master device is a high level, the level state of the data signal of the target slave device is a high impedance; if the level state of the data signal of the target master device is a low level, the level state of the data signal of the target slave device is a low level.
For data transmission from the slave device to the master device, if the sender is the target slave device and the receiver is the target master device, the level state of the data signal of the target master device needs to be adjusted according to the level state of the data signal of the target slave device.
Illustratively, if the level state of the data signal of the target slave device is a high level, the level state of the data signal of the target master device is a high impedance; if the level state of the data signal of the target slave device is a low level, the level state of the data signal of the target master device is a low level.
See in particular the following.
Figure BDA0003108030040000121
Wherein S is a target master device; m is a target slave device; 1 is high level; 0 is low level; z is high resistance.
The embodiment can realize that the level state of the data signal of the slave device is adjusted according to the level state of the data signal of the master device, and the level state of the data signal of the master device is adjusted according to the level state of the data signal of the slave device, thereby enabling the effective communication of data between the master device and the slave device.
Fig. 3 is a schematic flowchart of another SMI bus communication method according to an embodiment of the present disclosure. The present embodiment is based on the foregoing embodiment, and further before step S130, the method may further include:
s121, detecting whether the input/output (IO) voltage of target sending equipment is matched with the IO voltage of target receiving equipment; if yes, go to S130; if not, go to S122.
Since the hardware factory setting parameters of each device are different, a problem that IO voltages of the target transmission device and the target reception device are not equal may occur, which may result in that the target reception device cannot receive data transmitted by the target transmission device.
Currently, the IO voltage of a device may include: 3.3V, 2.5V and 1.8V.
When it is detected that the IO voltage of the target transmitting device is not matched with the IO voltage of the target receiving device, the IO voltage of the target transmitting device needs to be adjusted, or the IO voltage of the target receiving device needs to be adjusted.
And S122, adjusting the IO voltage of the target transmitting device according to the magnitude relation between the IO voltage of the target transmitting device and the IO voltage of the target receiving device, or adjusting the IO voltage of the target receiving device according to the magnitude relation between the IO voltage of the target transmitting device and the IO voltage of the target receiving device.
In this embodiment, the IO voltage of the target transmitting device may be selectively adjusted or the IO voltage of the target receiving device may be selectively adjusted according to the magnitude relationship between the IO voltage of the target transmitting device and the IO voltage of the target receiving device, so as to ensure that the IO voltage of the target transmitting device is equal to the IO voltage of the target receiving device, and effective data communication between the target transmitting device and the target receiving device may be achieved.
In an actual scene, the IO voltage of the target sending device or the IO voltage of the target receiving device can be selected and adjusted according to actual requirements; since the lower the IO voltage is, the more the transmission power consumption of data is reduced, in general, the IO voltage of the device with the higher IO voltage is adjusted to the IO voltage corresponding to the device with the lower IO voltage.
According to the embodiment, the IO voltage of the target sending device or the IO voltage of the target receiving device can be adjusted according to the magnitude relation between the IO voltage of the target sending device and the IO voltage of the target receiving device, and effective transmission of data between the target sending device and the target receiving device can be guaranteed.
In this embodiment, optionally, adjusting the IO voltage of the target sending device according to the magnitude relationship between the IO voltage of the target sending device and the IO voltage of the target receiving device includes:
if the IO voltage of the target sending equipment is detected to be larger than the IO voltage of the target receiving equipment, the IO voltage of the target sending equipment is adjusted to be the IO voltage of the target receiving equipment;
according to the magnitude relation of the IO voltage of the target sending device and the IO voltage of the target receiving device, the method for adjusting the IO voltage of the target receiving device comprises the following steps:
and if the IO voltage of the target sending equipment is detected to be smaller than the IO voltage of the target receiving equipment, adjusting the IO voltage of the target receiving equipment to the IO voltage of the target sending equipment.
Here, specific values are set for the IO voltage of the target transmission device and the IO voltage of the target reception device for example.
Example 1, setting the IO voltage of the target transmission device to 3.3V; the IO voltage of the target receiving device is 2.5V.
When the IO voltage of the target sending device is detected to be greater than the IO voltage of the target receiving device, the IO voltage of the target sending device needs to be adjusted, that is, the IO voltage of the target sending device can be adjusted from 3.3V to 2.5V, and specifically, the IO voltage of the target sending device can be changed from 3.3V to 2.5V according to the preset logic code.
Example 2, setting the IO voltage of the target transmission device to 1.8V; the IO voltage of the target receiving device is 2.5V.
When the IO voltage of the target receiving device is detected to be greater than the IO voltage of the target sending device, the IO voltage of the target receiving device needs to be adjusted, that is, the IO voltage of the target receiving device can be adjusted from 2.5V to 1.8V, and specifically, the IO voltage of the target receiving device can be changed from 2.5V to 1.8V according to the preset logic code.
According to the method, the larger IO voltage of the target sending device and the IO voltage of the target receiving device is adjusted according to the smaller IO voltage of the target sending device and the IO voltage of the target receiving device, and the power consumption of data transmission between the target sending device and the target receiving device can be reduced.
Fig. 4 is a schematic flowchart of another SMI bus communication method according to an embodiment of the present disclosure. The present embodiment is based on the foregoing embodiment, and further, after step S130, the method may further include:
s140, if the target data is detected to be successfully transmitted, receiving a new data communication request of new target transmitting equipment; and sending the new target data to the new target receiving equipment.
Wherein, the new data communication request is generated according to the writing of the data signal on the serial management interface SMI bus by the new target sending equipment.
In this embodiment, after completing the data transmission of one piece of target data, the transmission of the next piece of data may be continued, that is, the level state of the data signal of the new target receiving device is set by the level state of the data signal of the new target transmitting device, and the new target data is transmitted to the new target receiving device.
Wherein, the new target sending equipment can be selected from at least two sending equipments according to the equipment priority; therefore, the device with higher priority can be ensured to transmit data in advance.
Specifically, the new target sending device can also be selected according to the data importance degree of the data to be transmitted by the device, so that the data with higher data importance degree can be transmitted in advance, and the transmission priority of the important data is ensured.
According to the embodiment, after one piece of target data is successfully sent, the next piece of target data can be continuously transmitted, so that the transmission space of the SMI bus can be effectively utilized, and the condition that the data transmission efficiency is low due to the fact that the SMI bus is idle is avoided.
In this embodiment, devices that occupy communication of the SMI bus are illustrated as M1, S1 and S2, and refer to fig. 5, where fig. 5 is a schematic diagram of data communication.
Wherein when M1 communicates with S1, M1 needs to send a clock signal to S1; judging a level signal of the data signal of M1, and if M1_ MDIO is 1, setting S1_ MDIO to Z; if M1_ MDIO is 0, set S1_ MDIO to 0; where M1 denotes a target transmitting device, and S1 denotes a target receiving device.
If S1_ MDIO is 1, set M1_ MDIO to Z; if S1_ MDIO is 0, M1_ MDIO is set to 0. Where S1 denotes a target transmitting device, and M1 denotes a target receiving device.
Wherein when M1 communicates with S2, M1 needs to send a clock signal to S2; judging a level signal of the data signal of M1, and if M1_ MDIO is 1, setting S2_ MDIO to Z; if M1_ MDIO is 0, set S2_ MDIO to 0; where M1 denotes a target transmitting device, and S2 denotes a target receiving device.
If S2_ MDIO is 1, set M1_ MDIO to Z; if S2_ MDIO is 0, M1_ MDIO is set to 0. Where S2 denotes a target transmitting device, and M1 denotes a target receiving device.
Fig. 6 is a schematic structural diagram of an SMI bus communication apparatus according to an embodiment of the present disclosure; the device is configured in the electronic equipment, and can realize the SMI bus communication method in any embodiment of the application. The device specifically comprises the following steps:
a request receiving module 610, configured to receive a data communication request of a target sending device; the data communication request is generated by writing a data signal on a serial management interface SMI bus by the target sending equipment; the data communication request comprises target data and an identification of a target receiving device;
a signal receiving module 620, configured to receive a clock signal sent by the target sending device;
a data sending module 630, configured to send the target data to the target receiving device based on the level state of the data signal of the target sending device and the level state of the data signal of the target receiving device determined in advance according to a preset logic rule.
In this embodiment, optionally, the apparatus of this embodiment further includes: a state setting module;
the state setting module is used for setting the level state of the data signal of the target receiving equipment according to the level state of the data signal of the target sending equipment based on a preset logic rule; wherein the level state comprises a high level, a low level or a high resistance.
In this embodiment, optionally, the state setting module is specifically configured to:
if the level state of the data signal of the target sending equipment is high level, setting the level state of the data signal of the target receiving equipment to be high resistance;
and if the level state of the data signal of the target sending equipment is low level, setting the level state of the data signal of the target receiving equipment to be low level.
In this embodiment, optionally, the target receiving device includes a target master device or a target slave device, and the target sending device includes a target slave device or a target master device.
In this embodiment, optionally, the state setting module is specifically configured to:
if the target sending equipment is target master equipment and the target receiving equipment is target slave equipment, setting the level state of the data signal of the target slave equipment according to the level state of the data signal of the target master equipment on the basis of a preset logic rule;
and if the target sending equipment is target slave equipment and the target receiving equipment is target master equipment, setting the level state of the data signal of the target master equipment according to the level state of the data signal of the target slave equipment based on a preset logic rule.
In this embodiment, optionally, the apparatus of this embodiment further includes: the voltage detection module and the voltage adjustment module;
the voltage detection module is used for detecting whether the input/output (IO) voltage of the target sending equipment is matched with the IO voltage of the target receiving equipment or not;
and if not, adjusting the IO voltage of the target transmitting device according to the magnitude relation between the IO voltage of the target transmitting device and the IO voltage of the target receiving device, or adjusting the IO voltage of the target receiving device according to the magnitude relation between the IO voltage of the target transmitting device and the IO voltage of the target receiving device.
In this embodiment, optionally, the voltage adjusting module is specifically configured to:
if the IO voltage of the target sending equipment is detected to be larger than the IO voltage of the target receiving equipment, the IO voltage of the target sending equipment is adjusted to be the IO voltage of the target receiving equipment;
if the IO voltage of the target sending device is smaller than the IO voltage of the target receiving device, the IO voltage of the target receiving device is adjusted to be the IO voltage of the target sending device.
In this embodiment, optionally, the request receiving module 610 is further configured to receive a new data communication request of a new target sending device if it is detected that the target data is successfully sent; the new data communication request is generated by writing a data signal on a serial management interface SMI bus by the new target sending equipment; to transmit the new target data to the new target receiving device.
In this embodiment, optionally, the apparatus of this embodiment further includes: a device determination module;
and the equipment determining module is used for determining target sending equipment from at least two pieces of sending equipment according to the equipment priority.
The SMI bus communication device of the embodiment of the invention can preset the level state of the data signal of the sending equipment and the level state of the data signal of the receiving equipment, so that the SMI bus is prevented from generating conflict during data communication, and the time-sharing multiplexing of multiple masters and multiple slaves is realized.
The SMI bus communication device provided by the embodiment of the invention can execute the SMI bus communication method provided by any embodiment of the invention, and has the corresponding functional module and beneficial effect of the execution method.
Fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. As shown in fig. 7, the electronic apparatus includes a processor 710, a memory 720, an input device 730, and an output device 740; the number of the processors 710 in the electronic device may be one or more, and one processor 710 is taken as an example in fig. 7; the processor 710, the memory 720, the input device 730, and the output device 740 in the electronic apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 7.
The memory 720 is a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the SMI bus communication method in the embodiment of the present invention. The processor 710 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 720, that is, implements the SMI bus communication method provided by the embodiment of the present invention.
The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 720 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 720 may further include memory located remotely from the processor 710, which may be connected to an electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 730 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device, and may include a keyboard, a mouse, and the like. The output device 740 may include a display device such as a display screen.
The embodiment of the present disclosure also provides a storage medium containing computer-executable instructions, which are used to implement the SMI bus communication method provided by the embodiment of the present invention when executed by a computer processor.
Of course, the storage medium provided by the embodiment of the present invention contains computer-executable instructions, and the computer-executable instructions are not limited to the operations of the method described above, and may also execute the relevant operations in the SMI bus communication method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above search apparatus, each included unit and module are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (12)

1. An SMI bus communication method, the method comprising:
receiving a data communication request of a target sending device; the data communication request is generated by writing a data signal on a serial management interface SMI bus by the target sending equipment; the data communication request comprises target data and an identification of a target receiving device;
receiving a clock signal sent by the target sending equipment;
and sending the target data to the target receiving equipment based on the level state of the data signal of the target sending equipment and the level state of the data signal of the target receiving equipment determined in advance according to a preset logic rule.
2. The method of claim 1, wherein prior to receiving the clock signal transmitted by the target transmitting device, the method further comprises:
setting the level state of the data signal of the target receiving equipment according to the level state of the data signal of the target sending equipment based on a preset logic rule;
wherein the level state comprises a high level, a low level or a high resistance.
3. The method of claim 2, wherein setting the level state of the data signal of the target receiving device according to the level state of the data signal of the target transmitting device based on a preset logic rule comprises:
if the level state of the data signal of the target sending equipment is high level, setting the level state of the data signal of the target receiving equipment to be high resistance;
and if the level state of the data signal of the target sending equipment is low level, setting the level state of the data signal of the target receiving equipment to be low level.
4. The method of claim 2, wherein the target receiving device comprises a target master device or a target slave device, and wherein the target sending device comprises a target slave device or a target master device.
5. The method of claim 4, wherein setting the level state of the data signal of the target receiving device according to the level state of the data signal of the target transmitting device based on the preset logic rule comprises:
if the target sending equipment is target master equipment and the target receiving equipment is target slave equipment, setting the level state of the data signal of the target slave equipment according to the level state of the data signal of the target master equipment on the basis of a preset logic rule;
and if the target sending equipment is target slave equipment and the target receiving equipment is target master equipment, setting the level state of the data signal of the target master equipment according to the level state of the data signal of the target slave equipment based on a preset logic rule.
6. The method of claim 1, wherein prior to transmitting the target data to the target receiving device, the method further comprises:
detecting whether the input/output (IO) voltage of the target sending equipment is matched with the IO voltage of the target receiving equipment;
if not, the IO voltage of the target sending device is adjusted according to the magnitude relation between the IO voltage of the target sending device and the IO voltage of the target receiving device, or the IO voltage of the target receiving device is adjusted according to the magnitude relation between the IO voltage of the target sending device and the IO voltage of the target receiving device.
7. The method according to claim 6, wherein the adjusting the IO voltage of the target transmission device according to the magnitude relationship between the IO voltage of the target transmission device and the IO voltage of the target reception device includes:
if the IO voltage of the target sending equipment is detected to be larger than the IO voltage of the target receiving equipment, the IO voltage of the target sending equipment is adjusted to be the IO voltage of the target receiving equipment;
the adjusting the IO voltage of the target receiving device according to the magnitude relation between the IO voltage of the target sending device and the IO voltage of the target receiving device includes:
if the IO voltage of the target sending device is smaller than the IO voltage of the target receiving device, the IO voltage of the target receiving device is adjusted to be the IO voltage of the target sending device.
8. The method of claim 1, wherein after the transmitting the target data to the target receiving device, the method further comprises:
if the target data is detected to be successfully transmitted, receiving a new data communication request of new target transmitting equipment; the new data communication request is generated by writing a data signal on a serial management interface SMI bus by the new target sending equipment; to transmit the new target data to the new target receiving device.
9. The method of claim 1, wherein prior to receiving the data communication request from the target sending device, the method further comprises:
and determining the target sending equipment from at least two sending equipments according to the equipment priority.
10. An SMI bus communication apparatus, the apparatus comprising:
the request receiving module is used for receiving a data communication request of the target sending equipment; the data communication request is generated by writing a data signal on a serial management interface SMI bus by the target sending equipment; the data communication request comprises target data and an identification of a target receiving device;
the signal receiving module is used for receiving the clock signal sent by the target sending equipment;
and the data sending module is used for sending the target data to the target receiving equipment based on the level state of the data signal of the target sending equipment and the level state of the data signal of the target receiving equipment determined in advance according to a preset logic rule.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the SMI bus communication method of any of claims 1 to 9.
12. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the SMI bus communication method according to any one of claims 1 to 9.
CN202110641533.8A 2021-06-09 2021-06-09 SMI bus communication method, device, electronic equipment and medium Pending CN113268443A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110641533.8A CN113268443A (en) 2021-06-09 2021-06-09 SMI bus communication method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110641533.8A CN113268443A (en) 2021-06-09 2021-06-09 SMI bus communication method, device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN113268443A true CN113268443A (en) 2021-08-17

Family

ID=77234621

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110641533.8A Pending CN113268443A (en) 2021-06-09 2021-06-09 SMI bus communication method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN113268443A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541320A (en) * 2023-05-22 2023-08-04 深圳市海思科自动化技术有限公司 Intelligent IO module bus communication method, IO module, terminal and medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103250401A (en) * 2010-09-28 2013-08-14 海德沃特合作I有限公司 Secure device data records
CN103428678A (en) * 2012-05-25 2013-12-04 尤罗斯有限公司 Apparatus having at least one SIM
CN105335548A (en) * 2015-09-24 2016-02-17 深圳市芯海科技有限公司 MCU simulation method for ICE
CN109240971A (en) * 2018-09-26 2019-01-18 威创集团股份有限公司 Communication means, apparatus and system
CN109739673A (en) * 2018-12-05 2019-05-10 新华三技术有限公司合肥分公司 A kind of register write protection method, logic device and communication equipment
CN111885663A (en) * 2016-09-08 2020-11-03 华为技术有限公司 Communication method and communication device
CN115051889A (en) * 2022-06-24 2022-09-13 深圳市道通科技股份有限公司 Single-wire communication system and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103250401A (en) * 2010-09-28 2013-08-14 海德沃特合作I有限公司 Secure device data records
CN103428678A (en) * 2012-05-25 2013-12-04 尤罗斯有限公司 Apparatus having at least one SIM
CN105335548A (en) * 2015-09-24 2016-02-17 深圳市芯海科技有限公司 MCU simulation method for ICE
CN111885663A (en) * 2016-09-08 2020-11-03 华为技术有限公司 Communication method and communication device
CN109240971A (en) * 2018-09-26 2019-01-18 威创集团股份有限公司 Communication means, apparatus and system
CN109739673A (en) * 2018-12-05 2019-05-10 新华三技术有限公司合肥分公司 A kind of register write protection method, logic device and communication equipment
CN115051889A (en) * 2022-06-24 2022-09-13 深圳市道通科技股份有限公司 Single-wire communication system and method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541320A (en) * 2023-05-22 2023-08-04 深圳市海思科自动化技术有限公司 Intelligent IO module bus communication method, IO module, terminal and medium
CN116541320B (en) * 2023-05-22 2024-01-23 深圳市海思科自动化技术有限公司 Intelligent IO module bus communication method, IO module, terminal and medium

Similar Documents

Publication Publication Date Title
EP3026530B1 (en) Keyboard-video-mouse switch and operating method thereof
CN111338662A (en) Firmware upgrading method and device for slave station and terminal
WO2022161244A1 (en) Multi-host arbitration method and apparatus, and readable storage medium
WO2018112942A1 (en) Device authentication method, apparatus, electronic device and slave device
US20140334364A1 (en) Remote wake-up system and method
TWI516942B (en) Assigning addresses to devices on an interconnect
CN113268443A (en) SMI bus communication method, device, electronic equipment and medium
CN109923531B (en) Method and apparatus for dual mode peripheral component interconnect express (PCIe)
CN103106113A (en) Interrupt event processing method and processing equipment
CN105808476B (en) Cross-clock-domain data transmission method and device
CN115189977B (en) Broadcast transmission method, system and medium based on AXI protocol
CN115525935B (en) Concurrent data operation method, device and equipment for multiple security chips and storage medium
CN111290689B (en) Electronic equipment, main control device, control method and touch control sharing system thereof
CN116541329A (en) Data transmission method, device, equipment and medium
US11108589B2 (en) Battery module, control method, program, and information processing system
CN108563593B (en) Host determination method and device
CN116126769A (en) Isolation circuit and device isolation method for serial bus
CN112363962B (en) Data communication method, system, electronic device and computer storage medium
KR20150061348A (en) Method and Apparatus for setting up device address for I2C communication
CN109344113B (en) Data dispatching method and system for inter-chip communication
CN111130678B (en) Data transmission method, device, equipment and computer readable storage medium
CN115994057A (en) Chip bus detection method and device, electronic equipment and storage medium
CN103686323A (en) Multiprocessor communication method and system
CN109753461B (en) DMA device and data transmission method
CN212850538U (en) Device for realizing RS485 multi-host communication and RS485 communication system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210817