Background technology
Development along with embedded system technology, in communication products, include CPU (central processing unit mostly, Central Processing Unit) and programmable logic device (PLD) EPLD (Erasable ProgrammableLogic Device, but can wipe the editorial logic device) etc.The CPU of embedded device for compunication, or embedded system need link to each other with computing machine by serial ports in order to accept the configuration of computing machine, and the big more options RJ45 interface of interface that connects.
As shown in Figure 1, provided the block diagram of current selection RJ45 as the embedded system inside of serial communication.Include 8 in the RJ45 interface and connect pin, in serial communication, many uses pin 4 or 5 wherein is as signal ground GND, and perhaps 4 and 5 two pins are simultaneously as signal ground GND, use pin 3 as sending signal wire TX, use pin 6 as received signal line RX.Therefore, in embedded system, also have 4 or 5 pins not to be used among the RJ45, be in idle condition.In Fig. 1, pin 4 and 5 then has 4 pins to be in idle condition during simultaneously as signal ground GND.
Simultaneously, embedded system inside includes programmable logic device (PLD) EPLD mostly.The program of these programmable logic device (PLD) is downloaded, and is main at present by the realization of the download gang socket on the pcb board of internal system.In Fig. 1, the download socket of programmable logic device (PLD) and serial communication connector RJ45 separate, and both independently exist.Need download or during ROMPaq in programmable logic device (PLD), usually embedded device need be descended electricity, and shell is taken apart, the download cable that will link to each other with computing machine is connected to be downloaded in the gang socket, power on then, download to programmable logic device (PLD) by computing machine.After download is finished, equipment is electric down, pull out the download cable from downloading socket, re-assemblied equipment, re-power operation.
This shows, download to programmable logic device (PLD) in the existing embedded device or during ROMPaq, operate more loaded down with trivial details, but also the operation that needs to cut off the power supply, unpack etc. and waste time and energy, and for using the equipment of RJ45 as serial communication such as the use programmable logic device (PLD), communication network device such as switch, router for example, this power-on and power-off operation may cause communication or network interrupts.
Summary of the invention
Technical matters to be solved by this invention is, provide embedded device to reach the wherein method that downloads of programmable logic device (PLD), problems such as it is unpacking to cut off the power supply when solving the downloading of programmable logic device (PLD) in the existing embedded device, the download of easy realization programmable logic device (PLD).
In order to address the above problem, the present invention proposes a kind of embedded device, comprise CPU, programmable logic device (PLD), the RJ45 serial port connector, wherein:
The download signal line of described programmable logic device (PLD) is connected to RJ45 serial port connector idle pin;
The signal ground GND of described programmable logic device (PLD) is connected with the signal ground GND of RJ45 serial port connector.
The download signal line of described programmable logic device (PLD) adopts direct connected mode to be connected to RJ45 serial port connector idle pin; Perhaps, the download signal line of described programmable logic device (PLD) is connected to RJ45 serial port connector idle pin by gating circuit.
The download signal line TCK of described programmable logic device (PLD) is connected to the 1st pin of RJ45 serial port connector; The download signal line TMS of described programmable logic device (PLD) is connected to the 2nd pin of RJ45 serial port connector; The download signal line TDI of described programmable logic device (PLD) is connected to the 7th pin of RJ45 serial port connector; The download signal line TDO of described programmable logic device (PLD) is connected to the 8th pin of RJ45 serial port connector; Signal ground GND on the 4th and/or the 5th pin of the signal ground GND of described programmable logic device (PLD) and RJ45 serial port connector is connected.
Described gating circuit is a kind of in triode or metal-oxide-semiconductor or electronic switch or relay or the logic chip.The control signal DCL of described gating circuit is controlled by programmable logic device (PLD), perhaps by CPU control, is perhaps controlled by other logical circuit.
When the control signal DCL of described gating circuit is closure state, the gating circuit closure, programmable logic device (PLD) is communicated with the RJ45 serial port connector, but receiving computer downloads to it;
When the control signal DCL of described gating circuit was off-state, gating circuit disconnected, and the programmable logic device (PLD) disconnection is communicated with the RJ45 serial port connector.
The method that the present invention also provides the programmable logic device (PLD) in a kind of embedded device to download comprises:
The download signal line of programmable logic device (PLD) is connected to RJ45 serial port connector idle pin; The signal ground GND of programmable logic device (PLD) is connected with the signal ground GND of RJ45 serial port connector;
Outer computer is connected with the RJ45 serial port connector, and program programmable logic device (PLD) is required by the RJ45 serial port connector is downloaded to programmable logic device (PLD).
The download signal line of described programmable logic device (PLD) adopts direct connected mode to be connected to RJ45 serial port connector idle pin; Perhaps, the download signal line of described programmable logic device (PLD) is connected to RJ45 serial port connector idle pin by gating circuit.
The download signal line TCK of described programmable logic device (PLD) is connected to the 1st pin of RJ45 serial port connector; The download signal line TMS of described programmable logic device (PLD) is connected to the 2nd pin of RJ45 serial port connector; The download signal line TDI of described programmable logic device (PLD) is connected to the 7th pin of RJ45 serial port connector; The download signal line TDO of described programmable logic device (PLD) is connected to the 8th pin of RJ45 serial port connector; Signal ground GND on the 4th and/or the 5th pin of the signal ground GND of described programmable logic device (PLD) and RJ45 serial port connector is connected.
When the download signal line of described programmable logic device (PLD) is connected directly to RJ45 serial port connector idle pin, if need download, then:
Elder generation's device powers down, the download cable that will be connected with computing machine inserts in the RJ45 serial port connector, makes download signal line TCK, TMS, TDI, TDO and GND be communicated with, and after re-powering, finishes download or upgrading to programmable logic device (PLD).
When the download signal line of described programmable logic device (PLD) is connected to RJ45 serial port connector idle pin by gating circuit, if need download, then:
The download cable that will be connected with computing machine is inserted on the RJ45 serial port connector of embedded device earlier, by the computer by serial output command, make CPU output gate-control signal DCL, make gate controlled switch all be in closure state, realize that programmable logic device (PLD) is communicated with the RJ45 serial port connector;
Afterwards, computing machine downloads to programmable logic device (PLD) by parallel port output programmable logic device (PLD), realizes programmable logic device (PLD) is downloaded or upgrading;
At last,, make CPU change gate-control signal DCL, make gate controlled switch all be in off-state, realize the disconnection of programmable logic device (PLD) and RJ45 serial port connector by the computer by serial output command.
In the prior art, because the download socket of programmable logic device (PLD) is on the PCB of device interior, for programmable logic device (PLD) downloads or during ROMPaq, operate more loaded down with trivial details, need outage to unpack and wait the operation of wasting time and energy, neither utilize and produce, also do not utilize maintenance.Compared with prior art, the present invention utilizes 4 idle among serial port connector RJ45 pins as programmable logic device (PLD) download signal line TCK, TMS, TDI and TDO, the signal ground GND that the signal ground GND that utilizes serial ports to use downloads as programmable logic device (PLD) has directly realized the program of programmable logic device (PLD) is downloaded and upgrading on serial port connector RJ45.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with accompanying drawing.
Use in the embedded device or network equipment system of RJ45 as serial communication in order to solve, the inconvenience problem that the programmable logic device (PLD) program is downloaded or upgrading must be cut off the power supply and unpack can be utilized the download signal line of 4 idle among serial port connector RJ45 pins as programmable logic device (PLD).When needs are downloaded the programmable logic device (PLD) program, need not to be connected on the socket on the PCB, so need not open the casing of equipment again downloading cable.Only need be connected on the serial port connector RJ45, can finish download, even under the situation that need not close tester in power-down state, finish download, support hot swap characteristics the programmable logic device (PLD) program with downloading cable.By above-mentioned improvement, serial port connector RJ45 has the dual-use function of the program download of serial communication and programmable logic device (PLD) concurrently, neither influences the function of serial ports, has made things convenient for again the programmable logic device (PLD) program is downloaded.
Particularly, utilize exactly among the serial port connector RJ45 4 idle pins as programmable logic device (PLD) download signal line (these download signal are: TCK, TMS, TDI, TDO); Utilize the signal ground GND that the employed signal ground GND of serial communication among the serial port connector RJ45 downloads as programmable logic device (PLD) (promptly with the shared RJ45 of serial ports in the 4th and/or 5 pins on signal ground GND).
Wherein, the signal wire between serial port connector RJ45 and the programmable logic device (PLD) can directly connect, and also can increase the control of gating circuit, connects indirectly by gating circuit.Described gating circuit can be a kind of in triode, metal-oxide-semiconductor, electronic switch, relay or the logic chip.The control signal DCL of gating circuit can be controlled by programmable logic device (PLD), also can be controlled by CPU, is perhaps controlled by other logical circuit.
Fig. 4 has provided a kind of connection cable that embedded device is connected to computer terminal, and this connection cable is used to be connected between computing machine and the serial ports, and it is 1 cable, tells two interfaces near computing machine one end, is respectively serial port connector and parallel port connector.Wherein, serial port connector connects on the pin 3,6,4 of RJ45 connector, and parallel port connector connects on the pin 1,2,5,7,8 of RJ45 connector.
The present invention gives the another kind of connection cable that embedded device is connected to computer terminal.Comprising two cables, be respectively serial ports cable shown in Figure 5 and parallel port cable shown in Figure 6, these two cables are independent.The pin 3,6,4 and 5 of the crystal head of serial ports cable shown in Figure 5 is connected on the computer by serial; The pin 1,2,4 and 5,7,8 of the crystal head of parallel port cable shown in Figure 6 is connected on the parallel port of computing machine.
Embodiment 1
As shown in Figure 2, utilize 4 idle among serial port connector RJ45 pins as programmable logic device (PLD) download signal line TCK, TMS, TDI and TDO, the signal ground GND that the signal ground GND that utilizes serial ports to use downloads as programmable logic device (PLD) has realized directly on serial port connector RJ45 the program of programmable logic device (PLD) being downloaded and upgrading.
Under direct-connected application scenarios shown in Figure 2, when needing to download the program of programmable logic device (PLD), only these 5 signal wires (TCK, TMS, TDI, TDO and GND) that the respective signal line of downloading in the cable need be connected among the serial port connector RJ45 upward get final product.And serial communication still uses 4 pins (having only three kinds of signal: TX, RX and GND) among the original RJ45.
When needing to download the program of programmable logic device (PLD), under the situation of device powers down, the crystal head of downloading cable among Fig. 4 is inserted among the serial port connector RJ45 of Fig. 2, has realized the connection of 5 download signal line TCK, TMS, TDI, TDO and GND.After powering on, just can realize download or upgrading to programmable logic device (PLD).
After download is finished, need close the power supply of embedded device, pull up the RJ45 connector on the cable on the serial port connector RJ45 of slave unit, re-power then, equipment can normally move.In this case, the structure that is more suitable for using the parallel port cable shown in the serial ports cable shown in Fig. 5 and Fig. 6 independently to separate.
Embodiment 2
As shown in Figure 3, utilize 4 idle among serial port connector RJ45 pins as programmable logic device (PLD) download signal line TCK, TMS, TDI and TDO, the signal ground GND that the signal ground GND that utilizes serial ports to use downloads as programmable logic device (PLD), the signal wire of while between serial port connector RJ45 and programmable logic device (PLD), increase gating circuit, four switch S 1 of gating circuit control, S2, S3, S4.
Described gating circuit can be a kind of in triode, metal-oxide-semiconductor, electronic switch, relay or the logic chip.The control signal DCL of gating circuit can be controlled by programmable logic device (PLD), also can be controlled by CPU, is perhaps controlled by other logical circuit.Four switch S 1 of gate-control signal DCL control, S2, S3, S4 closure or disconnection.
For example, when the control signal DCL of gating circuit is controlled by CPU, if CPU output gate-control signal DCL makes four switch S 1, S2, S3, when S4 is in closure state, programmable logic device (PLD) has just realized and being communicated with of RJ45, can it have been downloaded receiving computer; If CPU output gate-control signal DCL makes four switch S 1, S2, S3, when S4 is in off-state, programmable logic device (PLD) just disconnects and being communicated with of RJ45, and can not it be downloaded receiving computer.
During concrete enforcement,, under the situation that does not need to cut off the power supply, can finish by following flow process and download or upgrading if the user need carry out program download or upgrading to programmable logic device (PLD):
At first, the RJ45 connector of the serial ports cable (also being the parallel port cable) that computing machine among Fig. 4 is connected is inserted on the serial ports RJ45 of embedded device;
Then, by the computer by serial output command, make CPU output gate-control signal DCL, gate-control signal DCL makes four switch S 1, S2, S3, S4 be in closure state, and the realization programmable logic device (PLD) is communicated with RJ45's;
Afterwards, computing machine downloads to programmable logic device (PLD) by parallel port output programmable logic device (PLD), realizes the program of programmable logic device (PLD) is downloaded or upgrading;
At last,, make CPU change gate-control signal DCL, make four switch S 1, S2, S3, S4 all be in off-state, realized the disconnection of programmable logic device (PLD) and RJ45 by the computer by serial output command.
Like this, need not to cut off the power supply and to realize download or upgrading to programmable logic device (PLD) even can not having influence on the normal operation of the business of system.
Compared with prior art, adopt 4 pins of free time among the serial port connector RJ45 that utilize of the present invention as programmable logic device (PLD) download signal line TCK, TMS, TDI and TDO, the signal ground GND that the signal ground GND that utilizes serial ports to use downloads as programmable logic device (PLD) has realized directly on serial port connector RJ45 the program of programmable logic device (PLD) being downloaded and upgrading.And, can on the signal wire between serial port connector RJ45 and the programmable logic device (PLD), increase the control of gating circuit, and the control signal of gating circuit be controlled by programmable logic device (PLD), also can be controlled by CPU, perhaps control by other logical circuit.Like this, only when programmable logic device (PLD) need download, just can make the signal wire conducting between serial port connector RJ45 and the programmable logic device (PLD), realize it is downloaded.So, neither influence the function of serial ports, have again handling safety, reliably, advantage easily.
In a word, the present invention utilizes serial port connector RJ45 to realize the program of programmable logic device (PLD) is downloaded or upgrading, simplified produce and when safeguarding to the operation of programmable logic device (PLD), made things convenient for user's operation.
The above is embodiments of the invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within the claim scope of the present invention.