Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

another thread about USB cables for CPLD's/FPGA

Status
Not open for further replies.

Buriedcode

Full Member level 6
Joined
May 6, 2004
Messages
357
Helped
43
Reputation
86
Reaction score
7
Trophy points
1,298
Location
London
Activity points
8,887
ft245rl vb.net

Hi,

I haven't posted here in a while, so bare with me. I have serached this forum, and many others, as well as google itself for idea's on how to solve the ever growing problem of 'programming CPLD's with no parallel port on PC'.

On my new computer, I no longer have a spare PCI slot for a PCI parallel port, and I would also like to be able to update firmware on CPLD boards using my laptop. We're going USB. And I am fully aware that current USB-LPT converters do not work.

I use many different devices, mainly Xilinx, Altera and lattice, and have built/purchased an LPT download cable for each vendor, with great success. In the future, if I get a new PC I will use my LPT PCI card, so I can use the parallel download cables. I will also order a device from this guy:

**broken link removed**

But I am dubious about whether it will actually work with all three parallel port download cables, as well as the speed issue.

So ultimately, my situation is: Need to program/download to CPLD's from lattice, Xilinx and Altera, using a USB port, and windows software. - preferably a nice simple GUI interface. I do NOT require any form of debugging, or special functions, purely just to get the JEDEC/SWF/STAPL file into the CPLD. This can use SVF files generated by all three vendors (if they are compatable), or STAPL files, it seems that all three vendors DO provide multiple options for outputting different file types.

Cost is a sensitive issue. I do not do enough work with these devices to warrent spending $$$ on a large commercial system, plus I am very intersted in 'rolling my own'.

Now, if anyone has done research on this will know, there is a LOT of information out there, and various commercial, as well as open-source, projects. This is confusing and overwhelming, as some of it is outdated, some is biased towards only a single vendor (xilinx, or altera mainly) or with host software used for integration into a debugging enviroment.


Hardware: Many devices, ranging from Altera USB blaster clones, Xilinx USB clones, FT2232 based devices, Cypress FX-2 devices, even AVR. It seems that the hardware/firmware side is well documented, and I don't think I would have trouble cloning one of these ideas. As long as it can be used with 'good' host software, the only issue with it would be the programming speed. I'm not after getting a 6mbit bitfile to an FPGA in less than 10 seconds, but I would hope that it would be as quick, if not quicker than the parallel port cables.

Software: This is where it gets tricky. OpenOCD, UrJTAG and many others seem to require compiling on linux based systems. I am a hardware engineer, with some knowledge of highlevel programming and OS enviroments, but not enough to be comfortable compiling my own. The documentation for both the above opensource programs is beyond my understanding, as I am a simple user who prefers pretty windows based GUI's as opposed to command line/DOS/linux apps.

Ideally, I am looking for a small standalone app, with GUI< that runs on windows, which can simply take in an SWF file (or stapl, or perhaps multiple file types), detect the USB cable, detect the device and program it. The use of SVF files *should* allow me to use the same software/hardware for all xilinx/altera/lattice devices I use. (almost ALL CPLD's with JTAG)

The real confusing point is where to start? I could attempt to write my own from scratch, but this would seem counter-productive as there are so many opensource projects out-there which do most of the work.
Does the Altera, or xilinx cable support programming of NON vendor devices using the generic SVF file? If that is the case then of course I could buy/build a single 'official' USB download cable, and use that for all devices (albeit jsut for progrmaming).

Or perhaps, could one write a small VB/windows application that 'calls' openOCD, essentially meaning I could just program a simple front-end for it, letting it handle the command lines, form tick boxes and drop down menus in the GUI.

I have looked into the Amontec JTAG key and JTAGkey-tiny, and whilst that seems a very cost effective solution (the tiny is 29EURO's), their software is again, confusing.

I know I have mentioned 'what I want' several times, but just to reitterate...ideally something like IC-prog, but for CPLD's/PFGA's. No extra functionality, purely to successfully program devices. A nice stand-alone bit of kit.

Any idea's? Or have you all heard these questions too many times before? :)

Hope someone can help.

Buriedcode.
 

svf player lattice with xilinx usb

A few comments.

CPLD programming through SVF-files is supposed to be portable between different programming hardware, generally. But not all vendor specific programming tools support SVF standard, &#65ltera e. g. uses JAM STAPL files for similar purposes. So additional conversion steps may be necessary. Most tools provide a way to access user devices in mixed JTAG chains, including some kind of programming support. Thus it should be feasible to program multi vendor CPLD and JTAG accessible processors through one programming adapter and vendor tool.

It's obvious however, that most designers don't utilize this option and have separate JTAG interfaces for each vendor and and possibly each individual PLD.

If we also consider JTAG debugging, there's most likely no other option, than using vendor specific adapters and tools. Cause each vendor has a different JTAG connector pin mapping, usually, this may be already a plausible reason to use individual JTAG interfaces.

Regarding PC-side hardware connections, a simple professional solution is a computer that provides suitable classical interfaces. If you own a Fujitsu Siemens Lifebook E, you'll rate this USB-to-LPT discussions at best interesting. PC-Card true LPT adapters are also available, B.T.W., and cheaper than a special USB-to-LPT adapter.

As pointed out in other discussions, some USB LPT interfaces have an option for low level pin control, that may be utilized by a true LPT emulation driver. As all accesses go through hardware virtualization in a protected mode driver, they are considerably slower than with a real hardware adapter. However, LPT programming adapters are operated rather slowly anyway, so the overhead may be tolerable.
 

stapl svf converter

FvM said:
CPLD programming through SVF-files is supposed to be portable between different programming hardware, generally. But not all vendor specific programming tools support SVF standard, Altera e. g. uses JAM STAPL files for similar purposes. So additional conversion steps may be necessary.

Agreed. I have checked XIlinx and Lattice software for generation of SVF files, as well as go through each file to check exactly what SVF commands each uses. Thankfully, both seem to abide by the basic standard, creating very similar looking SVF's. If, and I stress *IF*, I was to write my own host software, or use an opesource version, I am confident I could write a small script to remove/bypass any SVF commands that aren't needed, or appear to be wildly differetn from vendor to vendor. Altera also appear to support this file output:
http://www.altera.com/support/kdb/solutions/rd07222008_677.html



FvM said:
Most tools provide a way to access user devices in mixed JTAG chains, including some kind of programming support. Thus it should be feasible to program multi vendor CPLD and JTAG accessible processors through one programming adapter and vendor tool.

Although this would be biased towards one particular vendor, it is an ideal solution.
Whether I clone a proprietary download cable or buy one, only one would be needed. And with good software support should make life relatively easy.

FvM said:
It's obvious however, that most designers don't utilize this option and have separate JTAG interfaces for each vendor and and possibly each individual PLD.

Whilst being a great point, whether I buy, or build, I have no problems with building a simple adapter cable that changes the input (from programmer) pinout, to the vendors pinout. I have stupidly used my own custom pinout for lattice devices anyway (2x3, not 1x8, or 2x5), so this would need to be done whatever method I choose.

FvM said:
Regarding PC-side hardware connections, a simple professional solution is a computer that provides suitable classical interfaces. If you own a Fujitsu Siemens Lifebook E, you'll rate this USB-to-LPT discussions at best interesting. PC-Card true LPT adapters are also available, B.T.W., and cheaper than a special USB-to-LPT adapter.

Agreed. Obviously, the simplest solution would be to use an LPT card, be it PCI for desktops or PCIMA cards for laptops. Unless I purchase a new computer, both options are out for me (no spare PCI slot!!), even though I already own a nice cheap LPT PCI card that worked beautifully with all parallel port dongles.

About the USB2LPT adapter. If it did happen to behave exactly like a true host LPT port, then I would not have this problem :D I undersatnd it is incredibly difficult to implement a true 'direct I/O access' system via USB, not only slowing it down, but because of this lack of speed, also perhaps not working with specific dongles at ALL. The price of that guys website is reasonable, and even if it doesn't work, might prove to be a nice cheap FX-2 development board for me.

Oh and about debugging. For now at least, I have no interest in using any USB-JTAG system for debugging of any kind. You are correct in saying that 'vendor specific' cables are the onyl real way. Altohugh openOCD would work, as that is what it is designed for, I do not have any debugging enviroment software on my PC for it to be integrated in. If I start to use this function, I will of course look into this further.

Whilst I post in various forums, and send 'pinger' emails to people, I tihnk I will start attempting to write my own software to see if I can get a nice simple SVF player to work. With free hardware design.

Thankyou!

Buriedcode.
 

lattice usb download cable clone

Well yes this topic is an obligatory one with so many stupid jtag cables and the lack of any stardard .Having a laptop as a workhorse. I thought about buying all of the above .Then finnally i found a much better solution and is pcmcia to PCI box extensions .The only problem is that they are kinda pricy .$1000.
https://sewelldirect.com/pcmcia-to-pci-1-slot.asp
But doing some careful ebay hunting i bought this solution for $150
**broken link removed**
The great thing is that i can use a parallel port ,a XDS560 emulator ,and even an external VGA board with my laptop .So good bye all those expensive usb solutions.
 

fx2 usb open source

Elton, thanks for adding to the thread :)

It really is a sore point isn't it? Although, As I said in my first post..if I was using these devices in a professional manner, on a medium/large scale, I would have bitten the bullet and sacrificed my PCI soundcard for a LPT one. As well as purchased an overly expensive USB JTAG system for my laptop.

The device you are talking about seems like a great idea, not just for parallel ports/JTAG, but also for pretty much anything :D My laptop is old, but not old enough to still ahve a LPT port. Its PCIMA slot is taken up by a wifi card, but I won't need that when in the field updating designs/firmware.

So, some progress.

I have just ordered one of these:
**broken link removed**

Although I do not believe it will be nearly as quick for most parallel port download cables, I bought it out of interest. When I have recieved it I shall post (as well as email the designer) a list of JTAG software/programmers it works with. He says on his site that 'ispVM system' from lattice works. And that software can accept multiple input files (SVF, STAPL etc..). I can only hope it is equally as effective with xilnx and altera software (but I am not holding my breath).

For a more permenant/eligant solution, after spending 5 hours googling and making notes, I think I shall attempt to use the FT2232, and write my own software in VB.NET. The FDTI's website is extremely useful for anyone wanting to write software to interface with their parts. Their description of the JTAG DLL file used for the FT2232 also gave me a very good idea of a program structure. This means, if (again IF) all goes well, I could attempt to design another, cheaper, easier hardware interface to use with the program. Perhaps an Atmega8-based low speed USB app.

Depending on how it goes I may share this, as a brutally simple 3rd party programming system. No frills, no extra software to install, just a small app, where you plug in the hardware, load in your SVF (or perhaps STAPL) file, and program. I am building up BSDL libraries as I go as well, so that the host software can at least attempt to identify the manufacturer and part number of a device on the chain. So far these are mainly the parts I use:

lattice MACH4A series
Lattice MACHXO
Altera EPM70**
Altera EPM1270 (maxII device)
Xilinx 9572/144/36 (plus their XL equivilents).

Perhaps a parser, which can read a BSDL file and add the information is contains into a library for the host software. Even better would be a batch system, that scans a folder and adds all devices for which there are BSDL files.

Without getting too ahead of myself here, there *may* be a possibility of configuring the FT2232 device as an Altera USB blaster as well. Although this may seem a bit OTT, it may be possible. (plus it adds evetra functionality, making it Beter for Altera devices).

Well theres an idea. Even if I can't do and it all goes south, I shall try to post a list of methods/workarounds to be able to configure xilinx, lattice AND altera devices with one 'box' via USB - For all you modern laptop users. Even if this involves a crude USB -LPT port, with a small CPLD to change the connections for different vendor parallel port cables (think amontec chameleon...but with USB).

I sincerely hope anyone interested in willing to help with the process will post in this thread. Although ideally I'm jsut after solving my own problem, it would be nice if we could create a cheap and simple replacement for educational/hobby purposes. Where cost, simplicity are paramount, and speed/debugging capability are second.

BuriedCode.
 

svf fpga

FTDI would be also my choice for a native JTAG adapter. But it can't work as an USB Blaster without additional hardware (a CPLD). And it seems to be complicated to make a FT2232 recognized as FT245/USB Blaster due to different EEPROM organization, at least when using the FTDI Mprog tool.
 

xds560 diy

FvM,

Good point! I was *hoping* the 2232 could be used as a pseudo FT245 type thing, but of course its a different device, with different commands and extra features, so I guess you're correct. The addition of a CPLD (for my own purposes) was not a problem, as I have oodles of EPM7064's, but for a open 'DIY' type afair, more chips is just a hassle (plus it would need to be configured, more hassle).

I know I'm taking this too far, as I could just buy a cheap USB altera clone from ebay, or knock one up myself with the information provided here in a another thread. The altera software can convert generic SVF (from other vendors) to JAM/STAPL for which the USB blaster can be used directly with their software. In effect, I'm pretty sure one could get away with just having an altera USB blaster as a generic CPLD programmer, for which only Altera chips have higher function support.

But ...... that would take the fun out of attempting to design my own generic system! Free from the tyrany of proprietary cables/hardware. Saying that, I tihnk I'll still knock up a USB blaster prototype, as I have most of the parts laying around here.

I have collected a large number of bookmarks, and it seems there are MANY wonderfully designed FT2232 'dongles', the vast majority of which are pretty much identical, only the pinout of the 'JTAG' connector is changed (most used for ARM debugging with openOCD) and the voltage buffering. This makes life much easier for everyone else, as they are not restricted to a specific design, nor software.

Perhaps I have missed something in all my research, but you would ahve thought others would have written an 'SVF player' for both windows, and linux, with a nice GUI and made it open source? I know amontec have their own one (can't test it, dont' own a JTAGkey) which appears to be command line...it would be trivial for them to add a simple GUI to that. I would email them to suggest support for third party 'generic' hardware, but I don't think that would do their business any good :) To be fair to the guy from Amontec, his name crops up in MANY forums about JTAG, not only talking about his products but also providing very useful information for us designers.

Gotta stop these long posts....

Scott.
 

diy cpld programming

Hi again,

Well I have been collecting some info about this, everything from controlling a TAP controller in a small micro, all the way to looking into writing routines in VB.NET (theres already plenty of stuff for you linux peeps).

I am now confident a very basic setup can be achieved. For the prototype, speed will not be a main concern, that can be optimised later. Ultimately the software should do the following:

Be able to load in a generic SVF file, check for errors, and generate a list of commands.
Scan the chain for devices, and their repective ID code's, comparing hex result with built-in library. Library can be updated via parsing BSDL files available from all CPLD vendor sites.
Successfuly packet up comands for FT2232, and store read-back information.
Compare read back info with expected TDO patterns (along with their masks).
Report the following errors: SVF syntax, SVF unknown command, device not present, verify error at XX (only reports first ten errors).

As the FTJTAG.DLL is nice and generic, without too much direct FT2232 information, it sohuld also be possible to add functionality for 3rd party hardware, I am also working on a AVR-USB low-speed dongle, using the atmega88. Although low speed, because we have direct acccess to I/O's, and some intelligence in the dongle, it could be optimised to achieve a fairly decent configuration time. not only that, but being opensource, and only using a generic micro, it would be simple AND cheap. Possibly using the already existing USBasp hardware.

Again, I must confess I am NOT a seasoned programmer. I have only ever written a few basic VB6 and C utilities, much more of a PIC/AVR coder here. But due to the lack of software specifically for configuring CPLDs/FPGA's independant of manufacturer, it seems necessary. No compiling, no command lines, no addition modules to be downloaded. Purely using any FT2232 JTAG dongle, or compliant device, and install the software. Then one should be able to use their host software to create an SVF file (of which all vendors I've checked do), load it into the software, and blammo. Job done.

Don't expect this to be ready in a few days. I first have to learn programming lol

BuriedCode.
 

visualbasic usb2lpt

Right, an update :)

I have managed to wirte some simple software to get the IDcode from a jtag device, using the ft2232. woot. Nothing special, but as I have never written high level software before, its working.

I'm looking for any C/VB code for communicating with the ft2232 in JTAG mode. I have all the FTDI examples but they aren't that helpful with regard to 'command queuing'

Any help would be appreciated, the bigtgest hurdle will be writing an SVF interpreter :/

BuriedCode.
 

Hi,

I know this thread is over 2 years old - I started it - bit for those who are having issues configuring FPGA's/CPLD's from Xilinx or Lattice I've revisited some work requiring programmable logic and have some workarounds/solutions.

Altera devices no longer seem to pose much f a problem, because many companies in china have made several clones of the 'USB blaster' at a reasonable price or around $15-30 USD. These work quite well, and behave like the origianl, so users can use the logic analyzer built into Quartus II. The Altera software (Quartus II) however, is still a joke to use, and gets worse every version :)

Options for those who don't have a parallel port on their PC:

1. USB2LPT. (**broken link removed**). Works with both ispVM (Lattice) and Impact (Xilinx) although its slow, and can be a sod to get working correctly. If you require a parallel port for 'non printer' purposes such as device configuration, big banging, this does actually work quite well, altohugh it is painfully slow in most cases.

2. OpenOCD. This took me around 20 hours total work to build, configure, and use in WindowsXP. There are many versions, and it can be tricky with certain FTDI drivers (theres official drivers, and libftdi, the latter is non-commercial). I have only tested this with a generic FT2232D generic programmer configured as a 'Jtag-Key-tiny'. Its interpretation of SVF files is also a sticky problem - few vendor actually stick to a 'true standard' and so ispLEVER (lattice) requires SVF files to be generated with 'revision C' formatting. I also do not fully trust is has configured my devices correctly because several projects don't behave the same when configured this way as opposed to a 'true parallel port programmer'. I'm working on a very simple front end GUI in VB.NET purely to make playing SVF files for CPLD's as painless as possible. (with the ability to generate config files for devices from BSDL files, and programmers. Although I probably mentioned I would do this a couple of years ago, I have only 'just' got OpenOCD to behave.

3. UrJtag. Was unable to get this to communicate at all with my FT2232D board (basic, no frills, just the FT2232D, and a buffer) but it was the only open-source software I tried which actually properly controlled Altera's USB blaster. Was much easier to work with than OpenOCD - but no-where near as versatile. Altohugh I sitll have it installed, I abandoned it because of reliability issues. Would fail SVF programming with both Xilinx and Lattice devices around 40% of the time.

4. True custom solution.
This is something I have been toying with - a windows based, simple, reliable GUI, along with support for as many USB dongles as I can. Along with an FT2232D generic, USB blaster, as well as a possible USB-microcontroller (not cypress, but AVR or PIC as they are much easier to work with). The idea of being able to program microcontrolelrs seems fruitless as there are many options for that, would be a 'just CPLD/FPGA' setup, able to read/play *all* vendors' SVF files, and perhaps some jedec standards with a multichain board.

The reason this lsit is so short, when there have been a few other ad-hoc solutions is because very very few meet the following criteria:
- can read almost any SVF file without crashing. (unknown commands, or unknown format for RUNTEST IDLE time)
- Can work with multiple USB dongles, including existing designs.
- Is free, or opensource.


I am determined to come up with a neat, cheap, and simple solution that doesn't require people to 'custom build' software (we're not all linux people) with a very simple few-clicks GUI, that puts current FPGA/CPLD manufacturers to shame. Sure if we were all large companies who could afford the development hardware required, there would be no need - but for those of us who have small CPLD's/FPGA's and like to experiment, it can be extremely frustrating to 'get started' when one must either spend $100+ or a significant ammount of time to download config to hardware.

If it seems like a good idea, I may eat my words and sell a relatively cheap hardware/software package (simile to Amontecs Jtagkey) but purely for programmable logic. In the meantime, progress is slow due to it being a 'spare time hobby' as opposed to an industry requirement.

Any comments, idea's, suggestions, are welcome.

BuriedCode.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top