EMIF bus control method suitable for dual-core DSP controller
By configuring EMIF bus permissions and establishing a transit data link, the problem of complex permission alternation in dual-core DSP controllers is solved, more efficient communication and stability are achieved, and the control system performance of wind power converters is improved.
Patent Information
- Application Number
- CN202410950377.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-15
AI Technical Summary
When a dual-core DSP controller communicates with external devices through the EMIF bus, read and write permissions can only be assigned to one CPU core, resulting in a complex permission alternation mechanism, affecting data real-time and system stability.
By configuring the read and write permissions of the EMIF bus to CPU1, and establishing a transit communication data link between CPU1 and CPU2 based on the DMA module, using the GPIO module to trigger external interrupts, so that the communication data of CPU2 can be transmitted to the interface board through the EMIF bus, avoiding permissions Alternately, the DMA module is used to complete the data transmission.
It simplifies the alternate configuration of permissions between dual cores, improves system stability and communication efficiency, and improves the performance of the overall control system.
Smart Images

Figure CN118964273A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of power electronics, and in particular to an EMIF bus control method suitable for a dual-core DSP controller. Background Art
[0002] With the rapid development of wind power generation and the gradual increase in the power level of wind turbines, the wind power converter with modular architecture has gradually replaced the original topology. At present, the entire wind power converter is composed of multiple modular machines in parallel, and the modular machines are independent of each other. Since multiple modular machines are independent sub-modules, they need to have independent sampling loops, wave generation mechanisms, and fault protection functions for single modules. The fault protection function is implemented through the interface board, among which the communication mechanism between the interface board and the main control board is an important part of the modular architecture converter.
[0003] In the prior art, the main control board usually adopts the TMS320F28377D series dual-core DSP controller, which includes two CPU cores, including CPU1 core and CPU2 core, CPU1 core is responsible for logic control, and CPU2 core is responsible for algorithm control. Considering that the parallel port EMIF bus has a faster communication rate, it is chosen to communicate through the bus, that is, both CPU cores need to exchange data with the chip of the external device through the EMIF bus, but the read and write permissions of the EMIF bus can only be assigned to one of the CPU cores, and the other CPU core has only read permissions, resulting in a more complicated permission alternation mechanism of the EMIF bus between the dual-core CPUs when communicating through the EMIF bus. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide an EMIF bus control method suitable for a dual-core DSP controller, when communicating with an external device via the EMIF bus, the two CPU cores included in the dual-core DSP controller do not need to alternate permissions. The method is suitable for the dual cores to have a scheduled bus access requirement, avoiding the complicated permission alternation configuration between the dual cores, and at the same time avoiding the data real-time problem caused by the bus permission alternation, effectively improving the stability of the overall control system.
[0005] In a first aspect, an embodiment of the present invention provides an EMIF bus control method applicable to a dual-core DSP controller, characterized in that it includes:
[0006] S1: Configure the read and write permissions of the EMIF bus to CPU1 in the dual-core DSP controller;
[0007] S2: Based on the first DMA module, a transit communication data link is established between the CPU1 and the CPU2;
[0008] S3: configuring a trigger source for the first DMA module, wherein the trigger source includes a second GPIO module;
[0009] S4: When the CPU2 is ready to communicate data with the interface board through the EMIF bus, the second GPIO module triggers a flip and triggers an external interrupt;
[0010] S5: The external interrupt triggers the first DMA module and the second DMA module, and transmits the communication data in the communication data buffer area to the EMIF bus address.
[0011] Preferably, based on the transit data link, the communication data of the CPU2 can be transmitted to the 16-bit data address corresponding to the external device of the FPGA module in the interface board through the EMIF bus using the first DMA module.
[0012] Preferably, when the CPU1 is initialized, an authority is configured for the second GPIO module.
[0013] Preferably, the communication data cache area includes a first data cache area and a second data cache area; the first data cache area is a shared memory data area established between the CPU1 and the CPU2, and is used to store communication data transmitted between the CPU2 and the FPGA module in the interface board, and the second data cache area is used for the FPGA module to receive and send the communication data.
[0014] Preferably, the first data cache area includes a fast data cache area and a slow data cache area, the fast data cache area is triggered based on the first DMA module, and the slow data cache area is triggered based on the second DMA module.
[0015] Preferably, each module machine corresponds to one first data cache area, and data interaction is completed between the plurality of module machines through the first data cache areas corresponding to the respective module machines.
[0016] Preferably, the second data cache area includes a write data area and a read data area, the write data area is used for the FPGA module to receive the communication data sent by the dual-core DSP controller, and the read data area is used to receive the communication data sent by the dual-core DSP controller in a specified address space.
[0017] Preferably, the communication data buffer area is provided with a data length and a check code, and the storage size of the communication data buffer area is n groups of 4 bytes.
[0018] Preferably, the dual-core DSP controller is a 32-bit floating-point microcontroller of the TMS320F28377D series.
[0019] The beneficial effects of the present invention are as follows:
[0020] The present invention adopts parallel port EMIF bus communication technology to replace the existing commonly used serial port solution, has a faster communication transmission rate, and is particularly suitable for multi-module machine architecture wind power converters. The present invention avoids the complicated permission alternation configuration between the dual cores when the dual-core DSP controller of the TMS320F28377D series needs to communicate with the peripherals through the EMIF bus. The method provided by the present invention adopts a DMA module that does not consume CPU resources to complete the communication between the EMIF bus and the external device, which greatly saves CPU resources and communication efficiency, and effectively improves the stability of the overall control system.
[0021] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0022] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A schematic flow chart of an EMIF bus control method applicable to a dual-core DSP controller provided by an embodiment of the present invention;
[0025] Figure 2 A schematic diagram of the structure of CPU1, CPU2 and EMIF bus of an EMIF bus control method applicable to a dual-core DSP controller provided by an embodiment of the present invention;
[0026] Figure 3 A schematic diagram of the location of a communication data buffer area of an EMIF bus control method applicable to a dual-core DSP controller provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] The technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.
[0029] Embodiment 1:
[0030] S1: Configure the read and write permissions of the EMIF bus to CPU1 in the dual-core DSP controller;
[0031] S2: Based on the first DMA module, a transit communication data link is established between CPU1 and CPU2;
[0032] S3: configuring a trigger source for the first DMA module, where the trigger source includes a second GPIO module;
[0033] S4: When CPU2 is ready to communicate data with the interface board through the EMIF bus, the second GPIO module triggers a flip and triggers an external interrupt;
[0034] S5: The external interrupt triggers the first DMA module and the second DMA module, and the communication data in the communication data buffer area is migrated to the EMIF bus address.
[0035] Combination Figure 1 , the following are the specific instructions for the above steps:
[0036] First, it should be noted that, in this embodiment, the dual-core DSP (Digital Signal Process) chip includes two independent processors, namely, CPU1 and CPU2; and the EMIF bus is specifically a parallel port EMIF bus. Figure 2 It is a structural diagram of CPU1, CPU2 and EMIF bus.
[0037] Furthermore, the fast DMA module based on the control authority of CPU1 is the first DMA module, the slow DMA module based on the control authority of CPU1 is the second DMA module; the GPIO module based on the control authority of CPU2 is the second GPIO module.
[0038] S1: Configure the read and write permissions of the EMIF bus to CPU1 in the dual-core DSP controller.
[0039] Among them, the reasons for configuring the read and write permissions of the EMIF bus to CPU1 in the dual-core DSP controller include: 1. The functions of CPU1 and CPU2 are different. CPU1 has data read and write functions, and CPU2 has data read-only functions; 2. The priority relationship between CPU1 and CPU2 in occupying the EMIF bus is different; 3. During the operation of the converter, CPU1 needs to interact with multiple chips such as SRAM chips, NandFlash chips, and W5300 chips in real time for data.
[0040] S2: Based on the first DMA module, a transfer data link is established between CPU1 and CPU2.
[0041] Preferably, based on the transit data link, the communication data of the CPU2 can be transmitted to the 16-bit data address corresponding to the external device of the FPGA module in the interface board through the EMIF bus using the first DMA module.
[0042] Among them, the first DMA module can realize the function of fast communication data migration from the data source address to the target address without occupying CPU resources; the communication data content of CPU2 includes data communication count value, data communication length, control word, comparison value, non-real-time parameters, etc., which are used to send the control quantity calculated by CPU2 to the interface board through communication to execute related control logic.
[0043] S3: configuring a trigger source for the first DMA module, where the trigger source includes the second GPIO module.
[0044] The trigger sources include: a second GPIO module, an ADC peripheral trigger, and an EPWM peripheral trigger. In this embodiment, the second GPIO module is used as the trigger source of the first DMA module.
[0045] Preferably, when CPU1 is initialized, an authority is configured for the second GPIO module.
[0046] In this embodiment, the authority parties include CPU1, CLA module in CPU1, CPU2, and CLA module in CPU2. When one of the authority parties is selected as the second GPIO module configuration, the control core that can know the authority of the current second GPIO module is the CPU core or the CLA core.
[0047] Among them, by configuring the trigger source second GPIO module for the first DMA module and configuring the level signal for the pin of the second GPIO module, a fast communication data link is established between CPU2 and the interface board, thereby realizing the transmission of communication data at any time, avoiding the formation of a complex communication interaction mechanism between CPU1 and CPU2, and effectively improving communication efficiency.
[0048] S4: When CPU2 is ready to communicate data with the interface board through the EMIF bus, the second GPIO module triggers a flip and triggers an external interrupt.
[0049] In this embodiment, before CPU2 communicates data with the interface board, CPU2 needs to complete the execution of all control programs and output the final modulation voltage comparison value. At the same time, the modulation voltage comparison value and the remaining communication content are sent to the interface board through communication to generate a PWM wave, and the calculation frequency is once for each control cycle.
[0050] S5: The external interrupt triggers the first DMA module and the second DMA module, and the communication data in the communication data buffer area is migrated to the EMIF bus address.
[0051] Combination Figure 3 Preferably, the communication data cache area includes a first data cache area and a second data cache area; the first data cache area is a shared memory data area established between CPU1 and CPU2, which is used to store communication data transmitted between CPU2 and the FPGA module in the interface board, and the second data cache area is used for the FPGA module to receive and send communication data.
[0052] It should be noted that, in this embodiment, a Globle Shared RAM (GS RAM) is provided in the TMS320F28377D chip, and the storage size is 16*4k*16; the GS RAM can be evenly divided into 16 memory slices according to the storage size, namely GS0-GS15. Based on this, the shared memory data area is a memory slice of the Globle Shared RAM (GS RAM), and the storage size of the memory slice is 16*4k.
[0053] Furthermore, the first data cache area includes a fast data cache area and a slow data cache area, the fast data cache area is triggered based on the first DMA module, and the slow data cache area is triggered based on the second DMA module.
[0054] In this embodiment, combined with Figure 3 , the number of first data cache areas is 6, the number of fast data cache areas is 1, and the number of slow data cache areas is 5.
[0055] Furthermore, each module machine corresponds to a first data cache area, and data interaction is completed between multiple module machines through the first data cache areas corresponding to each module machine.
[0056] The advantage of the first data buffer area is that it can be shared by CPU1 and CPU2 at the same time. When CPU2 modifies the communication data in the first data buffer area, CPU1 can read the modified communication data in the first data buffer area at the same time.
[0057] Furthermore, the second data buffer area includes a write data area and a read data area. The write data area is used for the FPGA module to receive communication data sent by the dual-core DSP controller, and the read data area is used to receive communication data sent by the dual-core DSP controller in a specified address space.
[0058] In this embodiment, the designated address space is a dedicated address area for read data after planning; Figure 3 The number of write data areas and read data areas are 6 respectively.
[0059] Preferably, the communication data buffer area is provided with a data length and a check code, and the storage size of the communication data buffer area is n groups of 4 bytes.
[0060] Preferably, the dual-core DSP controller is a 32-bit floating-point microcontroller of the TMS320F28377D series.
[0061] In this embodiment, the data length is used to prevent the CPU and DMA resources from being occupied when processing useless data, thereby affecting the program execution time and the EMIF bus occupancy rate; the check code is used to perform CRC check on the sent and received data to ensure the validity of the data;
[0062] Furthermore, 4 bytes is the size of a single buffer, 2 bytes of which are used to send data, and the other 2 bytes are used to receive data; n is the multiplication factor, n∈{1,2,...,20}, when n is 20, the communication data can be oversampled, that is, a 20-fold oversampling circular queue is supported.
[0063] Based on the above technical solution, the data interaction mechanism between CPU2 and the FPGA module in the interface board can be realized, and the DMA module in CPU1 can be used for data transfer. CPU1 with EMIF bus read and write permissions is used as the control core to realize data transfer. Data transfer can be completed without CPU intervention, which effectively saves CPU resources.
[0064] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. An EMIF bus control method applicable to a dual-core DSP controller, characterized in that: include: S1: Configure the read and write permissions of the EMIF bus to CPU1 in the dual-core DSP controller; S2: Based on the first DMA module, a transit communication data link is established between the CPU1 and the CPU2; S3: configuring a trigger source for the first DMA module, wherein the trigger source includes a second GPIO module; S4: When the CPU2 is ready to communicate data with the interface board through the EMIF bus, the second GPIO module triggers a flip and triggers an external interrupt; S5: The external interrupt triggers the first DMA module and the second DMA module, and transmits the communication data in the communication data buffer area to the EMIF bus address.
2. The EMIF bus control method applicable to a dual-core DSP controller according to claim 1, characterized in that: Based on the transit data link, the communication data of the CPU2 can be transmitted to the 16-bit data address corresponding to the external device of the FPGA module in the interface board through the EMIF bus using the first DMA module.
3. The EMIF bus control method applicable to a dual-core DSP controller according to claim 1, characterized in that: When the CPU1 is initialized, an authority party is configured for the second GPIO module.
4. The EMIF bus control method applicable to a dual-core DSP controller according to claim 1, characterized in that: The communication data cache area includes a first data cache area and a second data cache area; the first data cache area is a shared memory data area established between the CPU1 and the CPU2, used to store communication data transmitted between the CPU2 and the FPGA module in the interface board, and the second data cache area is used for the FPGA module to receive and send the communication data.
5. The EMIF bus control method applicable to a dual-core DSP controller according to claim 4, characterized in that: The first data cache area includes a fast data cache area and a slow data cache area. The fast data cache area is triggered based on the first DMA module, and the slow data cache area is triggered based on the second DMA module.
6. The EMIF bus control method applicable to a dual-core DSP controller according to claim 4, characterized in that: Each module machine corresponds to one first data cache area respectively, and data interaction is completed between the plurality of module machines through the first data cache areas corresponding to the module machines.
7. The EMIF bus control method applicable to a dual-core DSP controller according to claim 4, characterized in that: The second data buffer area includes a write data area and a read data area. The write data area is used by the FPGA module to receive the communication data sent by the dual-core DSP controller, and the read data area is used to receive the communication data sent by the dual-core DSP controller in a specified address space.
8. The EMIF bus control method applicable to a dual-core DSP controller according to claim 1, characterized in that: The communication data buffer area is provided with a data length and a check code, and the storage size of the communication data buffer area is n groups of 4 bytes.
9. The EMIF bus control method applicable to a dual-core DSP controller according to claim 1, characterized in that: The dual-core DSP controller is a 32-bit floating-point microcontroller of the TMS320F28377D series.
