WO2011009409A1 - Jtag设备及实现jtag数据传输的方法 - Google Patents

Jtag设备及实现jtag数据传输的方法 Download PDF

Info

Publication number
WO2011009409A1
WO2011009409A1 PCT/CN2010/075372 CN2010075372W WO2011009409A1 WO 2011009409 A1 WO2011009409 A1 WO 2011009409A1 CN 2010075372 W CN2010075372 W CN 2010075372W WO 2011009409 A1 WO2011009409 A1 WO 2011009409A1
Authority
WO
WIPO (PCT)
Prior art keywords
pin
jtag
programmable logic
logic device
register
Prior art date
Application number
PCT/CN2010/075372
Other languages
English (en)
French (fr)
Inventor
许华
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to US13/386,417 priority Critical patent/US8689063B2/en
Priority to EP10801968.8A priority patent/EP2448121B1/en
Publication of WO2011009409A1 publication Critical patent/WO2011009409A1/zh

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/317Testing of digital circuits
    • G01R31/3181Functional testing
    • G01R31/3185Reconfiguring for testing, e.g. LSSD, partitioning
    • G01R31/318533Reconfiguring for testing, e.g. LSSD, partitioning using scanning techniques, e.g. LSSD, Boundary Scan, JTAG
    • G01R31/318572Input/Output interfaces

Definitions

  • JTAG device and method for realizing JTAG data transmission
  • the invention relates to a technology for remotely downloading a programmable device through a JTAG (Joint Test Action Group) interface, in particular to a JTAG device with an isolation circuit and a method for realizing JTAG data transmission through an isolation circuit.
  • JTAG Joint Test Action Group
  • programmable devices are like a piece of white paper or a stacked wood.
  • Engineers can freely design a digital figure through traditional schematic input methods or hardware description languages. system. Through software simulation, the correctness of the design can be verified in advance.
  • PCB Printed Circuit Board
  • the online modification capability of the programmable device can be used to modify the design at any time without changing the hardware circuit.
  • the use of programmable devices to develop digital circuits can significantly reduce design time, reduce PCB area, and increase system reliability.
  • the designer converts the function to be implemented into a schematic or hardware description language, compiles it by compiling the software, and downloads the compiled program to the programmable device through the JTAG interface.
  • the programmable device runs according to the designer's intention. .
  • JTAG is an international standard protocol, mainly used for on-chip testing and program download. Now almost all programmable devices support JTAG interface.
  • the programmable device with JTAG interface is called JTAG programmable logic device, standard JTAG interface. Includes the following pins:
  • JTAG TMS mode select pin
  • JTAG TCK clock pin
  • JTAG TDI data input pin
  • JTAG TDO data output pin
  • JTAG RST N JTAG reset pin
  • the JTAG download needs to connect the serial port of the PC and the JTAG interface of the JTAG programmable logic device directly through the JTAG download line. Since the JTAG device where the JTAG interface is located is likely to have no grounding or poor grounding, a large number of devices are accumulated on the device. Static electricity, when the device's JTAG programmable logic device is downloaded through the JTAG download line, a large amount of static electricity accumulated on the JTAG device will be transmitted to the serial port of the PC through the JTAG interface, eventually burning the serial port of the PC, resulting in The download cannot be made;
  • the upgrade method is more troublesome. If the JTAG device that has been put on the market and sold to the user needs to upgrade the JTAG programmable logic device, the relevant staff needs to take the JTAG download line to the user's tested device site. , the device to be tested is turned on, and then the JTAG connector connected to the JTAG download line is connected to the JTAG device and the PC respectively, and the upgrade program is manually downloaded, which easily affects the normal operation of the customer's JTAG device, which is time consuming and laborious, and extremely inconvenient. . Summary of the invention
  • the technical problem to be solved by the present invention is to provide a JTAG device and a method for realizing JTAG data transmission, and the protection of the JTAG interface or the serial port of the PC connected to the JTAG device through the isolation circuit, so that the JTAG interface or the serial port is not destroyed.
  • a JTAG device including a processor and a JTAG programmable logic device; the JTAG device further includes:
  • An isolation circuit coupled to the processor and coupled to a pin of the JTAG programmable logic device, the isolation circuit having a register corresponding to a pin of the JTAG programmable logic device;
  • the isolation circuit drives the pins of the JTAG programmable logic device according to the high and low level signals written by the processor to the registers in the isolation circuit, and the JTAG data corresponding to the high and low level signals are The processor is transferred to the JTAG programmable logic device.
  • the JTAG programmable logic device has: a data input pin, a mode select pin, a clock pin, and a reset pin;
  • the isolation circuit has: a register corresponding to the data input pin, the mode selection pin, the clock pin, and the reset pin, respectively.
  • the isolation circuit includes:
  • a programmable logic device having registers corresponding to the data input pin, the mode select pin, the clock pin, and the reset pin, respectively;
  • An optocoupler coupled to the programmable logic device and coupled to a data input pin, a mode select pin, a clock pin, and a reset pin of the JTAG programmable logic device, respectively.
  • the optical coupler includes:
  • VCC pin is connected to the VE pin
  • a pull-up resistor is connected between the VE pin and the VO pin
  • the CATHODE pin is connected to a register corresponding to the data input pin, and the VO pin is connected to the data input pin, or
  • the CATHODE pin is coupled to a register corresponding to the mode select pin and the a VO pin is connected to the mode selection pin, or
  • the CATHODE pin is connected to a register corresponding to the clock pin and the VO pin is connected to the clock pin, or
  • the CATHODE pin is coupled to a register corresponding to the reset pin and the VO pin is coupled to the reset pin.
  • a diode between the ANODE pin and the CATHODE pin and a diode between the VO pin and the GND pin are both turned off, the data input pin, a mode select pin, a clock pin or a reset pin is pulled to a level of the VCC pin by the pull-up resistor, and a high level signal is transmitted to the JTAG programmable logic device;
  • the CATHODE pin input is a low level signal
  • a diode between the ANODE pin and the CATHODE pin and a diode between the VO pin and the GND pin are both turned on, the data input pin
  • the mode select pin, the clock pin or the reset pin is pulled to the level of the GND pin by the pull-up resistor, and a low level signal is transmitted to the JTAG programmable logic device.
  • the programmable logic device further includes: a register corresponding to the data output pin;
  • the optocoupler is also coupled to the data output pin.
  • the register corresponding to the pin of the JTAG programmable logic device is a register, and each pin of the JTAG programmable logic device corresponds to a bit in the register; or Each pin of the JTAG programmable logic device corresponds to a register.
  • the optical coupler allows a signal to pass at a frequency greater than a download frequency of the JTAG programmable logic device; and/or,
  • the programmable logic device is specifically: a general purpose input/output GPIO expander or a complex programmable logic device CPLD.
  • the isolation circuit is specifically: a digital isolation circuit that utilizes a capacitor to achieve isolation.
  • the JTAG device further includes: an Ethernet chip having an Ethernet port, the Ethernet chip being connected to the processor, configured to transmit JTAG data received by the Ethernet port to the processor;
  • the processor is configured to download the JTAG data into the JTAG programmable logic device through the isolation circuit.
  • a method for isolating a circuit to implement JTAG data transmission is applied to a JTAG device including a JTAG programmable logic device and a processor, the method comprising:
  • the isolation circuit acquires a high and low level signal written by the processor to a register corresponding to a pin of the JTAG programmable logic device in the isolation circuit;
  • the isolation circuit drives the pins of the JTAG programmable logic device according to the high and low level signals, and downloads JTAG data corresponding to the high and low level signals from the processor to the JTAG programmable logic device.
  • the method further includes: the isolation circuit inputs the high and low level signals of the pins of the JTAG programmable logic device into the register, and waits for the reading of the processor.
  • the method further includes: the Ethernet chip with the Ethernet port transmits the JTAG data received by the Ethernet port to the processor.
  • the isolation circuit is used to isolate the pins of the JATG programmable logic device, which can prevent the JTAG device from being grounded or poorly grounded, resulting in the electrostatic transmission of the JTAG device.
  • FIG. 1 is a schematic structural diagram of a JTAG device according to an embodiment of the present invention.
  • FIG. 2 is a schematic diagram showing the isolation principle of the data input pin of the JTAG programmable logic device implemented by the isolation circuit in the JTAG device shown in FIG. 1;
  • FIG. 3 is a schematic diagram showing the isolation principle of the mode selection pin of the JTAG programmable logic device implemented by the isolation circuit in the JTAG device shown in FIG. 1;
  • FIG. 4 is a schematic diagram showing the isolation operation principle of the clock pin of the JTAG programmable logic device implemented by the isolation circuit in the JTAG device shown in FIG. 1;
  • FIG. 5 is a schematic diagram showing the isolation principle of the isolation pin of the JTAG programmable logic device in the JTAG device shown in FIG. 1;
  • FIG. 6 is a schematic diagram showing the isolation principle of the data output pin of the JTAG programmable logic device implemented by the isolation circuit in the JTAG device shown in FIG. 1. detailed description
  • the invention is directed to the JTAG interface of the JTAG programmable logic device in the existing JTAG device or the serial port of the PC connected to the JTAG device. Since the JTAG device collects a large amount of static electricity and is easily burned during use, the JTAG interface is provided. Isolation, protection of the JTAG interface or the serial port of the PC connected to the JTAG device, so that the JTAG interface or serial port is not Destruction.
  • the JTAG device of the embodiment of the present invention includes:
  • a processor which may be a CPU of a JTAG device, for implementing various logic processing of the JTAG device;
  • JTAG programmable logic device for implementing software upgrade or expansion of JTAG devices
  • An isolation circuit coupled to the processor and coupled to a pin of the JTAG programmable logic device, the isolation circuit having a register corresponding to a pin of the JTAG programmable logic device; the JTAG programmable logic The pin of the device is the JTAG interface;
  • the isolation circuit drives the pins of the JTAG programmable logic device according to the high and low level signals written by the processor to the registers in the isolation circuit, and the JTAG data corresponding to the high and low level signals are The processor is transferred to the JTAG programmable logic device.
  • the processor by adding an isolation circuit to the JTAG device, the processor first writes a read/write level signal of the JTAG programmable logic device into the register of the isolation circuit according to its simulated JTAG bus timing, so that the JTAG can be The programming logic device determines the JTAG bus read/write timing through the isolation circuit.
  • the isolation circuit drives the pins of the JTAG programmable logic device according to the high and low level signals written by the processor to the register.
  • the JTAG data corresponding to the high and low level signals is transmitted to the JTAG programmable logic device, thereby realizing protection of the JTAG programmable logic device pin, that is, the JTAG interface, and making the JTAG interface or the serial port of the PC connected to the JTAG device. Not destroyed.
  • the JTAG download can be done by the processor by writing to the JTAG programmable logic device.
  • the isolation circuit inputs the high and low signals of the pins of the JTAG programmable logic device into the register, waiting for the processor to read.
  • the pins of the above JTAG programmable logic device include: data input pin JTAG TDK mode select pin JTAG TMS, clock pin JTAG TCK, reset pin JTAG — RST — N and data output pin JTAG — TDO;
  • the isolating circuit comprises: the data input pin JTAG_TDI, the mode selection pin I leg JTAG_TMS, the clock pin I leg JTAG_TCK, the reset bow
  • the register can be a register, and each pin of the JTAG programmable logic device corresponds to a bit in the register; for example, an 8-bit register (not limited to 8-bit registers, 16-bit registers are also available), JTAG programmable logic
  • the five pins of the device correspond to one bit of the 8-bit register, and only need to operate the corresponding bits of the five bits to drive the corresponding pins of the JTAG programmable logic device.
  • one pin can also correspond to one register.
  • the data input pin JTAG the corresponding register of TDI is TDI—UPDATE
  • the mode select pin JTAG the corresponding register of TMS is TMS—UPDATE
  • the clock pin JTAG—TCK corresponds
  • the register is TCK_UPDATE
  • the corresponding register of the reset pin JTAG RST N is RST_UPDATE
  • the corresponding register of the data output pin JTAG_TMO is TDO_UPDATE
  • the corresponding pin of JTAG programmable logic device is realized by operating the corresponding register. Drive.
  • the above isolation circuit comprises:
  • the programmable logic device has a data input pin JTAG_TDI, a mode selection pin ITAG-TMS, a clock pin JTAG-TCK, a reset bow
  • An optical coupler connected to the programmable logic device, and respectively connected to the data input pin JTAG_TDI, mode selection pin JTAG TMS, clock bow pin JTAG of the JTAG programmable logic device — TCK, reset bow
  • the optocoupler is a high speed optocoupler that allows the frequency of the passed signal to be greater than the download frequency of the JTAG programmable logic device to meet the download requirements of the JTAG programmable logic device, such as the maximum frequency of the optocoupler being 1 MHz.
  • the above programmable logic device can be specifically used: GPIO (General Purpose Input/Output) expander for simulation, or a CPLD (Complex Programmable Logic Device).
  • the optical coupler transmits electrical signals in light as a medium. It has a good separation effect on the input and output electrical signals.
  • the main principle is: Converting the input electrical signal into an optical signal, and then converting the optical signal into an electrical signal, thereby functioning as an input and output isolation. Since the input and output of the optocoupler are isolated from each other and the electrical signal transmission is unidirectional, it has good electrical insulation capability and anti-interference ability.
  • the optical coupler includes:
  • the CATHODE pin is connected to a register corresponding to the data input pin JTAG_TDI, and the VO pin is connected to the data input pin JTAG_TDI, or
  • the CATHODE pin is connected to a register corresponding to the mode selection pin JTAG_TMS, and the VO pin is connected to the mode selection pin JTAG_TMS, or
  • the CATHODE pin is connected to a register corresponding to the clock pin JTAG_TCK and the VO pin is connected to the clock pin JTAG_TCK, or
  • the CATHODE pin is connected to a register corresponding to the reset pin JTAG_RST_N, and the VO pin is connected to the reset pin JTAG_RST-N, or
  • the CATHODE pin is coupled to the data output pin JTAG_TDO and the VO pin is coupled to a register corresponding to the data output pin JTAG_TDO.
  • the diode between the ANODE pin and the CATHODE pin and the diode between the VO pin and the GND pin are both turned off, and the data input pin JTAG TDK mode select pin JTAG TMS, clock reference a pin JTAG_TCCK or a reset pin JTAG_RST_N is transmitted to the level of the VCC pin by the pull-up resistor, and the high level signal is transmitted to the JTAG programmable logic device, or
  • the register corresponding to the data output pin JTAG_TDO is pulled to the level of the VCC pin by the pull-up resistor, and the high level signal is stored in a register corresponding to the data output pin JTAG TDO ;
  • the CATHODE pin input is a low level signal
  • a diode between the ANODE pin and the CATHODE pin and a diode between the VO pin and the GND pin are both turned on
  • the data input pin JTAG - TDI, mode select pin JTAG - TMS, clock pin JTAG - TCK or reset pin JTAG - RST - N is pulled to the GND pin level by the pull-up resistor
  • the low level signal Transmitting to the JTAG programmable logic device, or a register corresponding to the data output pin JTAG_TDO is pulled to the GND pin through the pull-up resistor, and the low level signal is stored in the data
  • the output pin is in the corresponding register of JTAG_TMO.
  • JTAG TDI is the data input pin of JTAG programmable logic device.
  • the corresponding register TDI_UPDATE is driven by the CPLD of the programmable logic device.
  • the high and low level of TDI_UPDATE is written by the processor to the register of the CPLD TDI-UPDATE.
  • the value is T or '0', which is determined by the data that the processor needs to write to the JTAG programmable logic device.
  • the register TDI_UPDATE can be a bit in the register or a separate register.
  • the CATHODE pin input of the optocoupler is a high level signal
  • the diode between the ANODE pin and the CATHODE pin is turned off, and the VO pin of the optocoupler and the GND pin are also Cutoff, causing JTAG TDI to be pulled up by pull-up resistor R2 JTAG-VCC is also high, so the high level signal is passed through the optocoupler to the JTAG-TDI of the JTAG programmable logic device.
  • the CATHODE pin of the optocoupler When TDI_UPDATE is low, the CATHODE pin of the optocoupler is input as a low level signal, and the diode between the ANODE pin and the CATHODE pin is turned on, causing the VO pin to also be turned on between the GND pin and the GND pin. So that JTAG-TDI is connected to the JTAG-GND pin, the JTAG-TDI level is low, so the low level signal is passed through the optocoupler to the JTAG-TDI of the JTAG programmable logic device. The above process implements download data input to the JTAG interface of the JTAG programmable logic device.
  • the optocoupler is a high-speed optocoupler that allows the maximum frequency of the signal to pass through 1MHZ, which fully satisfies the download frequency of the JTAG programmable logic device.
  • JTAG-TMS is the mode select pin of the JTAG programmable logic device, and the corresponding register TMS— UPDATE is driven by the CPLD of the programmable logic device.
  • the high and low levels of the TMS-UPDATE are implemented by the processor writing the register TMS_UPDATE of the CPLD to the value of '1, or '0, according to the processor needs to JTAG.
  • the data written by the programmable logic device is determined.
  • the register TMS_UPDATE can be a bit in the register or a separate register.
  • the CATHODE pin of the optocoupler When TMS_UPDATE is high, the CATHODE pin of the optocoupler is input as a high level signal, the diode between the ANODE pin and the CATHODE pin is turned off, and the VO pin of the optocoupler and the GND pin are also As a result, the JTAG-TMS is pulled up to JTAG-VCC by the pull-up resistor R2, which is also high, so that the high-level signal is passed through the optocoupler to the JTAG-TMS of the JTAG programmable logic device.
  • the CATHODE pin of the optocoupler When TMS_UPDATE is low, the CATHODE pin of the optocoupler is input as a low level signal, and the diode between the ANODE pin and the CATHODE pin is turned on, causing conduction between the VO pin and the GND pin. So that JTAG-TMS is connected to the JTAG-GND pin, the JTAG TMS level is low, so the low level signal is passed through the optocoupler to the JTAG TMS of the JTAG programmable logic device.
  • the above process implements JTAG programmable logic Mode selection for the JTAG interface of the device.
  • the photoelectric isolation diagram of the clock pin JTAG-TCK works as follows:
  • the optocoupler is a high-speed optocoupler, and the maximum frequency of the signal allowed to pass can be 1MHZ, which fully satisfies the download of JTAG programmable logic device.
  • Frequency JTAG TCK is the clock pin of JTAG programmable logic device, the corresponding register TCK_UPDATE is driven by CPLD implementing programmable logic device, TCK_UPDATE is high and low level is written by processor to CPLD register TCK_UPDATE The value of T or '0' is determined by the data that the processor needs to write to the JTAG programmable logic device.
  • the register TCK_UPDATE can be a bit in the register or a separate register.
  • TCK_UPDATE is high, the CATHODE pin of the optocoupler is input as a high level signal, the diode between the ANODE pin and the CATHODE pin is turned off, and the VO pin and GND pin of the photocoupler are also As a result, JTAG-TCK is pulled to JTAG-VCC, which is also high, so that the high-level signal is transmitted to the JTAG-TCK of the JTAG programmable logic device through the optocoupler.
  • the CATHODE pin of the optocoupler When TCK_UPDATE is low, the CATHODE pin of the optocoupler is input as a low level signal, and the diode between the ANODE pin and the CATHODE pin is turned on, causing the VO pin to also be turned on between the GND pin and the GND pin. , so that the JTAG TCK is connected to the JTAG-GND pin, the JTAG-TCK level is low, so that the low level signal is passed through the optocoupler to the JTAG-TCK of the JTAG programmable logic device.
  • the above process implements the clock input to the JTAG interface of the JTAG programmable logic device.
  • the photoelectric isolation diagram of the reset pin JTAG-RST-N works as follows:
  • the optocoupler is a high-speed optocoupler, and the maximum frequency of the signal allowed to pass can be 1MHZ, which fully satisfies the JTAG programmable logic device.
  • Download frequency JTAG—RST—N is the reset pin of JTAG programmable logic device.
  • the corresponding register RST_UPDATE is driven by the CPLD of the programmable logic device.
  • the high and low level of RST_UPDATE is written by the processor to the CPLD.
  • the value of the register RST UPDATE is '1, or '0, to achieve, according to the processor needs to JTAG
  • the data written by the programming logic is determined.
  • the register RST_UPDATE can be a bit in the register or a separate register.
  • RST_UPDATE is high, the CATHODE pin of the optocoupler is input as a high level signal, the diode between the ANODE pin and the CATHODE pin is turned off, and the VO pin and GND pin of the photocoupler are also As a result, JTAG-RST-N is pulled to JTAG-VCC, which is also high, so that the high level signal is transmitted to the JTAG-RST-N of the JTAG programmable logic device through the optocoupler.
  • the CATHODE pin of the optocoupler When RST_UPDATE is low, the CATHODE pin of the optocoupler is input as a low level signal, and the diode between the ANODE pin and the CATHODE pin is turned on, causing the VO pin to also be turned on between the GND pin and the GND pin. So that JTAG_RST-N is connected to the JTAG-GND pin, the level of JTAG-RST-N is low, so the low level signal is passed through the optocoupler to the JTAG of the JTAG programmable logic device. RST — N. The above process implements a reset operation on the JTAG interface of the JTAG programmable logic device.
  • JTAG TDO is the data output pin of the JTAG programmable logic device, corresponding to the register TDO_UPDATE in the CPLD implementing the programmable logic device.
  • the register TDO_UPDATE can be a bit in a register or a separate register.
  • the above circuit constitutes the entire structure of the JTAG device.
  • the currently used JTAG download method basically downloads the programmable device from the PC by using the JTAG download line.
  • the present invention uses a high speed optical coupler to JATG programmable logic device.
  • the five pins are optocoupler isolation, which prevents the JATG device from being grounded or poorly grounded, causing the static electricity accumulated by the JATG device to pass to the PC serial port and burning the serial port.
  • the optocoupler to isolate the JTAG interface, Even if the JTAG download line is hot swapped, the JTAG interface will not be damaged due to the protection of the optocoupler.
  • the JTAG device of the present invention may further have an Ethernet chip of an Ethernet port, and the Ethernet chip is connected to the processor for receiving the Ethernet port.
  • JTAG data is transmitted to the processor, and the JTAG data is downloaded by the processor to the JTAG programmable logic device through the isolation circuit.
  • the program in the JTAG programmable logic device can be upgraded online, and the programmable device program to be upgraded can be sent to the ROM of the processor of the JTAG device through the network (such as the Ethernet port RJ45 network port), and the processor is suitable.
  • the programmable device program that needs to be upgraded is downloaded to the JTAG programmable logic device through the programmable logic device, so that remote downloading and real-time download can be realized without going to the customer. Open the JTAG device on site for manual download, safe and reliable.
  • the isolation circuit can also be implemented using a digital isolation circuit that is isolated using a capacitor such as a digital isolation circuit manufactured by ADI and TI.
  • An embodiment of the present invention further provides a method for implementing JTAG data downloading by an isolation circuit, which is applied to a JTAG device including a JTAG programmable logic device and a processor, the method comprising: Step 1: The isolation circuit acquires the processor a high-low level signal written in a register corresponding to a pin of the JTAG programmable logic device in the isolation circuit; Step 2, the isolation circuit drives the pins of the JTAG programmable logic device according to the high and low level signals, and downloads JTAG data corresponding to the high and low level signals from the processor to the JTAG programmable logic device. .
  • the processor reads and writes related registers of the isolation circuit (such as TMS_UPDATE, TCK_UPDATE, TDO UPDATD, RST UPDATE, TDI UPDATE) through LocalBus according to the timing and function of the simulation, thereby driving JTAG TMS and JTAG.
  • TCK JTAG — TDO, JTAG — RST, JTAG — TDI 5 pins, which are then isolated by optocoupler and sent to the JTAG programmable logic device to complete the data transfer between the processor and the JTAG programmable logic device.
  • the files to be downloaded can be remotely transmitted from the network to the processor through the RJ45 network port, and then downloaded to the JTAG programmable logic device, thereby enabling remote downloading, without having to open the JTAG device for manual downloading at the customer site. reliable.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Semiconductor Integrated Circuits (AREA)
  • Design And Manufacture Of Integrated Circuits (AREA)
  • Logic Circuits (AREA)

Abstract

本发明公开了一种JTAG设备及实现JTAG数据传输的方法,其中,JTAG设备包括:处理器和JTAG可编程逻辑器件;还包括:隔离电路,与所述处理器连接,并与所述JTAG可编程逻辑器件的引脚连接, 所述隔离电路具有与所述JTAG可编程逻辑器件的引脚对应的寄存器; 所述隔离电路根据所述处理器对所述隔离电路中的所述寄存器写入的高低电平信号,驱动所述JTAG可编程逻辑器件的引脚, 将高低电平信号对应的JTAG数据从所述处理器传输到所述JTAG可编程逻辑器件中。 本发明方案中, 使用隔离电路实现对JTAG接口或者与JTAG设备连接的PC的串口的保护。

Description

JTAG设备及实现 JTAG数据传输的方法 技术领域
本发明涉及通过 JTAG ( Joint Test Action Group, 联合测试行动小组) 接口对可编程器件进行远程在线下载的技术, 特别是指一种带隔离电路的 JTAG设备及通过隔离电路实现 JTAG数据传输的方法。 背景技术
随着电路技术的发展, 可编程器件应用得越来越广泛, 可编程器件如 同一张白纸或是一堆积木, 工程师可以通过传统的原理图输入法或是硬件 描述语言自由的设计一个数字系统。 通过软件仿真, 可以事先验证设计的 正确性。 在 PCB ( Printed Circuit Board, 印刷电路板)完成以后, 还可以利 用可编程器件的在线修改能力, 随时修改设计而不必改动硬件电路。 使用 可编程器件来开发数字电路, 可以大大缩短设计时间, 减少 PCB面积, 提 高系统的可靠性。
设计者将要实现的功能转换成原理图或者硬件描述语言的形式, 通过 编译软件进行编译, 将编译以后的程序通过 JTAG接口下载到可编程器件 中, 可编程器件就会按照设计者的意图进行运行。
JTAG是一种国际标准协议, 主要用于芯片内部测试和程序下载, 现在 几乎所有的可编程器件都支持 JTAG接口,将具有 JTAG接口的可编程器件 称为 JTAG可编程逻辑器件, 标准的 JTAG接口包括以下引脚:
JTAG TMS: 模式选择引脚;
JTAG TCK: 时钟引脚;
JTAG TDI: 数据输入引脚;
JTAG TDO: 数据输出引脚; JTAG RST N: JTAG复位引脚。
目前, JTAG可编程逻辑器件进行下载的最常见的方法是:
使用 JTAG下载线将 PC (计算机) 的串口和 JTAG可编程逻辑器件的 JTAG接口连接起来, 在 PC上运行 JTAG下载软件, 将编译好后的可编程 器件编译文件通过 JTAG下载线下载到 JTAG可编程逻辑器件中。这种常用 的 JTAG下载方法主要有以下弊端:
A、 由于 JTAG接口不支持热插拔, 下载完以后, 如果直接将 JTAG下 载线从 JTAG可编程逻辑器件的 JTAG连接器上拔掉,很容易损坏 JTAG接 口, 导致 JTAG可编程逻辑器件无法进行后续的程序升级功能;
B、 JTAG下载需要将 PC的串口和 JTAG可编程逻辑器件的 JTAG接口 通过 JTAG下载线来直接连接; 由于 JTAG接口所在的 JTAG设备很有可能 没有接地或者接地不良, 导致该设备上聚集了大量的静电, 而当该设备的 JTAG可编程逻辑器件通过 JTAG下载线进行下载的时候, JTAG设备上积 聚的大量的静电会通过 JTAG接口传到 PC机的串口上, 最终将 PC的串口 烧坏, 导致下载无法进行;
C、另外,升级方式比较麻烦,如果是已经投放市场、销售给用户的 JTAG 设备需要进行 JTAG可编程逻辑器件的升级, 就需要相关的工作人员拿着 JTAG下载线到用户的被测试的设备现场, 将被测试的设备打开, 然后将连 接有 JTAG下载线的 JTAG连接器分别连接到 JTAG设备和 PC上, 手动下 载升级程序, 这样容易影响客户的 JTAG设备的正常运行, 费时费力, 极不 方便。 发明内容
本发明要解决的技术问题是提供一种 JTAG设备及实现 JTAG数据传输 的方法, 通过隔离电路实现对 JTAG接口或者与 JTAG设备连接的 PC的串 口的保护, 使 JTAG接口或者串口不被破坏。 为解决上述技术问题, 本发明的技术方案是这样实现的: 一种 JTAG设备, 包括处理器和 JTAG可编程逻辑器件; 所述 JTAG设 备还包括:
隔离电路,与所述处理器连接,并与所述 JTAG可编程逻辑器件的引脚 连接, 所述隔离电路具有与所述 JTAG 可编程逻辑器件的引脚对应的寄存 器;
所述隔离电路根据所述处理器对所述隔离电路中的所述寄存器写入的 高低电平信号,驱动所述 JTAG可编程逻辑器件的引脚,将高低电平信号对 应的 JTAG数据从所述处理器传输到所述 JTAG可编程逻辑器件中。
所述 JTAG可编程逻辑器件具有: 数据输入引脚、模式选择引脚、 时钟 引脚和复位引脚;
所述隔离电路中具有: 分别与所述数据输入引脚、 模式选择引脚、 时 钟引脚和复位引脚对应的寄存器。
所述隔离电路包括:
可编程逻辑器件, 具有分别与所述数据输入引脚、 模式选择引脚、 时 钟引脚和复位引脚对应的寄存器;
光耦合器,与所述可编程逻辑器件连接,并分别与所述 JTAG可编程逻 辑器件的数据输入引脚、 模式选择引脚、 时钟引脚和复位引脚连接。
所述光耦合器包括:
CATHODE引 ip、 ANODE引 ip、 VO引 !7、 GND引 ip、 VCC引 P和 VE引脚; 其中, 所述 VCC引脚和所述 VE引脚连接, 所述 VE引脚和所述 VO引脚之间连接有一上拉电阻;
所述 CATHODE 引脚与所述数据输入引脚对应的寄存器连接且所述 VO引脚与所述数据输入引脚连接, 或者,
所述 CATHODE 引脚与所述模式选择引脚对应的寄存器连接且所述 VO引脚与所述模式选择引脚连接, 或者,
所述 CATHODE引脚与所述时钟引脚对应的寄存器连接且所述 VO引 脚与所述时钟引脚连接, 或者,
所述 CATHODE引脚与所述复位引脚对应的寄存器连接且所述 VO引 脚与所述复位引脚连接,
所述 CATHODE 引脚输入为高电平信号时, 所述 ANODE 引脚与 CATHODE引脚之间的二极管和所述 VO引脚与 GND引脚之间的二极管均 截止, 所述数据输入引脚、 模式选择引脚、 时钟引脚或复位引脚通过所述 上拉电阻被拉到所述 VCC引脚的电平, 将高电平信号传输至所述 JTAG可 编程逻辑器件;
所述 CATHODE 引脚输入为低电平信号时, 所述 ANODE 引脚与 CATHODE引脚之间的二极管和所述 VO引脚与 GND引脚之间的二极管均 导通, 所述数据输入引脚、 模式选择引脚、 时钟引脚或复位引脚通过所述 上拉电阻被拉到 GND引脚的电平, 将低电平信号传输至所述 JTAG可编程 逻辑器件。
所述可编程逻辑器件还包括: 数据输出引脚对应的寄存器;
所述光耦合器还与所述数据输出引脚连接。
所述 CATHODE引脚输入为高电平信号时, 所述数据输出引脚对应的 寄存器通过所述上拉电阻被拉到所述 VCC引脚, 将所述高电平信号存储在 所述数据输出弓 )脚对应的寄存器中;
所述 CATHODE引脚输入为低电平信号时, 所述数据输出引脚对应的 寄存器通过所述上拉电阻被拉到所述 GND引脚,将所述低电平信号存储在 所述数据输出弓 )脚对应的寄存器中。
所述 JTAG可编程逻辑器件的引脚对应的寄存器为一个寄存器, 所述 JTAG 可编程逻辑器件的各引脚分别对应该寄存器中的一位; 或者, 所述 JTAG可编程逻辑器件的各引脚分别对应一个寄存器。
所述光耦合器允许通过的信号的频率大于所述 JTAG 可编程逻辑器件 的下载频率; 和 /或,
所述可编程逻辑器件具体为: 通用输入 /输出 GPIO扩展器或者复杂可 编程逻辑器件 CPLD。
所述隔离电路具体为: 利用电容实现隔离的数字隔离电路。
所述 JTAG设备还包括: 具有以太网口的以太网芯片,所述以太网芯片 与所述处理器连接,用于将所述以太网口接收到的 JTAG数据传输至所述处 理器;
所述处理器用于将所述 JTAG数据通过所述隔离电路下载到所述 JTAG 可编程逻辑器件中。
一种隔离电路实现 JTAG数据传输的方法,应用于包含有 JTAG可编程 逻辑器件和处理器的 JTAG设备中, 该方法包括:
隔离电路获取处理器对所述隔离电路中的与所述 JTAG可编程逻辑器 件的引脚对应的寄存器写入的高低电平信号;
所述隔离电路根据所述高低电平信号,驱动所述 JTAG可编程逻辑器件 的引脚, 将高低电平信号对应的 JTAG数据从所述处理器下载到所述 JTAG 可编程逻辑器件。
该方法还包括:隔离电路将 JTAG可编程逻辑器件的引脚的高低电平信 号输入到寄存器, 等待处理器的读取。
所述处理器对寄存器写入高低电平信号之前, 还包括: 具有以太网口 的以太网芯片将以太网口接收到的 JTAG数据传输至处理器。
本发明的上述技术方案的有益效果如下:
上述方案中, 使用隔离电路对 JATG可编程逻辑器件的引脚进行隔离, 可以防止 JTAG设备没有接地或者接地不良,导致 JTAG设备聚集的静电传 到 PC的串口而烧毁串口的问题; 而且, 使用隔离电路对 JTAG可编程逻辑 器件进行隔离以后, 即使热插拔 JTAG下载线, 由于隔离电路的保护, 也不 会对 JTAG接口产生破坏。
另外, 可以实现远程下载, 实时下载, 无需到客户现场打开 JTAG设备 进行手动下载, 安全可靠。 附图说明
图 1为本发明的实施例 JTAG设备的具体结构示意图;
图 2为图 1所示 JTAG设备中隔离电路实现 JTAG可编程逻辑器件的数 据输入引脚的隔离工作原理示意图;
图 3为图 1所示 JTAG设备中隔离电路实现 JTAG可编程逻辑器件的模 式选择引脚的隔离工作原理示意图;
图 4为图 1所示 JTAG设备中隔离电路实现 JTAG可编程逻辑器件的时 钟引脚的隔离工作原理示意图;
图 5为图 1所示 JTAG设备中隔离电路实现 JTAG可编程逻辑器件的复 位引脚的隔离工作原理示意图;
图 6为图 1所示 JTAG设备中隔离电路实现 JTAG可编程逻辑器件的数 据输出引脚的隔离工作原理示意图。 具体实施方式
为使本发明要解决的技术问题、 技术方案和优点更加清楚, 下面将结 合附图及具体实施例进行详细描述。
本发明针对现有 JTAG设备中 JTAG可编程逻辑器件的 JTAG接口或者 与该 JTAG设备连接的 PC的串口, 由于 JTAG设备聚集大量的静电, 使用 时容易被烧毁的问题,提供一种对 JTAG接口进行隔离, 实现对 JTAG接口 或者与该 JTAG设备连接的 PC的串口的保护, 使 JTAG接口或者串口不被 破坏。
如图 1所示, 本发明的实施例 JTAG设备, 包括:
处理器, 该处理器可以是 JTAG设备的 CPU, 用于实现 JTAG设备的 各种逻辑处理;
JTAG可编程逻辑器件, 用于实现对 JTAG设备的软件升级或者扩充功 能的实现;
隔离电路,与所述处理器连接,并与所述 JTAG可编程逻辑器件的引脚 连接, 所述隔离电路具有与所述 JTAG 可编程逻辑器件的引脚对应的寄存 器; 所述 JTAG可编程逻辑器件的引脚即为 JTAG接口;
所述隔离电路根据所述处理器对所述隔离电路中的所述寄存器写入的 高低电平信号,驱动所述 JTAG可编程逻辑器件的引脚,将高低电平信号对 应的 JTAG数据从所述处理器传输到所述 JTAG可编程逻辑器件中。
该实施例中,通过在 JTAG设备中增加隔离电路,处理器根据其模拟的 JTAG总线时序首先将对 JTAG可编程逻辑器件的读 /写电平信号写入该隔离 电路的寄存器中,使得 JTAG可编程逻辑器件通过隔离电路确定 JTAG总线 读 /写时序, 处理器向 JTAG可编程逻辑器件写入数据时, 隔离电路根据处 理器对寄存器写入的高低电平信号驱动 JTAG可编程逻辑器件的引脚,最后 将高低电平信号对应的 JTAG数据传输到 JTAG可编程逻辑器件中,从而实 现对 JTAG可编程逻辑器件引脚、 即 JTAG接口的保护, 使 JTAG接口或者 与该 JTAG设备连接的 PC的串口不被破坏。 处理器通过对 JTAG可编程逻 辑器件进行写操作即能够完成 JTAG下载。
另外, 处理器向 JTAG可编程逻辑器件读数据时, 隔离电路将 JTAG可 编程逻辑器件的引脚的高低电平信号输入到寄存器, 等待处理器的读取。
其中, 上述 JTAG 可编程逻辑器件的引脚包括: 数据输入引脚 JTAG TDK 模式选择引脚 JTAG TMS、 时钟引脚 JTAG TCK、 复位引脚 JTAG— RST— N和数据输出引脚 JTAG— TDO;
相应地, 所述隔离电路中包括: 与所述数据输入引脚 JTAG— TDI、模式 选择弓 I脚 JTAG— TMS、 时钟弓 I脚 JTAG— TCK、 复位弓 |脚 JTAG— RST— N或数 据输出引脚 JTAG— TDO对应的寄存器。 该寄存器可以为一个寄存器, JTAG 可编程逻辑器件的各引脚分别对应该寄存器中的一位; 如, 一个 8位寄存 器 (并不限于 8位寄存器, 16位寄存器也可以 ), JTAG可编程逻辑器件的 这 5个引脚分别对应该 8位寄存器的 1位, 只需要操作这 5位中的相应位 就可以实现对 JTAG可编程逻辑器件相应引脚的驱动。 当然,也可以是一个 引脚对应一个寄存器, 如数据输入引脚 JTAG— TDI 对应的寄存器为 TDI— UPDATE; 模式选择引脚 JTAG— TMS对应的寄存器为 TMS— UPDATE; 时钟引脚 JTAG— TCK 对应的寄存器为 TCK— UPDATE; 复位引脚 JTAG RST N对应的寄存器为 RST— UPDATE; 数据输出引脚 JTAG— TDO 对应的寄存器为 TDO— UPDATE, 通过操作相应寄存器实现对 JTAG可编程 逻辑器件相应引脚的驱动。
其中, 上述隔离电路包括:
可编程逻辑器件, 具有分别与所述数据输入引脚 JTAG— TDI、模式选择 弓 I脚 JTAG— TMS、 时钟引脚 JTAG— TCK、 复位弓 |脚 JTAG— RST— N或者数据 输出引脚 JTAG— TDO对应的寄存器;
光耦合器 ( Optical Coupler, OC ), 与所述可编程逻辑器件连接, 并分 别与所述 JTAG可编程逻辑器件的数据输入引脚 JTAG— TDI、模式选择引脚 JTAG TMS、 时钟弓 I脚 JTAG— TCK、 复位弓 |脚 JTAG— RST— N和数据输出弓 I 脚 JTAG— TDO连接。
该光耦合器为高速光耦,允许通过的信号的频率应大于 JTAG可编程逻 辑器件的下载频率, 以满足 JTAG可编程逻辑器件的下载需要,如该光耦合 器的最大频率为 1MHZ。 另外, 上述可编程逻辑器件具体可以釆用: GPIO (通用输入 /输出)扩 展器进行模拟, 也可以是一个 CPLD ( Complex Programmable Logic Device, 复杂可编程逻辑器件 )。
光耦合器以光为媒介传输电信号。 它对输入、 输出电信号有良好的隔 离作用, 主要原理是: 将输入的电信号转换为光信号, 再将光信号转换为 电信号, 从而起到输入、 输出隔离的作用。 由于光耦合器输入输出间互相 隔离、 电信号传输具有单向性等特点, 因而具有良好的电绝缘能力和抗干 扰能力。
该光耦合器包括:
CATHODE (负极) 引脚、 ANODE (正极) 引脚、 VO引脚、 GND引 脚、 VCC引脚和 VE引脚; 其中, 所述 VCC引脚和所述 VE引脚连接, 所 述 VE引脚和所述 VO引脚之间连接有一上拉电阻;
所述 CATHODE引脚与所述数据输入引脚 JTAG— TDI对应的寄存器连 接且所述 VO引脚与所述数据输入引脚 JTAG— TDI连接, 或者,
所述 CATHODE引脚与所述模式选择引脚 JTAG— TMS对应的寄存器连 接且所述 VO引脚与所述模式选择引脚 JTAG— TMS连接, 或者,
所述 CATHODE引脚与所述时钟引脚 JTAG— TCK对应的寄存器连接且 所述 VO引脚与所述时钟引脚 JTAG— TCK连接, 或者,
所述 CATHODE引脚与所述复位引脚 JTAG— RST— N对应的寄存器连接 且所述 VO引脚与所述复位引脚 JTAG— RST—N连接, 或者,
所述 CATHODE引脚与所述数据输出引脚 JTAG— TDO连接且所述 VO 引脚与所述数据输出引脚 JTAG— TDO对应的寄存器连接。
所述 CATHODE 引脚输入为高电平信号时, 所述 ANODE 引脚与 CATHODE引脚之间的二极管和所述 VO引脚与 GND引脚之间的二极管均 截止, 所述数据输入引脚 JTAG TDK 模式选择引脚 JTAG TMS、 时钟引 脚 JTAG— TCK或复位引脚 JTAG— RST— N 通过所述上拉电阻被拉到所述 VCC引脚的电平, 将所述高电平信号传输至所述 JTAG可编程逻辑器件, 或者所述数据输出引脚 JTAG— TDO对应的寄存器通过所述上拉电阻被拉到 所述 VCC 引脚的电平, 将所述高电平信号存储在所述数据输出引脚 JTAG TDO对应的寄存器中;
所述 CATHODE 引脚输入为低电平信号时, 所述 ANODE 引脚与 CATHODE引脚之间的二极管和所述 VO引脚与 GND引脚之间的二极管均 导通, 所述数据输入引脚 JTAG— TDI、 模式选择引脚 JTAG— TMS、 时钟引 脚 JTAG— TCK或复位引脚 JTAG— RST— N通过所述上拉电阻被拉到 GND引 脚的电平,将所述低电平信号传输至所述 JTAG可编程逻辑器件,或者所述 数据输出引脚 JTAG— TDO 对应的寄存器通过所述上拉电阻被拉到所述 GND引脚,将所述低电平信号存储在所述数据输出引脚 JTAG— TDO对应的 寄存器中。
下面结合具体附图说明上述光耦合器的各引脚与 JTAG可编程逻辑器 件的各引脚以及可编程逻辑器件中的寄存器之间的工作关系:
如图 2所示, 为数据输入引脚 JTAG— TDI的光电隔离图, 工作原理如 下:
JTAG TDI是 JTAG可编程逻辑器件的数据输入引脚, 对应的寄存器 TDI— UPDATE由实现可编程逻辑器件的 CPLD驱动, TDI— UPDATE的高低 电平是由处理器写入 CPLD的寄存器 TDI— UPDATE的值为 T 或 '0, 来 实现的,根据处理器需要向 JTAG可编程逻辑器件写入的数据来决定。所述 寄存器 TDI— UPDATE可以为寄存器中的一位,也可以为一个单独的寄存器。 当 TDI— UPDATE为高电平时,光耦合器的 CATHODE引脚输入为高电平信 号, ANODE引脚和 CATHODE引脚之间的二极管截止,光耦合器的 VO引 脚与 GND 引脚之间也截止, 导致 JTAG TDI 被上拉电阻 R2 拉到 JTAG— VCC,也为高电平, 这样高电平信号就通过光耦合器传到了 JTAG可 编程逻辑器件的 JTAG— TDI。 当 TDI— UPDATE 为低电平时, 光耦合器的 CATHODE引脚输入为低电平信号, ANODE引脚与 CATHODE引脚之间的 二极管导通, 导致 VO引脚与 GND引脚之间也导通, 使得 JTAG— TDI被连 接到 JTAG— GND引脚, JTAG— TDI的电平就为低电平, 这样低电平信号就 通过光耦合器传到了 JTAG可编程逻辑器件的 JTAG— TDI。 以上过程实现了 对 JTAG可编程逻辑器件的 JTAG接口的下载数据输入。
如图 3所示, 为模式选择引脚 JTAG— TMS的光电隔离图, 工作原理如 下:
光耦合器为高速光耦, 允许通过的信号的最大频率可以为 1MHZ, 完 全满足 JTAG可编程逻辑器件的下载频率; JTAG— TMS是 JTAG可编程逻 辑器件的模式选择引脚,对应的寄存器 TMS— UPDATE由实现可编程逻辑器 件的 CPLD驱动, TMS— UPDATE的高低电平是由处理器写入 CPLD的寄存 器 TMS— UPDATE的值为 '1, 或 '0, 来实现的, 根据处理器需要向 JTAG 可编程逻辑器件写入的数据来决定。所述寄存器 TMS— UPDATE可以为寄存 器中的一位, 也可以为一个单独的寄存器。 当 TMS— UPDATE为高电平时, 光耦合器的 CATHODE引脚输入为高电平信号, ANODE引脚与 CATHODE 引脚之间的二极管截止, 光耦合器的 VO引脚与 GND引脚之间也截止, 导 致 JTAG— TMS被上拉电阻 R2拉到 JTAG— VCC , 也为高电平, 这样高电平 信号就通过光耦合器传到了 JTAG 可编程逻辑器件的 JTAG— TMS。 当 TMS— UPDATE为低电平时, 光耦合器的 CATHODE 引脚输入为低电平信 号, ANODE引脚与 CATHODE引脚之间的二极管导通, 导致 VO引脚与 GND 引脚之间也导通, 使得 JTAG— TMS 被连接到 JTAG— GND 引脚, JTAG TMS 的电平就为低电平, 这样低电平信号就通过光耦合器传到了 JTAG可编程逻辑器件的 JTAG TMS。 以上过程实现了对 JTAG可编程逻辑 器件的 JTAG接口的模式选择。
如图 4所示, 为时钟引脚 JTAG— TCK的光电隔离图, 工作原理如下: 光耦合器为高速光耦, 允许通过的信号的最大频率可以为 1MHZ, 完 全满足 JTAG可编程逻辑器件的下载频率; JTAG TCK是 JTAG可编程逻辑 器件的时钟引脚, 对应的寄存器 TCK— UPDATE 由实现可编程逻辑器件的 CPLD驱动, TCK— UPDATE 的高低电平是由处理器写入 CPLD 的寄存器 TCK— UPDATE的值为 T 或 '0, 来实现的, 根据处理器需要向 JTAG可 编程逻辑器件写入的数据来决定。所述寄存器 TCK— UPDATE可以为寄存器 中的一位, 也可以为一个单独的寄存器。 当 TCK— UPDATE为高电平时, 光 耦合器的 CATHODE引脚输入为高电平信号, ANODE引脚与 CATHODE 引脚之间的二极管截止, 光耦合器的 VO引脚与 GND引脚之间也截止, 导 致 JTAG— TCK被拉到 JTAG— VCC , 也为高电平, 这样高电平信号就通过光 耦合器传到了 JTAG可编程逻辑器件的 JTAG— TCK。当 TCK— UPDATE为低 电平时, 光耦合器的 CATHODE引脚输入为低电平信号, ANODE引脚与 CATHODE引脚之间的二极管导通,导致 VO引脚与 GND引脚之间也导通, 使得 JTAG TCK被连接到 JTAG— GND引脚, JTAG— TCK的电平就为低电 平, 这样低电平信号就通过光耦合器传到了 JTAG 可编程逻辑器件的 JTAG— TCK。 以上过程实现了对 JTAG可编程逻辑器件的 JTAG接口的时钟 输入。
如图 5所示,为复位引脚 JTAG— RST— N的光电隔离图,工作原理如下: 光耦合器为高速光耦, 允许通过的信号的最大频率可以为 1MHZ, 完 全满足 JTAG可编程逻辑器件的下载频率; JTAG— RST— N是 JTAG可编程 逻辑器件的复位引脚,对应的寄存器 RST— UPDATE由实现可编程逻辑器件 的 CPLD驱动, RST— UPDATE的高低电平是由处理器写入 CPLD的寄存器 RST UPDATE的值为 '1, 或 '0, 来实现的, 根据处理器需要向 JTAG可 编程逻辑器件写入的数据来决定。所述寄存器 RST— UPDATE可以为寄存器 中的一位, 也可以为一个单独的寄存器。 当 RST— UPDATE为高电平时, 光 耦合器的 CATHODE引脚输入为高电平信号, ANODE引脚与 CATHODE 引脚之间的二极管截止, 光耦合器的 VO引脚与 GND引脚之间也截止, 导 致 JTAG— RST— N被拉到 JTAG— VCC , 也为高电平, 这样高电平信号就通过 光耦合器传到了 JTAG可编程逻辑器件的 JTAG— RST— N。 当 RST— UPDATE 为低电平时, 光耦合器的 CATHODE引脚输入为低电平信号, ANODE 引 脚与 CATHODE引脚之间的二极管导通,导致 VO引脚与 GND引脚之间也 导通, 使得 JTAG— RST— N被连接到 JTAG— GND引脚, JTAG— RST— N的电 平就为低电平,这样低电平信号就通过光耦合器传到了 JTAG可编程逻辑器 件的 JTAG— RST— N。 以上过程实现了对 JTAG可编程逻辑器件的 JTAG接 口的复位操作。
如图 6所示, 为数据输出引脚 JTAG— TDO的光电隔离图, 工作原理如 下:
JTAG TDO是 JTAG可编程逻辑器件的数据输出引脚, 对应实现可编 程逻辑器件的 CPLD中的寄存器 TDO— UPDATE。所述寄存器 TDO— UPDATE 可以为寄存器中的一位, 也可以为一个单独的寄存器。 当 JTAG— TDO输出 高电平时, 光耦合器的 ANODE引脚与 CATHODE引脚之间的电平为低电 平 , ANODE引脚与 CATHODE引脚之间的二极管截止,导致 VO脚和 GND 脚截止, TDO— UPDATE就被连接到 VCC3 V3 ,从而是高电平,输入到 CPLD 的 TDO— UPDATE中, 等待处理器读取。 当 JTAG— TDO输出低电平时, 光 耦合器的 ANODE引脚与 CATHODE引脚之间的二极管导通, 从而导致光 耦合器的 VO引脚与 GND引脚导通, TDO— UPDATE被连接到 GND, 从而 是低电平, 输入到 CPLD的 TDO— UPDATE中, 等待处理器读取。 以上所 述 JTAG— TDO的高低电平是由 JTAG可编程逻辑器件中需要被处理器读取 的数据决定。
以上电路组成了 JTAG设备的整个结构。 目前釆用的 JTAG下载方法基 本上都是通过使用 JTAG下载线从 PC机上对可编程器件进行程序下载,存 在技术背景中描述的三种弊端,本发明使用高速光耦合器对 JATG可编程逻 辑器件的 5个引脚分别进行光耦隔离,可以防止 JATG设备没有接地或者接 地不良,导致 JATG设备聚集的静电传到 PC串口而烧毁串口的问题;而且, 使用光耦合器对 JTAG接口进行隔离以后, 即使热插拔 JTAG下载线, 由于 光耦合器的保护, 也不会对 JTAG接口产生破坏。
另夕卜,再如图 1所示,本发明的 JTAG设备还可具有以太网口的以太网 芯片, 所述以太网芯片与所述处理器连接, 用于将所述以太网口接收到的 JTAG数据传输至所述处理器, 并由所述处理器将所述 JTAG数据通过所述 隔离电路下载到所述 JTAG可编程逻辑器件中。这样可以在线升级 JTAG可 编程逻辑器件中的程序, 可以通过网络(如以太网口 RJ45网口 )将需要升 级的可编程器件程序发到 JTAG设备的处理器的 ROM里保存起来,处理器 在合适的时候通过读写可编程逻辑器件的寄存器来模拟 JTAG时序,将需要 升级的可编程器件程序通过可编程逻辑器件下载到 JTAG 可编程逻辑器件 中, 这样可以实现远程下载, 实时下载, 无需到客户现场打开 JTAG设备进 行手动下载, 安全可靠。
最后, 本发明的上述实施例中, 隔离电路也可以利用数字隔离电路实 现, 该数字隔离电路是使用电容进行隔离, 如 ADI和 TI公司生产的数字隔 离电路。
本发明的实施例还提供一种隔离电路实现 JTAG数据下载的方法,应用 于包含有 JTAG可编程逻辑器件和处理器的 JTAG设备中, 该方法包括: 步骤一,隔离电路获取处理器对所述隔离电路中的与所述 JTAG可编程 逻辑器件的引脚对应的寄存器写入的高低电平信号; 步骤二,所述隔离电路根据所述高低电平信号,驱动所述 JTAG可编程 逻辑器件的引脚,将高低电平信号对应的 JTAG数据从所述处理器下载到所 述 JTAG可编程逻辑器件。
该方法中具体实现对 JTAG可编程逻辑器件进行隔离保护,并实现远程 下载的方法如上述各附图中的介绍, 在此不再赘述。
综上, 处理器按照模拟好以后的时序和功能通过 LocalBus对隔离电路 的相关寄存器 (如 TMS— UPDATE、 TCK— UPDATE、 TDO UPDATD、 RST UPDATE、 TDI UPDATE ) 进行读写, 从而驱动 JTAG TMS 、 JTAG— TCK:、 JTAG— TDO、 JTAG— RST、 JTAG— TDI这 5个引脚, 然后通 过光耦隔离以后送到 JTAG可编程逻辑器件上,完成处理器与 JTAG可编程 逻辑器件之间的数据传输。 另外, 还可以通过 RJ45网口将要下载的文件由 网络远程传送到处理器里存储起来,再下载到 JTAG可编程逻辑器件里,从 而实现远程下载,不用到客户现场打开 JTAG设备进行手动下载,安全可靠。
以上所述是本发明的优选实施方式, 应当指出, 对于本技术领域的普 通技术人员来说, 在不脱离本发明所述原理的前提下, 还可以作出若干改 进和润饰, 这些改进和润饰也应视为本发明的保护范围。

Claims

权利要求书
1、 一种 JTAG设备, 包括处理器和 JTAG可编程逻辑器件; 其特征在 于, 所述 JTAG设备还包括:
隔离电路,与所述处理器连接,并与所述 JTAG可编程逻辑器件的引脚 连接, 所述隔离电路具有与所述 JTAG 可编程逻辑器件的引脚对应的寄存 器;
所述隔离电路根据所述处理器对所述隔离电路中的所述寄存器写入的 高低电平信号,驱动所述 JTAG可编程逻辑器件的引脚,将高低电平信号对 应的 JTAG数据从所述处理器传输到所述 JTAG可编程逻辑器件中。
2、 根据权利要求 1所述的 JTAG设备, 其特征在于, 所述 JTAG可编 程逻辑器件具有: 数据输入引脚、 模式选择引脚、 时钟引脚和复位引脚; 所述隔离电路中具有: 分别与所述数据输入引脚、 模式选择引脚、 时 钟引脚和复位引脚对应的寄存器。
3、 根据权利要求 2所述的 JTAG设备, 其特征在于, 所述隔离电路包 括:
可编程逻辑器件, 具有分别与所述数据输入引脚、 模式选择引脚、 时 钟引脚和复位引脚对应的寄存器;
光耦合器,与所述可编程逻辑器件连接,并分别与所述 JTAG可编程逻 辑器件的数据输入引脚、 模式选择引脚、 时钟引脚和复位引脚连接。
4、 根据权利要求 3所述的 JTAG设备, 其特征在于, 所述光耦合器包 括:
CATHODE引 ip、 ANODE引 ip、 VO引 !7、 GND引 ip、 VCC引 P和 VE引脚; 其中, 所述 VCC引脚和所述 VE引脚连接, 所述 VE引脚和所述 VO引脚之间连接有一上拉电阻;
所述 CATHODE 引脚与所述数据输入引脚对应的寄存器连接且所述 vo引脚与所述数据输入引脚连接, 或者,
所述 CATHODE 引脚与所述模式选择引脚对应的寄存器连接且所述 VO引脚与所述模式选择引脚连接, 或者,
所述 CATHODE引脚与所述时钟引脚对应的寄存器连接且所述 VO引 脚与所述时钟引脚连接, 或者,
所述 CATHODE引脚与所述复位引脚对应的寄存器连接且所述 VO引 脚与所述复位引脚连接,
所述 CATHODE 引脚输入为高电平信号时, 所述 ANODE 引脚与 CATHODE引脚之间的二极管和所述 VO引脚与 GND引脚之间的二极管均 截止, 所述数据输入引脚、 模式选择引脚、 时钟引脚或复位引脚通过所述 上拉电阻被拉到所述 VCC引脚的电平, 将高电平信号传输至所述 JTAG可 编程逻辑器件;
所述 CATHODE 引脚输入为低电平信号时, 所述 ANODE 引脚与 CATHODE引脚之间的二极管和所述 VO引脚与 GND引脚之间的二极管均 导通, 所述数据输入引脚、 模式选择引脚、 时钟引脚或复位引脚通过所述 上拉电阻被拉到 GND引脚的电平, 将低电平信号传输至所述 JTAG可编程 逻辑器件。
5、 根据权利要求 3所述的 JTAG设备, 其特征在于,
所述可编程逻辑器件还包括: 数据输出引脚对应的寄存器;
所述光耦合器还与所述数据输出引脚连接。
6、 根据权利要求 5所述的 JTAG设备, 其特征在于,
所述 CATHODE引脚输入为高电平信号时, 所述数据输出引脚对应的 寄存器通过所述上拉电阻被拉到所述 VCC引脚, 将所述高电平信号存储在 所述数据输出弓 )脚对应的寄存器中;
所述 CATHODE引脚输入为低电平信号时, 所述数据输出引脚对应的 寄存器通过所述上拉电阻被拉到所述 GND引脚,将所述低电平信号存储在 所述数据输出弓 )脚对应的寄存器中。
7、 根据权利要求 1至 6任一项所述的 JTAG设备, 其特征在于, 所述 JTAG可编程逻辑器件的引脚对应的寄存器为一个寄存器, 所述 JTAG可编 程逻辑器件的各引脚分别对应该寄存器中的一位; 或者,所述 JTAG可编程 逻辑器件的各引脚分别对应一个寄存器。
8、 根据权利要求 3至 6任一项所述的 JTAG设备, 其特征在于, 所述光耦合器允许通过的信号的频率大于所述 JTAG 可编程逻辑器件 的下载频率; 和 /或,
所述可编程逻辑器件具体为: 通用输入 /输出 GPIO扩展器或者复杂可 编程逻辑器件 CPLD。
9、 根据权利要求 1或 2所述的 JTAG设备, 其特征在于, 所述隔离电 路具体为: 利用电容实现隔离的数字隔离电路。
10、根据权利要求 1至 6任一项所述的 JTAG设备, 其特征在于, 所述 JTAG设备还包括: 具有以太网口的以太网芯片, 所述以太网芯片与所述处 理器连接, 用于将所述以太网口接收到的 JTAG数据传输至所述处理器; 所述处理器用于将所述 JTAG数据通过所述隔离电路下载到所述 JTAG 可编程逻辑器件中。
11、 一种隔离电路实现 JTAG数据传输的方法, 应用于包含有 JTAG可 编程逻辑器件和处理器的 JTAG设备中, 其特征在于, 该方法包括:
隔离电路获取处理器对所述隔离电路中的与所述 JTAG可编程逻辑器 件的引脚对应的寄存器写入的高低电平信号;
所述隔离电路根据所述高低电平信号,驱动所述 JTAG可编程逻辑器件 的引脚, 将高低电平信号对应的 JTAG数据从所述处理器下载到所述 JTAG 可编程逻辑器件。
12、 根据权利要求 11所述的方法, 其特征在于, 该方法还包括: 隔离 电路将 JTAG可编程逻辑器件的引脚的高低电平信号输入到寄存器,等待处 理器的读取。
13、 根据权利要求 11或 12所述的方法, 其特征在于, 所述处理器对 寄存器写入高低电平信号之前, 还包括: 具有以太网口的以太网芯片将以 太网口接收到的 JTAG数据传输至处理器。
PCT/CN2010/075372 2009-07-23 2010-07-21 Jtag设备及实现jtag数据传输的方法 WO2011009409A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US13/386,417 US8689063B2 (en) 2009-07-23 2010-07-21 JTAG apparatus and method for implementing JTAG data transmission
EP10801968.8A EP2448121B1 (en) 2009-07-23 2010-07-21 Jtag apparatus and method for implementing jtag data transmission

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910089620.6 2009-07-23
CN200910089620A CN101621293B (zh) 2009-07-23 2009-07-23 Jtag设备及隔离电路实现jtag数据下载的方法

Publications (1)

Publication Number Publication Date
WO2011009409A1 true WO2011009409A1 (zh) 2011-01-27

Family

ID=41514379

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/075372 WO2011009409A1 (zh) 2009-07-23 2010-07-21 Jtag设备及实现jtag数据传输的方法

Country Status (4)

Country Link
US (1) US8689063B2 (zh)
EP (1) EP2448121B1 (zh)
CN (1) CN101621293B (zh)
WO (1) WO2011009409A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325081A (zh) * 2011-07-15 2012-01-18 福建星网锐捷网络有限公司 热插拔隔离方法、装置及主控板
CN104330978A (zh) * 2014-09-30 2015-02-04 苏州天准精密技术有限公司 一种长距离传输jtag信号的装置、仿真系统及其方法
CN115550105A (zh) * 2022-10-13 2022-12-30 杭州雷风新能源科技有限公司 一种低成本可隔离的两线制数据传输方法及其电路
CN115811186A (zh) * 2022-12-20 2023-03-17 滁州市博创电气有限公司 一种cbc-mc模块电路及方法

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621293B (zh) * 2009-07-23 2012-09-26 中兴通讯股份有限公司 Jtag设备及隔离电路实现jtag数据下载的方法
TW201221981A (en) * 2010-11-24 2012-06-01 Inventec Corp Multi-chip testing system and testing method thereof
WO2013048528A1 (en) * 2011-10-01 2013-04-04 Intel Corporation Packetizing jtag across industry standard interfaces
US8856600B2 (en) * 2012-06-21 2014-10-07 Breakingpoint Systems, Inc. JTAG-based programming and debug
US9026688B2 (en) * 2012-06-21 2015-05-05 Breakingpoint Systems, Inc. Systems and methods for programming configurable logic devices via USB
CN103019139A (zh) * 2012-12-04 2013-04-03 中国北方车辆研究所 一种用于dsp的jtag隔离电路
CN104156288B (zh) * 2014-06-26 2018-01-05 西安空间无线电技术研究所 一种基于jtag链的故障定位和软件升级电路及其实现方法
CN105487404A (zh) * 2015-11-28 2016-04-13 江苏宏宝电子有限公司 一种基于磁隔离技术的dsp仿真器
CN110413550B (zh) * 2018-04-27 2022-02-25 北京天诚同创电气有限公司 一种芯片串口程序下载控制电路
CN108958778B (zh) * 2018-08-27 2022-03-25 惠州Tcl移动通信有限公司 一种移动终端nfc固件升级方法、移动终端及存储介质
US10746798B1 (en) 2019-05-31 2020-08-18 Nvidia Corp. Field adaptable in-system test mechanisms
CN110378155B (zh) * 2019-06-25 2021-06-29 苏州浪潮智能科技有限公司 一种服务器串行口禁用保护电路、方法
CN111177723B (zh) * 2019-12-06 2022-05-31 苏州浪潮智能科技有限公司 一种fpga程序下载口的安全保护装置及方法
CN112395224B (zh) * 2020-10-16 2023-03-21 锐捷网络股份有限公司 数据处理方法、系统、串接装置及电子设备
CN112506172B (zh) * 2020-12-07 2022-09-30 天津津航计算技术研究所 一种多cpld实时监测装置
CN113377153B (zh) * 2021-04-29 2023-03-24 山东英信计算机技术有限公司 一种多路网卡设备的时钟隔离装置及方法
CN114880275B (zh) * 2022-05-16 2023-12-12 无锡职业技术学院 一种可记忆操作步骤的通用化程序传输系统及传输方法
CN117271413B (zh) * 2023-11-21 2024-02-02 成都电科星拓科技有限公司 一种支持热插拔的电路及方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001029666A1 (en) * 1999-10-21 2001-04-26 Sony Electronics, Inc. Method and system for debugging a microprocessor core
US20040001432A1 (en) * 2002-06-28 2004-01-01 Douglas Albert Wescott Embedding a JTAG host controller into an FPGA design
CN201017277Y (zh) * 2006-12-22 2008-02-06 杭州华三通信技术有限公司 嵌入式系统的测试行动联合组隔离电路
CN101183139A (zh) * 2007-11-02 2008-05-21 中兴通讯股份有限公司 一种基于jtag接口的单板及其设计方法
CN101621293A (zh) * 2009-07-23 2010-01-06 中兴通讯股份有限公司 Jtag设备及隔离电路实现jtag数据下载的方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6760866B2 (en) * 1987-06-02 2004-07-06 Texas Instruments Incorporated Process of operating a processor with domains and clocks
US6704895B1 (en) * 1987-06-02 2004-03-09 Texas Instruments Incorporated Integrated circuit with emulation register in JTAG JAP
US6918027B2 (en) * 2001-07-30 2005-07-12 Hewlett-Packard Development Company, L.P. System and method for in-system programming through an on-system JTAG bridge of programmable logic devices on multiple circuit boards of a system
US7114109B2 (en) * 2004-03-11 2006-09-26 International Business Machines Corporation Method and apparatus for customizing and monitoring multiple interfaces and implementing enhanced fault tolerance and isolation features
CN100529765C (zh) * 2007-02-27 2009-08-19 中兴通讯股份有限公司 用于单板上的jtag链路的测试访问端口的复位装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001029666A1 (en) * 1999-10-21 2001-04-26 Sony Electronics, Inc. Method and system for debugging a microprocessor core
US20040001432A1 (en) * 2002-06-28 2004-01-01 Douglas Albert Wescott Embedding a JTAG host controller into an FPGA design
CN201017277Y (zh) * 2006-12-22 2008-02-06 杭州华三通信技术有限公司 嵌入式系统的测试行动联合组隔离电路
CN101183139A (zh) * 2007-11-02 2008-05-21 中兴通讯股份有限公司 一种基于jtag接口的单板及其设计方法
CN101621293A (zh) * 2009-07-23 2010-01-06 中兴通讯股份有限公司 Jtag设备及隔离电路实现jtag数据下载的方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102325081A (zh) * 2011-07-15 2012-01-18 福建星网锐捷网络有限公司 热插拔隔离方法、装置及主控板
CN104330978A (zh) * 2014-09-30 2015-02-04 苏州天准精密技术有限公司 一种长距离传输jtag信号的装置、仿真系统及其方法
CN115550105A (zh) * 2022-10-13 2022-12-30 杭州雷风新能源科技有限公司 一种低成本可隔离的两线制数据传输方法及其电路
CN115811186A (zh) * 2022-12-20 2023-03-17 滁州市博创电气有限公司 一种cbc-mc模块电路及方法

Also Published As

Publication number Publication date
US20120272111A1 (en) 2012-10-25
CN101621293B (zh) 2012-09-26
CN101621293A (zh) 2010-01-06
EP2448121A4 (en) 2014-08-13
EP2448121B1 (en) 2018-10-24
US8689063B2 (en) 2014-04-01
EP2448121A1 (en) 2012-05-02

Similar Documents

Publication Publication Date Title
WO2011009409A1 (zh) Jtag设备及实现jtag数据传输的方法
CN112580295B (zh) 多核SoC芯片的自动化验证方法、系统及装置
CN101604244B (zh) 一种实现fpga上电即用和远程升级的装置及方法
CN107066746B (zh) 基于i2c接口通过cpld来实现pca9555功能的方法
CN102521444A (zh) 软硬件协同仿真/验证方法及装置
CN101102566B (zh) 一种手机jtag调试接口信号设计方法及其调试方法
CN209560436U (zh) 一种NVMe硬盘背板
US7886244B2 (en) Driving values to DC adjusted/untimed nets to identify timing problems
CN104461624A (zh) 一种三维声波测井仪近探头测量模块的远程升级方法
JP2005510781A (ja) 取り付け可能なサブモジュールを有する電子装置のオンザフライコンフィギュレーション
WO2022237551A1 (zh) 安全启动装置及方法
CN216901630U (zh) 接口转换电路及芯片烧录装置
CN103116512A (zh) 一种cpld固件升级的方法
CN209086915U (zh) C8051f单片机程序烧录装置
CN116243148B (zh) 一种针对芯片i3c协议的调试和验证架构
CN206039399U (zh) 一种具有调试功能的嵌入式硬件系统
CN110413550B (zh) 一种芯片串口程序下载控制电路
CN110109006A (zh) 一种jtag电平转接板、单板及单板调试系统
CN213365511U (zh) 一种主机板及服务器
CN204028612U (zh) 一种can总线信号收发工具
TW202232320A (zh) 半導體裝置及其操作方法
TWI815734B (zh) 具兼容二通訊模組之m.2連接器的電子裝置及其兼容方法與電腦實施方法
US6963829B1 (en) Method and apparatus for interfacing a spectrum digital incorporated TMS470 evaluation board with a spectrum digital incorporated TMS320LC54X evaluation board
CN212364515U (zh) 一种soc芯片自动化qc装置
CN112559418B (zh) 一种jtag切换电路

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10801968

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 13386417

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2010801968

Country of ref document: EP