Disclosure of Invention
In order to achieve the above purpose, the invention adopts the following technical scheme:
The first aspect of the present invention provides an EtherCAT slave station controller based on a DSP processor, wherein the DSP processor comprises: a first interface connected to the slave station controller; and
At least three interrupt interfaces connected with the EtherCAT slave station controller; the EtherCAT slave station controller includes: a second interface connected to the first interface;
The DSP processor is configured to receive a request signal from the external equipment, which is acquired by the EtherCAT slave station controller, through the interrupt interface, and perform data interaction with the EtherCAT slave station controller through the first interface according to the request signal.
Further, the DSP processor is further configured to:
and configuring the EtherCAT slave station controller through the first interface to perform initialization setting.
Further, the DSP processor is further configured to obtain data to be read of the EtherCAT slave station controller corresponding to the request signal according to the request signal, and output the data to be read to the EtherCAT slave station controller.
Further, the EtherCAT slave station controller is further configured to acquire a synchronization signal from an external device, and output the synchronization signal to the DSP processor through the interrupt interface;
The DSP is further configured to latch the data to be read according to the synchronous signal, and output the latched data to be read in response to a next request signal acquired by the EtherCAT slave station controller.
Further, the DSP processor is a DSP28335 processor.
Further, the first interface is XINTF interfaces.
Further, the EtherCAT slave station controller is a LAN9252 slave station controller.
Further, the EtherCAT slave station controller further includes: a power interface connected with a power supply, an i2c interface connected with a memory and an external network interface connected with external equipment.
A second aspect of the present invention provides a method of communicating using the above-described secondary station controller, comprising:
Receiving a request signal of an external device to output a synchronization signal;
and carrying out data interaction with the EtherCAT slave station controller according to the synchronous signal.
Further, before receiving the request signal of the external device through the interrupt interface, the method further includes: and configuring the EtherCAT slave station controller through the first interface to perform initialization setting.
The beneficial effects of the invention are as follows:
Aiming at the existing problems, the invention provides an EtherCAT slave station controller based on a DSP processor, the first interface of the DSP processor is utilized to be connected with the EtherCAT slave station controller, the data transmission between the DSP processor and the EtherCAT slave station controller can be efficiently carried out, the EtherCAT slave station controller carries out synchronous signal transmission with the DSP processor through a plurality of interrupt interfaces, the signal transmission efficiency is effectively improved, and the slave station controller with low cost, strong universality and high configurability is realized. The EtherCAT slave station controller based on the DSP has the characteristics of high universality and low cost.
Detailed Description
In order to more clearly illustrate the present invention, the present invention will be further described with reference to preferred embodiments and the accompanying drawings. Like parts in the drawings are denoted by the same reference numerals. It is to be understood by persons skilled in the art that the following detailed description is illustrative and not restrictive, and that this invention is not limited to the details given herein.
As shown in fig. 1, one embodiment of the present invention discloses an EtherCAT slave station controller based on a DSP processor, the DSP processor comprising: a first interface connected to the slave station controller; and
At least three interrupt interfaces connected with the EtherCAT slave station controller;
the EtherCAT slave station controller includes: a second interface connected to the first interface;
The DSP processor is configured to receive a request signal from the external equipment, which is acquired by the EtherCAT slave station controller, through the interrupt interface, and perform data interaction with the EtherCAT slave station controller through the first interface according to the request signal.
In this embodiment, the first interface of the DSP processor is connected to the EtherCAT slave station controller, so that data transmission between the DSP processor and the EtherCAT slave station controller can be efficiently performed, and the EtherCAT slave station controller performs synchronous signal transmission with the DSP processor through a plurality of interrupt interfaces, so that signal transmission efficiency is effectively improved, and a slave station controller with low cost, strong universality and high configurability is realized.
In some optional implementations of this embodiment, the DSP processor is further configured to obtain, from the request signal, data to be read by the EtherCAT slave station controller corresponding to the request signal, and output the data to be read to the EtherCAT slave station controller.
In this embodiment, the EtherCAT slave station controller acquires the data to be read corresponding to the request signal, and has fast data transmission speed and high efficiency.
In some optional implementations of this embodiment, the EtherCAT slave station controller is further configured to obtain a synchronization signal from an external device, and output the synchronization signal to the DSP processor through the interrupt interface;
The DSP is further configured to latch the data to be read according to the synchronous signal, and output the latched data to be read in response to a next request signal acquired by the EtherCAT slave station controller.
In the embodiment, the synchronous signal is rapidly output from the EtherCAT slave station controller to the DSP processor through three interrupt interfaces, so that the cost is low and the configurability is high.
In one specific example, fig. 2 shows a schematic diagram of the framework of the interrupt interface of the LAN9252 slave controller, through which pins 18 and 34 acquire SYNC0 synchronization signals from the DSP28335 processor for transmission of data to be read.
In a specific example, fig. 4 is a schematic diagram of an interrupt interface of the DSP28335 processor, through which a synchronization signal and a request signal are transmitted.
In some alternative implementations of the present embodiment, the DSP processor is a DSP28335 processor.
In some optional implementations of this embodiment, the first interface is a XINTF interface. In one specific example, the XINTF interface of the DSP28335 processor is shown in fig. 3.
In some alternative implementations of this embodiment, the EtherCAT slave station controller is a LAN9252 slave station controller.
In this embodiment, the DSP288335 processor is a general control processor in the market, which has the advantages of low cost and abundant peripheral resources, and the LAN9252 slave station controller can adapt to the EtherCAT communication interface in the market. Therefore, the present embodiment connects to the LAN9252 slave station controller through the XINTF interface (custom peripheral parallel interface) of the DSP28335 processor, which realizes efficient data transmission and has extremely high configurability and versatility.
In some optional implementations of this embodiment, the EtherCAT slave station controller further includes: a power interface connected with a power supply, an i2c interface connected with a memory and an external network interface connected with external equipment.
In one specific example, as shown in FIG. 1, the power interface is connected to the power supply of the EtherCAT slave controller, and the i2c interface interfaces with EEPROM memory. The EEPROM memory is used to store configuration information of the EtherCAT slave station controller, for example: device ID, interrupt time, device number, etc.
The process of communication by the slave station controller of this embodiment is as follows:
S10, the DSP processor configures the LAN9252 slave station controller through XINTF interface to perform initialization setting. The initialization includes configuring the device ID, device identification, communication period, mailbox identification, etc. of the EtherCAT slave station controller. In one specific example, configuration information for the initialization settings is stored in EEPROM memory that interfaces with LAN9252 slave station controller i2 c.
S20, waiting for an IRQ request signal after the initialization configuration is completed, and obtaining the IRQ request signal of external equipment by the LAN9252 from the station controller through an external network port interface and outputting the IRQ request signal to the DSP processor through an interrupt interface;
The DSP28335 processor reads the data to be read in the LAN9252 slave station controller corresponding to the IRQ request signal through the XINTF interface according to the request signal, and outputs the data to be read to the LAN9252 slave station controller.
S40, the LAN9252 slave station controller obtains SYNC0 synchronous signals of external equipment through an external network port interface, and outputs the SYNC0 synchronous signals to the DSP28335 processor through an interrupt interface;
and S50, the DSP28335 processor latches the data to be read according to the SYNC0 synchronizing signal and outputs the latched data to be read according to a next IRQ request signal acquired by the LAN9252 from the station controller, so that the whole communication process is realized.
The first interface of the DSP processor is connected with the EtherCAT slave station controller, so that data transmission between the DSP processor and the EtherCAT slave station controller can be efficiently performed, the DSP processor performs signal transmission with external equipment through a plurality of interrupt interfaces, the signal transmission efficiency is effectively improved, and the slave station controller with low cost, strong universality and high configurability is realized. The EtherCAT slave station controller based on the DSP has the characteristics of high universality and low cost.
Corresponding to the EtherCAT slave station controller based on the DSP processor provided in the present embodiment, a second embodiment of the present invention further provides a method for performing communication by using the EtherCAT slave station controller based on the DSP processor, where the method includes:
configuring the EtherCAT slave station controller through the first interface to perform initialization setting;
And receiving a request signal of external equipment through the interrupt interface, and carrying out data interaction with the EtherCAT slave station controller through the first interface according to the request signal.
In the communication process, the first interface of the DSP processor is connected with the EtherCAT slave station controller, so that data transmission between the DSP processor and the EtherCAT slave station controller can be efficiently carried out, the EtherCAT slave station controller carries out synchronous signal transmission with the DSP processor through a plurality of interrupt interfaces, the signal transmission efficiency is effectively improved, and the slave station controller with low cost, strong universality and high configurability is realized. The EtherCAT slave station controller based on the DSP has the characteristics of high universality and low cost.
It should be understood that the foregoing examples of the present invention are provided merely for clearly illustrating the present invention and are not intended to limit the embodiments of the present invention, and that various other changes and modifications may be made therein by one skilled in the art without departing from the spirit and scope of the present invention as defined by the appended claims.