usb_cpld_code
所属分类:单片机开发
开发工具:Visual C++
文件大小:26KB
下载次数:105
上传日期:2006-12-25 10:57:55
上 传 者:
david_liuccy
说明: usb_cpld_code.zip usbjtag - Variations on the implementation of a USB JTAG adapter.
(usb_cpld_code.zip usbjtag-o Variations n the implementation of a USB JTAG adapter.)
文件列表:
usbjtag\COPYING (17990, 2005-06-08)
usbjtag\cpld\jtag_logic.vhd (6418, 2006-04-09)
usbjtag\fx2\dscr.a51.dist (7658, 2006-04-23)
usbjtag\fx2\eecks.c (395, 2006-04-23)
usbjtag\fx2\eeprom.c.dist (2742, 2006-04-23)
usbjtag\fx2\fw.c (12906, 2006-04-09)
usbjtag\fx2\shift.a51 (3241, 2006-04-09)
usbjtag\fx2\usbjtag.c (17923, 2006-04-23)
usbjtag\fx2\usbjtag.Opt (1354, 2006-04-09)
usbjtag\fx2\usbjtag.Uv2 (2357, 2006-04-09)
usbjtag - Variations on the implementation of a USB JTAG adapter.
Copyright (C) 2005,2006 Kolja Waschk, ixo.de
----
usbjtag is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
usbjtag is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
----
== Purpose ==
The goal of the project was to build a budget USB JTAG adapter. Basically
it should allow direct I/O access to the JTAG signals from an USB host, but
additionally implement some sort of parallel/serial conversion as well for
higher transfer rates. While a combination of USB I/O device like FTDI FT245BM
with a custom logic for the parallel/serial conversion could be used, I started
with a prototype implementation in software on a Cypress EZ-USB FX2 controller.
That happens to be the controller in a device manufactured by my employer,
where it is used to configure an Altera Cyclone device. That gave me a nice
platform for testing.
I release the code for this homebrew firmware here. FX2 code is in the fx2/
subdirectory. The "usbjtag.c" file contains a descriptive text about the
mechanism how the host PC controls the JTAG chain via USB. Before compiling,
you'll have to rename the *.c.dist files to *.c!
For people who like to read VHDL better than C or English, I later also wrote
cpld/jtag_logic.vhd. When synthesized with Altera's Quartus II, its logic fits
into an EPM70*** CPLD and can interface to a FTDI FT245BM USB controller.
Both "hardware variants" are now interchangeable; the FX2 behaves like the
FT245BM with CPLD. It even simulates the EEPROM that has to be attached to the
FT245BM for configuration of Vendor ID etc. (but it ignores most of the extra
configuration sent by FTDI drivers to the FT245BM).
== USB IDs ==
Because I do not have a vendor ID, the "0x6666" prototype vendor ID is used.
This should never ever appear in any device to be used outside your lab/home
environment! To use a different ID, change eeprom.c and dscr.a51 accordingly.
== Hardware ==
Unfortunately, I do not have the time to present finished schematics for either
variant of the USB JTAG adapter. As the source is quite incomplete anyway, if
you're using it you're probably one of those people who easily can make up
their own schematics. In principle, they are like the drawings below (best
viewed with fixed-width font!). Add power supply, voltage regulator(s), level
shifter, termination resistors, and more, as required...
Variant A: Cypress FX2 as USB JTAG Adapter, booted from host PC (no EEPROM)
____________
| |
| Cypress |
USB__| EZ-USB FX2 |__JTAG(TDI,TDO,TCK,TMS)
| CY7C68013A |
|____________|
__|__________
| |
| 24 MHz XTAL |
|_____________|
Variant B: FTDI FT245BM plus EEPROM 93C46 plus CPLD EPM70***
_________
| |
| AT93C46 |
|_________|
__|__________ _________
| | | |
USB__| FTDI 245BM |__| EPM70*** |__JTAG (B_TDO,B_TDI,B_TMS,B_TCK)
|_____________| |_________|
__|__________ _|___________
| | | |
| 6 MHz XTAL | | 25 MHz Osc. |
|_____________| |_____________|
== Notes ==
Both variants haven't been gone through thorough testing, so please do not
consider it "production quality"!
I have only included code here that is purely my own work or taken from Cypress
library for the FX2 firmware. If you include support for this device in your
host software, please let me know, so I can mention it in this README.
And then please be so kind to include support for the USB-Blaster made by Altera
in your software as well, because: if your software does work with the FTDI +
CPLD variant presented here, chances are good that it could also make use of
their adapter (VID 0x9FB, PID 0x6001, "Altera" / "USB-Blaster"). But beware!
Don't conclude that my adapter could be used as a substitute for an Altera
adapter. It doesn't support Active/Passive serial mode and it certainly isn't
legal to build something that pretends to be made by someone else!!!
Quartus and USB-Blaster are trademarks of Altera Corporation.
近期下载者:
相关文件:
收藏者: