Recently I ordered a Nexys Spartan3-1000 / Cypress FX2 USB board from Digilent for work. It's been fun and I may well buy one personally, but like aways there are the suprises, the silly mistakes, and the 3 am still-doesn't-work-yets.
First impression is consistent with what I saw on the web site - it's a nifty little board. The stock version has a smaller FPGA, but the S3-1000 is only $20 more (of course that meant I spent all night downloading a new Webpack)
The new high density I/O connector finally has enough grounds (though confusingly the connector family is referred to as fx2 - not to be confused with the usb chip!)
The mini-USB jack broke off the board within the first hour, and on examination is seems that the metal shield tabs never really soldered to the board. Not too hard to fix, though it took a ton of heat to get it soldered down, and even then it is more the solder I added to the board "encapsulating" the lugs than wetting them.
It turns out the USB chip only has the 8 bits of port B connected to the FPGA, so FIFO transfers will have to be 8 bit. Probably not a problem, but one could wish for 16 bit.
The other 8 bits include the JTAG signals, some control bits, and some unused bits. Digilent's Adept software can download .bit files using these. I was also able to program the board using an old digilent budget parallel cable from an s3kit.
The expansion boards that plug in are spacious and worth getting more than one of. Unfortunately, plutting them in killed the jtag. Seeing the jtag is extended onto the expansion board I suspected long trace lengths and - it being Firday afternoon - simply chiseled them at the connector. That worked (wondering why there were 5 traces instead of
4) but turned out to be silly - turns out that plugging in the expansion board over-rides (via the 5th trace) a resistor controlling a gate shunting the expansion connector in other words, with the expansion connector plugged in, the jtag needs to have a shunt on the expansion board. Oh well, I can fix the expansion cards easily enough in the unlikely event I ever need JTAG out there.I then embarked on a hacking binge trying to download Cypress firmware and/or program the FPGA by using libusb on windows. 24 hours later, both work, via modified versions of the XUP & XC3SProg projects.
Some discoveries:
- at least under windows, must call usb_set_configuration() before usb_claim_interface(), had to modify the programs accordingly
- for some reason, even building with MinGW g++ I get a reliance on cygwin1.dll
- Digilent put a VID/PID eeprom on the board. Can modify the software to look for that VID/PID, or I finally just chiseled the trace across JP2 and am back to talking to cypress default VID/PID. I plan to install the jumper pins so I can quickly switch between compatability with the Digilent ADEPT software vs. homegrown efforts, and leverage the difference in identity to avoid any conflicts in having both digilent and libusb drivers installed on the computer.
- I modified XUP and it's X3SProg ioxusb.cpp to use the Nexys jtag pin assignments to port PD instead of those of the s3ekit or usb programming cable it was written for.
- PD6 controls a gate which puts the USB chip in the JTAG path.
- PD7 controls the voltage regulator for the rest of the board. HOWEVER, the FPGA will run (via the protection diodes I assume) off the JTAG signals if you leave them driven with this shut down. I added a new command (0xff) to the xup firmware interface that tristates all of the jtag signals when configuration is done to avoid this. This also re-enables the jtag header on the board for other programming methods.
My hacked up xup and XC3Sprog are a bit messy right now, but I may see about trying to contribute at least a description of the changes back to their authors.
Of course I'm still not doing anything _useful_ with the board... but that may wait for Monday.