[0040] A further description will be given below with reference to the drawings and specific embodiments.
[0041] Such as figure 1 As shown, this embodiment provides an online upgrade method for multiple CPLDs, which is used to upgrade the firmware of one or more CPLDs, and the method includes the steps:
[0042] S1: Configure a type setting circuit for each CPLD to mark the type value of the corresponding CPLD;
[0043] S2: Configure an SPI interface for the CPLD;
[0044] S3: Send type information to the multiple CPLDs through the SPI interface;
[0045] S4: After receiving the type information, the CPLD judges whether the type value of the type information itself is consistent;
[0046] S5: if yes, enable the connection between the internal memory of the CPLD and the SPI interface;
[0047] S6: Download the CPLD firmware upgrade program, and write into the internal memory through the SPI interface.
[0048] Generally, when designing and configuring multiple CPLDs, it is necessary to connect a main control unit to the multiple CPLDs to form a digital integrated circuit system. In this embodiment, the main control unit uses a serial slave interface to connect each CPLD connection realizes signal transmission and data writing.
[0049] When configuring multiple CPLDs, the first problem encountered is how to quickly find the CPLD device that needs to be configured, and how to make the corresponding CPLD device respond quickly. Traditionally, when reading and writing multiple chips or devices, chip selection signal lines are usually used to send chip selection signals. Each chip or device is connected to the main control unit through a chip selection signal line, which will cause problems such as complicated connections and messy wiring. . The solution adopted in this embodiment is to configure a type setting circuit for each CPLD to mark the type value of the CPLD corresponding to it, and the type value is equivalent to the "house number" of the CPLD.
[0050] The marking step is to connect the type setting circuit to a specific pin of the CPLD, and set the level of the pin so that the level of the pin of each CPLD is different, so as to realize the type of the CPLD The mark of the value.
[0051] When it is necessary to upgrade the firmware of the CPLD, first, the main control module loads a support program for each CPLD through the serial slave interface. The support program can configure the serial slave interface as an SPI interface to facilitate reading and writing operations on the CPLD .
[0052] Then, the main control unit sends the type information to the aforementioned multiple CPLDs through the SPI interface. Specifically, the main control unit can directly write the type words corresponding to the device to be upgraded to all CPLDs through the SPI interface. After each CPLD receives the type word, it compares it with its own type value to determine whether the two are consistent. If so, enable the connection between the CPLD's internal memory and the SPI interface, that is, open the SPI interface and The communication channel of the internal memory for the main control unit to write data; otherwise, perform the following steps:
[0053] S55: Disable the connection between the internal memory of the CPLD and the SPI interface to isolate the internal memory from the SPI interface.
[0054] Finally, the main control unit has the function of supporting program download. The above-mentioned supporting program supports SPI timing. The SPI timing supports the main control unit to write the firmware program into the internal memory of the CPLD through the SPI interface to complete the firmware upgrade of the CPLD.
[0055] In this way, the firmware upgrade of one or more of all CPLDs in the system can be realized, and only the type words written in need to be modified, which is very convenient. Moreover, because the existing connection lines are fully utilized in the entire upgrade process, without any addition or any interface and connection, the firmware upgrade of one or more CPLDs is realized without changing the original connection mode, which is truly realized Simplified connection and online upgrade, and each CPLD does not interfere with each other, and can be flexibly configured, which improves the convenience and operation efficiency of the upgrade.
[0056] Reference figure 2 with image 3 As shown, this embodiment correspondingly provides a multiple CPLD online upgrade device 100, which is used to upgrade the firmware of one or more CPLDs, and the device includes:
[0057] The type configuration module 10 is used to configure a type setting circuit 300 for each CPLD 200 to mark the type value corresponding to the CPLD 200;
[0058] The interface configuration module 20 is used to configure an SPI interface for the CPLD 200;
[0059] The type writing module 30 is configured to send type information to the multiple CPLDs 200 through the SPI interface;
[0060] The verification module 40 is configured to, after the CPLD 200 receives the type information, determine whether the type value of the type information itself is consistent;
[0061] The enabling module 50 is configured to enable the connection between the internal memory 210 of the CPLD 200 and the SPI interface if the type value of the type information itself is consistent;
[0062] The firmware upgrade module 60 is used to download a CPLD firmware upgrade program and write it into the internal memory 210 through the SPI interface.
[0063] Generally, when designing and configuring multiple CPLDs 200, it is necessary to connect a main control unit 400 to the multiple CPLDs 200 respectively to form a digital integrated circuit system. In this embodiment, the main control unit 400 uses a serial slave The interface is connected to each CPLD 200 to realize signal transmission and data writing.
[0064] The type setting circuit 300 is connected to the pins of the CPLD 200, and sets the level of the pins to mark the type value of the CPLD.
[0065] The interface configuration module 20 is specifically configured to:
[0066] A support program is respectively loaded for the multiple CPLDs 200 through a serial slave interface, and the support program configures the serial slave interface as an SPI interface.
[0067] The enabling module 50 is also used for:
[0068] If the type value of the type information itself is inconsistent, then the connection between the internal memory of the CPLD and the SPI interface is disabled to isolate the internal memory from the SPI interface.
[0069] The function and principle of the multi-CPLD online upgrade device of this embodiment can be referred to figure 1 The details of the illustrated embodiment will not be repeated.
[0070] To sum up, the present invention configures the type setting circuit and SPI interface for each CPLD, and uses the main control unit to write type information, so that each CPLD compares whether the type information currently written is consistent with its own type value and judges whether For the upgrade target, if it is, the firmware upgrade program is written into the internal memory of the CPLD through SPI to realize the firmware upgrade. The present invention utilizes the existing main control unit and multiple CPLDs and other hardware modules in the system, and does not need to increase the loading interface and chip selection signal line to realize the online upgrade of one or more CPLDs, and each CPLD can be flexibly configured .
[0071] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, All should be considered as the scope of this specification.
[0072] The above-mentioned embodiments only express several implementation modes of the present invention, and their description is more specific and detailed, but they should not be understood as a limitation to the patent scope of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can be made, and these all fall within the protection scope of the present invention.