I'm going to test out my Dangerous Prototypes XC9572XL board before I try assembling my own board.
- I'm installing the 15GB Xilinx ISE Webpack 14.7 VM version on Windows 10 (Home?) 64-bit. It normally installs its own copy of VirtualBox but instead it detects the VirtualBox I already have and offers to just add to that (with a warning about being untested on my version).
- It takes a long time at the "Import ISE Virtual Appliance" step. It's an
ova
file. - I've dug out my DP XC9572XL board and Bus Blaster v2.0a1.
- I downloaded
CPLD.Breakout.Package.v1.0.zip
. It's a ZIP of this GitHub tree. I don't know whether I'll actually need it, but it includes:Device_examples
: Various examples in here that are referenced here. That same page also references the "Logic analyzer example in 72 macrocells" that is included in the tree asVerilog-LogicAnalyzer/trigger.v
(in Verilog). NOTE:Device_examples
includes both.sch
files (EAGLE Schematic files; I think used only to make the screenshots in the DP Wiki) and.xise
files (Xilinx ISE project files?) that must be the actual "schematic capture" logic implementations.PCBs_production
: Schematics and PCB layouts, etc, for XC2C and XC9572XL boards. EAGLE format.Programmer_BusPiratev3
: Firmware/tools for using Bus Pirate to "play" XSVF binary via JTAG to program the CPLD? Includesxc95prog.xsvf
which is probably the default XC95 firmware with the inverse LED toggle demo.Tutorials
: Includes the code for XC95 Tutorials that are probably what is described here.
- Get to know my Bus Pirate v3.5 again: I'll use it as my power supply.
- Plug in Bus Pirate via USB.
PWR
led comes on. Windows recognises it asCOM13
for me. Windows offers "Advanced" settings for the device, allowing the COM port number to be changed, if needed. - Configure PuTTY to use
Serial
mode toCOM13
at 115200 bps. PuTTY has advanced settings inConnection > Serial
: Ensure 8/N/1 andFlow control
should be set toNone
. - Start the connection and hit ENTER, and hopefully the
HiZ>
prompt will appear.?
command can be used to see available options. i
command shows version info:HiZ>i Bus Pirate v3.5 Firmware v6.1 r1676 Bootloader v4.4 DEVID:0x0447 REVID:0x3043 (24FJ64GA002 B5) http://dangerousprototypes.com
- Not sure what version is documented here but my version lacks some bus modes inc. JTAG. This is what I get from the
m
command:HiZ>m 1. HiZ 2. 1-WIRE 3. UART 4. I2C 5. SPI 6. 2WIRE 7. 3WIRE 8. LCD x. exit(without change)
- Either my version is old, or my version is newer (and the extra modes were removed for other reasons). There's some info here (under "Old legacy stuff") that talks about my firmware v6.1 being official, but old. That page also explains that the BusPirate/Bus_Pirate repo on GitHub is where you can get the best new firmware, with discussion here about its release. More info about v6.1 and JTAG here and it effectively explains this old version of the firmware does not include terminal-mode JTAG but it can be used in a binary mode via OpenOCD (at least I think that's what it means).
- Check pin states with
v
command:I think this can be read as follows, after thePinstates: 1.(BR) 2.(RD) 3.(OR) 4.(YW) 5.(GN) 6.(BL) 7.(PU) 8.(GR) 9.(WT) 0.(Blk) GND 3.3V 5.0V ADC VPU AUX CLK MOSI CS MISO P P P I I I I I I I GND 0.00V 0.00V 0.00V 0.00V L L L L L
Pinstates:
line:- 1st line identifies pin number and colour when using the supplied probes (hooks on IDC ribbon).
- Pin name.
- Pin function (
P
= Power;I
= Input?) - Current level.
0.00V
indicates that power supplies are off.
- There is a
W
command to turn PSUs on, andw
to turn them off, but these commands don't work inHiZ
mode. - Per this, PSUs can only be enabled if not in
HiZ
mode, and PSUs (3.3V, and 5V) can supply 150mA each. - I tested with my DMM: in the initial
HiZ
mode, the+5V
pin is not powered. - By doing
m2
orm8
we can go to a mode that requires no other choices to be made, and theMODE
LED will turn on. - Doing
W
now should turn on theVREG
LED, show about 5V on the DMM, andv
should show about 3.3V on pin 2 and about 5V on pin 3:LCD>v Pinstates: 1.(BR) 2.(RD) 3.(OR) 4.(YW) 5.(GN) 6.(BL) 7.(PU) 8.(GR) 9.(WT) 0.(Blk) GND 3.3V 5.0V ADC VPU AUX SCL SDA - - P P P I I I O O O I GND 3.29V 5.16V 0.00V 0.00V L L L L L
- Go back to
m1
to turn off PSU and return to safe HiZ state. - Attach proper hooks/probes loom to BP, attach GND and 5V hooks to DMM, and test with
m2
followed byW
to make sure the hooks have their PSU lines working properly. - Turn off PSUs with
w
, then attach GND and 5V hooks toGND
- Make sure BP is in HiZ mode with
m1
. - Plug in BP hooks/probes, and attach to XC95 board: GND hook to
GND
on XC95, and 5V hook toV+
on XC95. - Attach DMM to XC95's JTAG header:
GND
andVTG
. This will be for testing the XC95's 3.3V supply. - Put a jumper across the XC95's
3V3 / IO
header pins. This selects the main 3.3V supply as theVCCIO
voltage. - Go to mode
m2
and doW
command. - DMM should show about 3.3V, and XC95 board should have
PWR
LED lit, at minimum. - With default firmware, XC95's
D1
should be lit. - Press the pushbutton on the XC95, and while pressed,
D2
should be lit andD1
will turn off. - This verifies that the default firmware is working.
- Go to mode
m1
again to turn everything off. - VERY IMPORTANT FOR NEXT TEST: Disconnect 5V hook.
- Attach 3.3V hook to the XC95's
3V3
. - Go back to mode
m2
and doW
again. - Test in points 6..9 should work again. NOTE: I've observed that the DMM shows
VTG
to be a little flat: A hair under 3.2V. This is probably the BP supply's fault. - Go to mode
m1
again to turn everything off. - Move the 3.3V hook's connection to the XC95's
VTG
pin. Probably need to disconnect the DMM. - Go back to mode
m2
and doW
again. - Test in points 6..9 should work again: This should show that the JTAG
VTG
pin is in fact wired up to the same net as the3V3
pin. - Go to mode
m1
again to turn everything off. - It should also be possible to power
V+
using the 5V hook and take theVIO
jumper off and instead power theIO
pin using the 3.3V hook... but I'm not going to take a risk there and muck around with that if I don't need to :)
IMPORTANT: Don't ever power the XC95's V+
and 3V3
(or VTG
) lines at the same time. That would mean two different power supplies, and possibly contention, and might lead to damage.
- DP Bus Blaster method of programming using UrJTAG reportedly doesn't work properly with XC9572XL due to a UrJTAG bug related to timing.
- Instead of using Bus Blaster, loading the Bus Pirate with the XSVF player firmware is recommended instead.
- Some specific mention of the issue here. Supporting findings here.
- See an alternative way of programming XC9572XL using Bus Blaster using xc3sprog. This might require a Linux VM with USB pass-through for the Bus Blaster. NOTE, however, that this utility uses JEDEC (
.jed
) files instead of (X)SVF...? It's further mentioned here but not sure how relevant it is. - Programming with Xilinx ISE is apparently another alternative, but could be complicated without the right hardware/cable.
- Someone did a write-up of the problems they were having with all this in Jan 2019. Might be helpful to follow along. Since Jan 2019, there has been a (major?) new version of UrJTAG (going from 2018.09 to 2019.12)... maybe it has a fix?
This page describes the overall concept and process.
NOTE: I've got BP firmware 4.4, which is good because v4+ firmware makes a few things easier.
- Download
BPv3.XSVFplayer.v1.1.zip
(referenced on this page). - Plug in the Bus Pirate v3.5, and make sure its hooks are not attached to anything.
- Take note of the BP serial port (
COM13
in my case). - Connect to the BP serial port and make sure you're in HiZ mode; issue command
m1
if necessary. - Trigger the bootloader by issuing the command:
$
- Close the serial connection.
- Extract
BPv3.XSVFplayer.v1.1.zip
- Run
BusPirate-firmware\ds30 Loader GUI.exe
- Make sure your COM port is selected.
- For
Hex-file
, locatebpv3-xsvf-vb.hex
- Click the
Download
button. Don't try to interact with the app while it's writing the flash: I found it interrupted it and caused an error. I was able to retry theDownload
button, though, and it succeeded:Initiating download... Searching for bl . Found PIC24FJ64GA002 fw ver. 1.0.2 Waiting for bootloader to be ready...ok Writing flash...ok Download finished Tx 65.2kB / Rx 382 bytes / 12.3s
- Exit the ds30 Loader GUI and unplug the BP's USB.
- Plug the BP back in.
- With this firmware, the 5V and 3.3V PSUs should be on by default. Verified with DMM.
- Unplug BP again.
- Connect BP to XC95 JTAG header per this, plus 3.3V hook connected to
VTG
. - Plug in the BP and verify the XC95 still works (i.e. pushbutton toggling LEDs).
NOTE: To put back the original 6.1 firmware:
- Download
BusPirate.package.v6.1.zip
(referenced on this page). - It might be necessary to start the BP in bootloader mode by using the jumper trigger method, but I'm not sure.
Now to try programming the XC95...
From command-line, within the extracted BPv3.XSVFplayer.v1.1
directory, run:
BPXSVFplayer.exe -p COM13 -s 115200 -f xc95prog.xsvf
The first time I tried, I got this error:
D:\FPGA\BPv3.XSVFplayer.v1.1>BPXSVFplayer.exe -p COM13 -f xc95prog.xsvf
-----------------------------------------------------------------------------
BusPirate XSVF Player V.01
http://www.dangerousprototypes.com
-----------------------------------------------------------------------------
File is 53289 bytes, read 53289 bytes Opening Bus Pirate on COM13 at 115200bps, using XSVF file xc95prog.xsvf
Entering XSVF Player Mode
Waiting for first data request...ok
Sending 4096 Bytes (1000)...ok
End of operation reply 03
Device did not respond: XSVF_ERROR_MAXRETRIES
Thank you for Playing! :-)
This error shouldn't happen. I was using the BP hooks, and it was a mess, so I unplugged the BP from USB, and tried switching to Dupont wires. The first time I tried after plugging back in, it hung here:
File is 53289 bytes, read 53289 bytes Opening Bus Pirate on COM13 at 115200bps, using XSVF file xc95prog.xsvf
Entering XSVF Player Mode
Waiting for first data request... waiting for reply...
I unplugged the USB again, applied pressure to the Dupont wires, plugged the USB back in, and ran again, and this time it worked:
D:\FPGA\BPv3.XSVFplayer.v1.1>BPXSVFplayer.exe -p COM13 -f xc95prog.xsvf
-----------------------------------------------------------------------------
BusPirate XSVF Player V.01
http://www.dangerousprototypes.com
-----------------------------------------------------------------------------
File is 53289 bytes, read 53289 bytes Opening Bus Pirate on COM13 at 115200bps, using XSVF file xc95prog.xsvf
Entering XSVF Player Mode
Waiting for first data request...ok
Sending 4096 Bytes (1000)...ok
Sending 4096 Bytes (2000)...ok
Sending 4096 Bytes (3000)...ok
Sending 4096 Bytes (4000)...ok
Sending 4096 Bytes (5000)...ok
Sending 4096 Bytes (6000)...ok
Sending 4096 Bytes (7000)...ok
Sending 4096 Bytes (8000)...ok
Sending 4096 Bytes (9000)...ok
Sending 4096 Bytes (A000)...ok
Sending 4096 Bytes (B000)...ok
Sending 4096 Bytes (C000)...ok
Sending 4096 Bytes (D000)...ok
Sending 41 Bytes (D029)...ok
End of operation reply 00
Success!
Thank you for Playing! :-)
NOTE: During programming, the D1
and D2
LEDs go dim. I'm not sure why: I thought they would go Hi-Z.
After this, the button toggling worked again.
I then downloaded, programmed, and tested each of these in turn (all from here), verifying that they indeed worked as expected:
The final one ends up being the same as the demo that comes pre-loaded.
These are mostly outdated now. Could still try the "Pirate-Loader" console app and "Parallel cable and ISE", but the rest I'm not sure about...
- Originally I was planning to use "Pirate-Loader", because I wasn't sure if I could find a reliable source for the "ds30 Loader GUI", but it turns out it is in
BPv3.XSVFplayer.v1.1.zip
.- Below are my original notes for when I was going to try "Pirate-Loader" (which was surprisingly hard to find a trustworthy direct link for)...
- There's a utility called ds30 Loader which is apparently the original inspiration, and it is the GUI documented here.
- I'm suspicious of it, however, as trying to find a download for it lead me around in circles for a while.
- The "Pirate-Loader" console app is documented maybe a bit better and perhaps better-documented, so I might try that.
- Hopefully this is what I want: https://github.com/DangerousPrototypes/Bus_Pirate/tree/master/package/BPv3-firmware -- see
pirate-loader.exe
in there. - It seems
pirate-loader.zip
or similar, containingpirate-loader.exe
, can be found:
- This ("JTAG cables") says to use "Parallel cable and ISE" or "FT2232 JTAG". Not sure whether either of these means USB Blaster or DP Bus Blaster.
- This ("Loaders") says that (X)SVF files contain the CPLD configuration and it can be "played" via JTAG cable, with suggestions to use either:
- There are evidently two different versions of
BPXSVFPlayer
which report as "BusPirate XSVF Player V.01
":- There's the one we have from extracting
BPv3.XSVFplayer.v1.1.zip
above. It lacks the-x
and-r
options. - There's one in here which includes
-x
and-r
. When I run that version with-x
, I get:
The JTAGD:\FPGA\BPv3.XSVFplayer.v1.1>BPXSVFplayerV01a.exe -p COM13 -x ----------------------------------------------------------------------------- BusPirate XSVF Player V.01 http://www.dangerousprototypes.com ----------------------------------------------------------------------------- Performing Chain Scan.. Waiting for a chain scan reply Chain Scan Result: 04 93 40 60 59
IDCODE
value here is (I think)0x59604093
. Xilinx information about this code can be found here, and while it's a little screwed up, thexc9500xl.zip
BSDL file from Xilinx containsxc9572xl_vq44.bsd
which contains this information:...so our value ofattribute IDCODE_REGISTER of xc9572xl_vq44: entity is "XXXX" & -- version "1001011000000100" & -- part number "00001001001" & -- manufacturer's id "1"; -- required by standard
0x59604093
, in this format, comprises:Bits Field 0101
Version (i.e. 5; stepping 5?) 1001011000000100
Part number ( 0x9604
), but made up of1001011
(family code;0x4B
or 75) and000000100
(part size)00001001001
MFR ID ( 0x49
or 73); identifies Xilinx in the JEDEC list (see also here)1
Required by standard - There's the one we have from extracting
These notes are half-baked:
- Try out JTAG: Can we talk to the chip?
- Use BP to get to know how to control various modules, inc. via various serial protocols, and then make sure we can make the XC95 do the same: A good test to verify that the devices work before trying to prove we can do Verilog properly. Will help weed out programming mistakes, hardware faults, and general mishaps. BP will come in handy later when trying to do tests of my CPLD code/circuits.
- This says "5volts max" for
V+
. I'm sure it would take more, but don't push it. It's pretty tiny! - SVF is the standard format. XSVF is Xilinx' own compressed format. See also: http://dangerousprototypes.com/docs/JTAG_SVF_to_XSVF_file_converter
- Check the footprints of all components I actually intend to solder on.
- My screw holes are tiny. Diameter needs to be at least doubled to fit a standard PC screw (which fit my stand-offs), and head clearance needs to be WAY more.
- Better form factor to suit other devices it might plug into?
- Thinner PCB?
- Smaller boards, or put more on them?
- Footprints for different XC9500 chips. This could be tricky: XC9572XL's 64-pin pitch is 0.5mm, while 44-pin (?) version has a larger pitch.
- JTAG pins on the edge: Make into a nice 90° header?
- Larger pad for LDO.
- Beware thermal relief design: Pads need straight leads out to avoid tombstoning.
- Better capacitor placement.