A controller and electronic device

By using auxiliary control modules and multiplexing pin technology, the problem of excessive PLC expansion interface pins is solved, realizing the adaptability and versatility of the controller under size requirements and expanding the application range of the controller.

CN122151616APending Publication Date: 2026-06-05BEIJING HOLLYSYS AUTOMATION & DRIVE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING HOLLYSYS AUTOMATION & DRIVE
Filing Date
2026-01-14
Publication Date
2026-06-05

Smart Images

  • Figure CN122151616A_ABST
    Figure CN122151616A_ABST
Patent Text Reader

Abstract

The application provides a controller and an electronic device, which are applied to the technical field of automation control, and the controller comprises a main control module, an auxiliary control module and an expansion card interface, the main control module comprises a plurality of one-way communication interfaces, the controller realizes the selective connection of the plurality of one-way communication ports in the main control module and the expansion card interface through the auxiliary control module, each one-way communication port can multiplex the pins of the expansion card interface, compared with the mode that the signal is led to the pins of the expansion interface in the prior art, the controller provided by the application can effectively reduce the number of pins arranged in the expansion card interface, reduce the size of the expansion card interface, and then be applied to the controller with size requirements, when it is necessary to adapt to the newly added expansion card, only the corresponding preset device address needs to be configured, and the use range of the controller is effectively widened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automation control technology, specifically to a controller and electronic device. Background Technology

[0002] In industrial control environments, to meet the diverse needs of various customers for the main control interface of PLCs (Programmable Logic Controllers), expansion interfaces are generally designed on PLCs to facilitate customers in selecting and using various expansion cards with the PLC to meet the usage requirements of different application scenarios.

[0003] In existing technology, the PLC routes all signals involved in the possible expansion cards, such as UART, CAN, SPI, GPIO, etc., to the pins of the expansion interface. The expansion card is plugged into the expansion interface according to the corresponding position, and can communicate with the PLC through the corresponding pins. Because there are many types of expansion that need to be adapted, the number of pins of the expansion interface is large, which is not conducive to use on PLCs with size requirements, and it is often difficult to adapt to the new types of expansion cards, making it difficult to use on a large scale. Summary of the Invention

[0004] In view of this, this application aims to provide a controller and electronic device to solve the problems in the prior art where the expansion interface size is too large, making it difficult to use on controllers with size requirements, and it is difficult to match with new expansion cards, thus limiting the scope of use.

[0005] In a first aspect, this application provides a controller, including: a main control module, an auxiliary control module, and an expansion card interface, wherein... The expansion card interface includes multiple signal pins and multiple address pins. When any expansion card is plugged into the expansion card interface, the level of at least one of the address pins can be changed and connected to at least one of the signal pins. The main control module includes multiple one-way communication ports, and the auxiliary control module is connected to each of the one-way communication ports and the expansion card interface respectively; In response to the insertion of a target expansion card into the expansion card interface, the auxiliary control module obtains the target device address determined based on the current level of the multiple address pins, and connects the target unidirectional communication port corresponding to the target device address to the signal pin connected to the target expansion card based on the preset correspondence between the preset device address, the unidirectional communication port, and the expansion card, so that the main control module can communicate with the target expansion card.

[0006] In one optional implementation, some of the address pins are connected to the main control module, and the remaining address pins are connected to the auxiliary control module. In response to the insertion of a target expansion card into the expansion card interface, the auxiliary control module feeds back a first address determined based on the current level of the remaining address pins to the main control module; In response to the insertion of a target expansion card into the expansion card interface, the main control module determines a second address based on the current level of the partial address pins and feeds back the target device address obtained by concatenating the first address and the second address to the auxiliary control module.

[0007] In one optional implementation, the auxiliary control module is specifically configured as follows: In response to the insertion of a target expansion card into the expansion card interface, a first address is determined based on the current level of the remaining address pins, the first address is stored in a preset register and a first preset flag is set; The main control module is specifically configured as follows: In response to the insertion of a target expansion card into the expansion card interface, a second address is determined based on the current level of the partial address pins; When the first preset flag is set, the first address in the preset register is obtained, and the first address and the second address are concatenated to form the target device address; The target device address is stored in the preset register, and the second preset flag is set so that the auxiliary control module can obtain the target device address.

[0008] In one optional implementation, the expansion card interface further includes a plug-in detection pin, which can change the level of the plug-in detection pin when any expansion card is plugged into the expansion card interface; The auxiliary control module is connected to the plug-in detection pin; In response to a change in the level of the insertion detection pin, the auxiliary control module determines that a target expansion card is inserted into the expansion card interface and sends a preset notification signal to the main control module. In response to the preset notification signal, the main control module determines that a target expansion card is plugged into the expansion card interface.

[0009] In one alternative implementation, the signal pin and the address pin are multiplexed pins.

[0010] In one optional implementation, the auxiliary control module includes multiple multiplexers, each of which includes multiple input terminals and one output terminal, wherein... The output terminal of each multiplexer serves as the second connection terminal of the auxiliary control module and is connected to the expansion card interface; and the output terminal of each multiplexer is connected to one of the multiplexing pins. The input terminal of each multiplexer serves as the first connection terminal of the auxiliary control module and is connected to each of the unidirectional communication ports. Each input terminal of the multiplexer is used to receive a signal corresponding to the multiplexing pin to which it is connected.

[0011] In one optional implementation, the main control module further includes at least one bidirectional communication port, which is connected to the expansion card interface.

[0012] In one optional implementation, the bidirectional communication port includes I 2 C communication port; The main control module is configured to: verify whether the target device address is valid; if the target device address is invalid, then... 2 The C communication port obtains the target device address corresponding to the target expansion card and sends the target device address to the auxiliary control module. The auxiliary control module is configured to: connect the target one-way communication port corresponding to the target device address to the signal pin connected to the target expansion card based on the preset correspondence, so that the main control module can communicate with the target expansion card; The target expansion card integrates I 2 C extended I / O interface chip, the I 2 The C-type extended I / O interface chip is used to configure the target device address.

[0013] In one optional implementation, the bidirectional communication port includes an SDIO communication port; The SDIO communication port is connected to the expansion card interface.

[0014] In a second aspect, this application provides an electronic device, including a controller as described in any embodiment of the first aspect of this application.

[0015] Based on the above, the controller provided in this application includes a main control module, an auxiliary control module, and an expansion card interface. The expansion card interface includes multiple signal pins and multiple address pins. When any expansion card is plugged into the expansion card interface, the level of at least one address pin can be changed and connected to at least one signal pin. The main control module includes multiple unidirectional communication ports. The auxiliary control module is connected to each unidirectional communication port and the expansion card interface respectively. In response to the insertion of a target expansion card into the expansion card interface, the auxiliary control module obtains the target device address determined based on the current level of the multiple address pins, and based on the preset correspondence between the preset device address and the unidirectional communication port and the expansion card, sets the target device address to the specified value. The target unidirectional communication port is connected to the signal pin of the target expansion card, thereby enabling the main control module to communicate with the target expansion card. The controller provided in this application uses an auxiliary control module to selectively connect multiple unidirectional communication ports in the main control module to the expansion card interface. Each unidirectional communication port can reuse the pins of the expansion card interface. Compared with the prior art of leading signals to the pins of the expansion interface, the controller provided in this application can effectively reduce the number of pins in the expansion card interface and reduce the size of the expansion card interface, thus making it applicable to controllers with size requirements. In addition, when it is necessary to adapt to a new expansion card, only the corresponding preset device address needs to be configured, effectively broadening the scope of application of the controller. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a structural block diagram of a controller provided in an embodiment of this application.

[0018] Figure 2 This is a structural block diagram of another controller provided in an embodiment of this application.

[0019] Figure 3 This is a structural block diagram of another controller provided in the embodiments of this application.

[0020] Figure 4 This is a structural block diagram of another controller provided in the embodiments of this application. Detailed Implementation

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] As mentioned earlier, in order to adapt to different types of expansion cards, the PLC provided by the relevant technology routes all the signals involved in the possible expansion cards to the pins of the expansion interface. The expansion card is plugged into the expansion interface according to the corresponding position, and can communicate with the PLC through the corresponding pins. Since there are many expansion types that need to be adapted, the number of pins of the expansion interface is large, which is not conducive to use on PLCs with size requirements, and it is often difficult to adapt to newly added types of expansion cards, making it difficult to apply on a large scale.

[0023] To address the aforementioned issues, this application provides a controller that uses an auxiliary control module to selectively connect multiple unidirectional communication ports in the main control module to an expansion card interface. Each unidirectional communication port can reuse the pins of the expansion card interface, effectively reducing the number of pins required in the expansion card interface and decreasing its size. This allows the controller to be applied to controllers with size requirements. Furthermore, when a new expansion card needs to be added, only the corresponding preset device address needs to be configured, effectively broadening the controller's application range.

[0024] Based on the above, see Figure 1 The controller provided in this application includes: a main control module, an auxiliary control module, and an expansion card interface.

[0025] The main control module includes multiple unidirectional communication ports, combined with Figure 1 The diagram illustrates, for example, an SPI (Serial Peripheral Interface) communication port, a UART (Universal Asynchronous Receiver / Transmitter) communication port, a CAN (Controller Area Network) communication port, and a GPIO (General Purpose Input / Output) communication port. Of course, in practical applications, other unidirectional communication ports may also be included, which will not be listed here. The main control module interacts with expansion cards that support the corresponding communication protocols through these unidirectional communication ports. These expansion cards can be RS485 communication cards, RS232 communication cards, Profinet slave cards, CAN communication cards, SD cards, and digital input / output cards, etc., and the specific choice depends on the actual application requirements; these will not be detailed here.

[0026] The expansion card interface includes multiple signal pins and multiple address pins (not shown separately in the figure). In the controller provided in this application embodiment, the signal pins are used to transmit communication data, and the address pins are used to transmit device addresses. When any expansion card is plugged into the expansion card interface, it is connected to at least one of the multiple signal pins. Furthermore, the level of at least one address pin can be changed. The level change of the address pin can represent different preset device addresses. There is a unique preset correspondence between the preset device address and the expansion card and the one-way communication port. When any preset device address is determined, the one-way communication port to be used and the expansion card currently plugged into the expansion card interface can be determined based on the obtained preset device address.

[0027] As an optional implementation, pull-up or pull-down resistors can be connected to each address pin. It is understood that for an address pin connected to a pull-up resistor, the pin level is high when no expansion card is connected, and changes from high to low after the expansion card is connected. Similarly, for an address pin connected to a pull-down resistor, the pin level is low when no expansion card is connected, and changes from low to high after the expansion card is connected. Assuming high level is represented as "1" and low level as "0", since different expansion cards are inserted at different locations in the expansion card interface and their pin layouts are also different, the levels of different address pins can be changed when different expansion cards are inserted into the interface, thus obtaining the corresponding 0 and 1. Combining the values ​​corresponding to each address pin yields the corresponding preset device address.

[0028] The auxiliary control module is connected to each unidirectional communication port and the expansion card interface. It is understood that the main control module includes multiple unidirectional communication ports, each supporting a preset communication protocol. In other words, the main control module is configured with multiple different communication protocols. An expansion card that supports any one of the communication protocols configured by the main control module can establish a communication connection with the main control module. Based on this, in this embodiment, any of the aforementioned expansion cards can be used as the target expansion card.

[0029] There is a preset correspondence between the preset device address, the one-way communication port, and the expansion card. The auxiliary control module stores this preset correspondence. Based on this, when the target expansion card is plugged into the expansion card interface, the auxiliary control module obtains the target device address determined by the current level of multiple address pins. According to the aforementioned preset correspondence, the target one-way communication port corresponding to the target device address is connected to the signal pin connected to the target expansion card, thereby enabling the main control module to communicate with the target expansion card. The main control module can exchange data with the target expansion card through the target one-way communication port.

[0030] As mentioned earlier, the expansion card interface includes multiple address pins. In one optional implementation, some of the address pins of the expansion card interface are directly connected to the main control module, while the remaining address pins are connected to the auxiliary control module. When the target expansion card is plugged into the expansion card interface, the level of at least one of the multiple address pins can be changed. The auxiliary control module obtains the level of the address pins it is connected to (i.e., the aforementioned remaining address pins) and determines the first address based on the obtained current level. Correspondingly, the main control module obtains the level of the address pins it is connected to (i.e., the aforementioned partial address pins) and determines the second address based on the obtained current level.

[0031] Furthermore, the main control module and the auxiliary control module are connected in communication, combined with Figure 1 As shown, as an optional implementation, the main control module is equipped with a local communication port (shown as Local Bus), while the auxiliary control module is equipped with a preset register. The local communication port of the main control module can communicate with the auxiliary control module. Based on this, after the auxiliary control module determines the first address based on the current level of the address pin it is connected to, it can store the first address in the preset register and set the first preset flag bit (not shown in the figure) to feed back the first address to the main control module. The main control module obtains the status of the first preset flag bit according to a preset polling cycle. When it determines that the first preset flag bit is set in any polling cycle, it accesses the preset register and obtains the first address stored therein. Meanwhile, the main control module determines the second address based on the current level of its connected address pins, and concatenates the first address and the second address fed back by the auxiliary control module to form the target device address. Further, the main control module stores the obtained target device address in a preset register of the auxiliary control module through its local communication port, and sets a second preset flag bit (not shown in the figure) in the auxiliary control module to feed back the obtained target device address to the auxiliary control module. The auxiliary control module queries the status of the second preset flag bit according to a preset polling cycle. When the second preset flag bit is set, it obtains the target device address stored in the preset register. At this point, the auxiliary control module and the main control module complete the confirmation and interaction of the target device address. Furthermore, the auxiliary control module can connect the one-way communication port corresponding to the target device address and the target expansion card based on the preset correspondence between the preset device address, the one-way communication port, and the expansion card, thus realizing the communication connection between the main control module and the target expansion card.

[0032] It should be noted that when the main control module concatenates the target device address based on the first address and the second address, it can do so according to a pre-defined concatenation rule. In one optional implementation, the first address can be used as the high-order address and the second address as the low-order address. In another optional implementation, the first address can also be used as the low-order address and the second address as the high-order address. Of course, other custom concatenation rules can also be used to concatenate the target device address, which will not be detailed here. As long as they do not exceed the core idea of ​​this application, they also fall within the scope of protection of this application.

[0033] Furthermore, as an optional implementation, the expansion card interface also includes a plug-in detection pin. When any expansion card is plugged into the expansion card interface, the level of the plug-in detection pin can be changed. The level configuration of the plug-in pin can be implemented with reference to the aforementioned address pin, that is, by connecting a pull-up resistor to present a high level when no expansion card is plugged in, or by connecting a pull-down resistor to present a low level when no expansion card is plugged in. The specific implementation process can be found in the aforementioned related content, and will not be described in detail here.

[0034] The auxiliary control module is connected to the insertion detection pin. When the level of the insertion detection pin changes, such as from high to low or from low to high, the auxiliary control module determines that a target expansion card is inserted into the expansion card interface. Simultaneously, the auxiliary control module sends a preset notification signal to the main control module. Based on this signal, the main control module confirms that a target expansion card is inserted into the expansion card interface. Further, the auxiliary and main control modules acquire the level of the address pin and determine the target device address based on it, until a one-way communication connection is established between the communication port and the target expansion card. The specific execution process is detailed above and will not be repeated here.

[0035] In summary, the controller provided in this application embodiment enables selective connection between multiple unidirectional communication ports in the main control module and the expansion card interface through an auxiliary control module. Each unidirectional communication port can reuse the pins of the expansion card interface. Compared with the prior art of leading signals to the pins of the expansion interface, the controller provided in this application can effectively reduce the number of pins in the expansion card interface and reduce the size of the expansion card interface, thus making it applicable to controllers with size requirements. In addition, when it is necessary to adapt to a new expansion card, only the corresponding preset device address needs to be configured, effectively broadening the scope of application of the controller.

[0036] It is understandable that the expansion card interface can accommodate various types of expansion cards. The controller provided in the aforementioned embodiments can significantly reduce the size of the expansion card interface. However, as the number of expansion card types increases, the number of address pins and signal pins required will inevitably increase, leading to a larger expansion card interface size. To address this issue, this application embodiment also provides another controller. In the controller provided in this embodiment, signal pins and address pins are multiplexed pins. That is, the same pin in the expansion card serves the function of transmitting address levels and at least one signal level. Time-division multiplexing of pins further reduces the number of pins required, thereby effectively reducing the size of the expansion card interface. Specific examples of multiplexed pins can be found in Table 1.

[0037] Table 1 As shown in Table 1, three types of expansion cards are supported: AI (Analog Input) expansion cards, AO (Analog Output) expansion cards, and DI (Digital Input) expansion cards. The required transmission signals for each expansion card can be found in Table 1 and related technologies, which will not be detailed here. The expansion card interface includes seven pins. Pins 1-4 are address and signal multiplexed pins, pin 5 is the aforementioned insertion detection pin, and pins 6 and 7 work together to power the inserted expansion card, ensuring normal power-on operation. Taking pin 1 as an example, it is used to transmit one address level and three different signal levels.

[0038] It is understandable that, in order to accurately transmit address and signal levels while using pin multiplexing, the multiplexed pins need to transmit different levels in a time-division multiplexing manner. For example, when determining the device address, the multiplexed pin is used to transmit the address level, while after the main control module and the target expansion card establish a communication connection, the multiplexed pin is used to transmit the signal level. To meet this requirement, embodiments of this application provide a method such as... Figure 2 The auxiliary control module shown.

[0039] Specifically, the auxiliary control module provided in this embodiment includes multiple multiplexers (MUX), and each multiplexer includes multiple input terminals and one output terminal, combined with... Figure 2 As shown, the output of each multiplexer serves as the second connection terminal of the auxiliary control module and is connected to the expansion card interface. Each output terminal of the multiplexer is connected to a multiplexing pin. Correspondingly, the input terminal of each multiplexer serves as the first connection terminal of the auxiliary control module and is connected to each unidirectional communication port. According to the type of signal that the multiplexing pin needs to transmit in actual application, each input terminal of the multiplexer is used to receive a signal corresponding to the multiplexing pin it is connected to.

[0040] Based on the aforementioned connections, after the main control module and auxiliary control module determine the target device address as described above, the auxiliary control module controls each multiplexer to select its output pin, based on the connection between the multiplexer's input and the main control module's unidirectional communication port, and the connection between the multiplexer's output and the multiplexing pin. This means controlling the multiplexer's output to connect to one of its own inputs, thereby transmitting the signal from the connected input to the output, thus establishing a communication connection between the main control module and the target expansion card. Of course, in practical applications, there may be situations where the target expansion card is not connected to one or more multiplexers. In such cases, simply turning off the corresponding multiplexer will suffice.

[0041] Understandably, the main control module and auxiliary control module cannot directly obtain the address level of the multiplexed pins through a multiplexer. Therefore, in practical applications, the pins in the main control module and auxiliary control module used to read the address level need to be connected separately to the multiplexed pins in the expansion card interface that involve transmitting the address level. In other words, Figure 2 The connections shown are only the communication connections between the main control module, the auxiliary control module, and the expansion card interface, i.e., the connections when transmitting data. The connections between the pins of the main control module and the auxiliary control module for reading address levels and the expansion card interface are not shown in the figure.

[0042] As mentioned earlier, pull-up or pull-down resistors can be connected to the pins of the expansion card interface to configure the initial level of the pins. When an expansion card is inserted, the level of the corresponding pin is changed by the expansion card, thereby determining different device addresses. However, when signal pins and address pins are multiplexed, the initial level requirements of some signal pins need to be considered. For example, the TX signal of a serial communication port requires a high level upon power-on, and the corresponding multiplexed pin must be configured with a pull-up resistor. Conversely, for multiplexed pins that require a low level upon power-on, a pull-down resistor must be configured. This reduces the number of preset device addresses that the expansion card interface can configure, and consequently reduces the types of expansion cards that can be inserted, making it difficult to meet the expansion card adaptation requirements in some application scenarios.

[0043] To address the aforementioned issues, this application provides another controller. Based on the foregoing embodiments, the controller provided in this embodiment further includes at least one bidirectional communication port, and each bidirectional communication port is directly connected to the expansion card interface.

[0044] Combination Figure 3 As shown, the main control module includes two bidirectional communication ports, namely I... 2 C(Inter-IntegratedCircuit, I 2C) Communication port and SDIO (Secure Digital Input and Output) communication port. The SDIO communication port only occupies the corresponding multiplexed pins when the connected expansion card is transmitting data.

[0045] As mentioned earlier, due to the limited number of expansion card interfaces and the requirements of some expansion cards on the initial pin levels, the number of preset device addresses configured on the expansion card interface pins may be insufficient to meet the expansion card adaptation needs. When more types of expansion cards need to be adapted, the number of preset device addresses needs to be increased. Based on this, I / O can be integrated on the expansion card. 2 C extended I / O interface chip, through I 2 The C-type extended I / O interface chip allows for the configuration of different preset device addresses using pull-up or pull-down resistors on its GPIO ports, including 8 GPIO ports. 2 Taking the C-type extended I / O interface chip as an example, it can be configured with 256 preset device addresses, which can then be used to identify 256 types of expansion cards. Furthermore, based on I... 2 As can be seen from the working principle of the C extended I / O interface chip, when an I / O interface is integrated... 2 When the expansion card of the C expansion I / O interface chip is plugged into the expansion card interface, the main control module can access the I / O interface via I... 2 The C communication port sequentially obtains the voltage levels of each GPIO port, determines the corresponding preset device address based on the voltage level of each GPIO port, and then determines the currently connected expansion card based on the obtained preset device address.

[0046] The problem lies in the fact that when an expansion card is inserted into the expansion card interface, the main control module first needs to identify how the preset device address corresponding to the currently inserted target expansion card is configured. Based on this, when the target expansion card is inserted into the expansion card interface, the main control module and the auxiliary control module normally concatenate the target device address according to the relevant content of the aforementioned embodiment. After obtaining the target device address, the main control module verifies whether the obtained target device address is valid. If the obtained target device address is invalid, it then uses I... 2 The C communication port obtains the target device address corresponding to the target expansion card. Conversely, if the obtained target device address is valid, it can be used to perform subsequent operations. It is understood that the number of preset device addresses determined based on address pins or multiplexed pins is limited. These preset device addresses can be stored in a preset address set. When the target device address obtained by the main control module is not in this preset address set, the obtained target device address is determined to be invalid. Conversely, if the target device address obtained by the main control module is in this preset address set, the obtained target device address is determined to be valid.

[0047] The following is combined with Figure 3The illustrated embodiments provide a detailed description of the operation of the controller provided in this application: S1. After the controller is powered on, the main control module and the auxiliary control module are powered on and the reset release is completed; S2. The auxiliary control module monitors the level change of the insertion detection pin of the expansion card interface to confirm whether the target expansion card is inserted into the expansion card interface. S3. When the insertion of the target expansion card is determined based on the level change of the insertion detection pin, the main control module and the auxiliary control module configure the address pin (or the multiplexed pin used to transmit the address level) as the input state to read the current level of each pin. S4. The auxiliary control module supplies power to the expansion card via a power pin. S5. The main control module obtains the first address, the auxiliary control module obtains the second address, and the main control module concatenates the target device address based on the first address and the second address. S6. The main control module determines whether the obtained target device address is valid. If it is invalid, it then uses I... 2 If the target device address corresponding to the target expansion card is obtained through the C communication port, and it is valid, then the I address will not be obtained again. 2 The information from the C communication port will be used to store the final target device address in the preset register of the auxiliary control module and set the second preset flag bit. S7. In response to the second preset flag being set, the auxiliary control module obtains the target device address stored in the preset register, and connects the target unidirectional communication port corresponding to the target device address and the signal pin connected to the target expansion card according to the preset correspondence between the preset device address, the unidirectional communication port and the expansion card, so that the main control module and the target expansion card can communicate and connect.

[0048] This application also provides another controller, see [link to relevant documentation] Figure 4 As shown, the controller provided in this embodiment includes two expansion card interfaces, namely expansion card interface 1 and expansion card interface 2. In this case, an additional I / O port is required from the main control module. 2 C communication port, i.e. Figure 4 The I shown 2 C2. In conjunction with the relevant content of the foregoing embodiments, the auxiliary control module monitors the level changes of the insertion detection pins of each expansion card interface. When it detects that an expansion card is inserted into any expansion card interface, it can establish a communication connection with the expansion card in accordance with the relevant content of the foregoing embodiments. The specific process will not be repeated here.

[0049] As an optional implementation, the controller provided in any of the foregoing embodiments may have its main control module implemented by a CPU (Central Processing Unit) and its auxiliary control module implemented by an FPGA (Field-Programmable Gate Array).

[0050] This application also provides an electronic device, including the controller provided in any of the foregoing embodiments.

[0051] Those skilled in the art will understand that the contents disclosed herein can be varied and modified in many ways. For example, the various devices or components described above can be implemented in hardware, or in software, firmware, or a combination of some or all of the three.

[0052] Furthermore, while this disclosure makes various references to certain elements of systems according to embodiments of this disclosure, any number of different elements may be used and operated on clients and / or servers. Elements are merely illustrative, and different aspects of the system and method may use different elements.

[0053] This disclosure uses flowcharts to illustrate the steps of a method according to embodiments of this disclosure. It should be understood that the preceding or following steps are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes.

[0054] Those skilled in the art will understand that all or part of the steps in the above methods can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium, such as a read-only memory. Optionally, all or part of the steps in the above embodiments can also be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiments can be implemented in hardware or as a software functional module. This disclosure is not limited to any particular combination of hardware and software.

[0055] Unless otherwise defined, all terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. It should also be understood that terms such as those defined in a common dictionary should be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not as having an idealized or highly formalized meaning, unless expressly defined herein.

[0056] The foregoing description is intended to illustrate the present disclosure and should not be construed as limiting it. While several exemplary embodiments of the present disclosure have been described, those skilled in the art will readily understand that many modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present disclosure. Therefore, all such modifications are intended to be included within the scope of the present disclosure as defined by the claims. It should be understood that the foregoing description is intended to illustrate the present disclosure and should not be construed as limiting it to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present disclosure is defined by the claims and their equivalents.

Claims

1. A controller, characterized in that, include: The main control module, auxiliary control module, and expansion card interface are included. The expansion card interface includes multiple signal pins and multiple address pins. When any expansion card is plugged into the expansion card interface, the level of at least one of the address pins can be changed and connected to at least one of the signal pins. The main control module includes multiple one-way communication ports, and the auxiliary control module is connected to each of the one-way communication ports and the expansion card interface respectively; In response to the insertion of a target expansion card into the expansion card interface, the auxiliary control module obtains the target device address determined based on the current level of the multiple address pins, and connects the target unidirectional communication port corresponding to the target device address to the signal pin connected to the target expansion card based on the preset correspondence between the preset device address, the unidirectional communication port, and the expansion card, so that the main control module can communicate with the target expansion card.

2. The controller according to claim 1, characterized in that, Some of the address pins are connected to the main control module, and the remaining address pins are connected to the auxiliary control module. In response to the insertion of a target expansion card into the expansion card interface, the auxiliary control module feeds back a first address determined based on the current level of the remaining address pins to the main control module; In response to the insertion of a target expansion card into the expansion card interface, the main control module determines a second address based on the current level of the partial address pins and feeds back the target device address obtained by concatenating the first address and the second address to the auxiliary control module.

3. The controller according to claim 2, characterized in that, The auxiliary control module is specifically configured as follows: In response to the insertion of a target expansion card into the expansion card interface, a first address is determined based on the current level of the remaining address pins, the first address is stored in a preset register and a first preset flag is set; The main control module is specifically configured as follows: In response to the insertion of a target expansion card into the expansion card interface, a second address is determined based on the current level of the partial address pins; When the first preset flag is set, the first address in the preset register is obtained, and the first address and the second address are concatenated to form the target device address; The target device address is stored in the preset register, and the second preset flag is set so that the auxiliary control module can obtain the target device address.

4. The controller according to claim 1, characterized in that, The expansion card interface also includes a plug-in detection pin, which can change the level of the plug-in detection pin when any expansion card is plugged into the expansion card interface. The auxiliary control module is connected to the plug-in detection pin; In response to a change in the level of the insertion detection pin, the auxiliary control module determines that a target expansion card is inserted into the expansion card interface and sends a preset notification signal to the main control module. In response to the preset notification signal, the main control module determines that a target expansion card is plugged into the expansion card interface.

5. The controller according to claim 1, characterized in that, The signal pin and the address pin are multiplexed pins.

6. The controller according to claim 5, characterized in that, The auxiliary control module includes multiple multiplexers, each of which includes multiple input terminals and one output terminal. The output terminal of each multiplexer serves as the second connection terminal of the auxiliary control module and is connected to the expansion card interface; and the output terminal of each multiplexer is connected to one of the multiplexing pins. The input terminal of each multiplexer serves as the first connection terminal of the auxiliary control module and is connected to each of the unidirectional communication ports. Each input terminal of the multiplexer is used to receive a signal corresponding to the multiplexing pin to which it is connected.

7. The controller according to any one of claims 1 to 6, characterized in that, The main control module also includes at least one bidirectional communication port, which is connected to the expansion card interface.

8. The controller according to claim 7, characterized in that, The bidirectional communication port includes I 2 C communication port; The main control module is configured to: verify whether the target device address is valid; if the target device address is invalid, then... 2 The C communication port obtains the target device address corresponding to the target expansion card and sends the target device address to the auxiliary control module. The auxiliary control module is configured to: connect the target one-way communication port corresponding to the target device address to the signal pin connected to the target expansion card based on the preset correspondence, so that the main control module can communicate with the target expansion card; The target expansion card integrates I 2 C extended I / O interface chip, the I 2 The C-type extended I / O interface chip is used to configure the target device address.

9. The controller according to claim 7, characterized in that, The bidirectional communication port includes an SDIO communication port; The SDIO communication port is connected to the expansion card interface.

10. An electronic device, characterized in that, include: The controller as described in any one of claims 1 to 9.