2

I am trying to find SPI connections to download my program to Xilinx XC3S50A-4VQG100C but can’t figure which pins are SPI pins.

Newbie alert : I just started learning FPGA and am trying to build my own dev board from the scratch ( I always learn better that way ). In microcontroller world all I needed to do was to simply connect MOSI, MISO, SCK , SS to connector pins and run the programmer but things are different here ! I am using Waveshare programmer enter image description here

Aug
  • 1,561
  • 6
  • 28
  • 63
  • FPGA is a programmable black box ... building your own dev board will not really teach you what is inside the black box, which is the FPGA part of the device – jsotola Jul 31 '21 at 18:25
  • FWIW, I think the Spartan3 series has been declared obsolete by Xilinx so you may have trouble finding tools you can use. – Elliot Alderson Jul 31 '21 at 18:49
  • @ElliotAlderson Xilinx ISE still works, though no longer updated for some years now. Few choices if you want to make your own FPGA board and don't want to deal with BGA. That's most of the reason I haven't attempted my own FPGA board. – DKNguyen Jul 31 '21 at 18:55

2 Answers2

7

If you are expecting to be able to just use your programmer to load a configuration bitstream directly into the FPGA which only stores that in specialized SRAM, you are in for a surprise when it forgets everything every time you power it down.

Unlike microcontrollers, the vast majority of FPGAs do not have onboard non-volatile memory. The SPI is intended to write to an external SPI flash memory. The FPGA will expect a certain protocol for the SPI flash memory and a particular wiring scheme to it.

Every time, upon power up, if the correct jumpers are in place, the FPGA will automatically run through some sequence to read its configuration bitstream from the SPI flash to configure itself. So you should read the manual carefully for the acceptable flash memory that can be used as well as the wiring scheme since this will make or break your board similar to getting the JTAG programming wiring wrong on a microcontroller.

If you missed this basic difference, chances are you you missed some other important gotchas that are different than microcontrollers. Read the manual carefully, or at least skim each section multiple times to spot glaring differences. There are other differences (like clocking and power supplies). There's a reason implementing an FPGA on a PCB is more difficult (sometimes much more difficult) than an MCU. Don't assume things on an FPGA are already taken care of like on an MCU. One is like driving manual and the other is like driving an automatic.

I suggest you get a development module first which is like a tiny stripped down dev board without almost nothing on it (usually just the FPGA, power supplies, clock, configuration ROM, sometimes some non-volatile ROM, sometimes RAM, maybe an ADC, and sometimes a USB programmer) that you can plug into your own board (or even a breadboard). That way you have a reference for if your code is working or not for your own devboard. Otherwise you are debugging from two ends simultaneously. Not to mention you can look at the schematic of the development module which is much smaller and simpler to understand. It might be worth examining the schematic even if it's not the same FPGA. I recommend Micronova, Trenz (the modules actually made by Trenz, since they sell others as well), and Alchitry.

DKNguyen
  • 54,733
  • 4
  • 67
  • 153
  • Thank you so much for the thorough description. @DKNguyen I was just reading about that and was under assumption that Spartan-3 has ISF ( In System Flash memory) that could be used for such purposes , or maybe I am wrong – Aug Jul 31 '21 at 17:59
  • 1
    @Aug Some Spartan 3 do come with onboard non-volatile configuration memory but most do not. So unless you specifically went out of your way to get one, don't count on it. Onboard flash is definitely not the kind of thing that an entire line of FPGAs will have across the board; Only special variants. I don't think they are even available in low quantities. I think you have to order thousands at a time so the factory runs up production specifically for you. – DKNguyen Jul 31 '21 at 18:00
  • Great details , do you think you can point me to the direction of a schematic ? – Aug Jul 31 '21 at 18:08
  • Micronova, Trenz,and Alchitry. Looks like Micronova has obsoleted their Mercury module by removing the link from their website. So it only leads to the Mercury II now. You might be more interested in the Mercury I which uses a Spartan intead of an Artix but you can still Google to go directly to the webpage for it. https://www.micro-nova.com/products/me1b – DKNguyen Jul 31 '21 at 18:23
  • "Unlike microcontrollers, the vast majority of FPGAs do not have onboard non-volatile memory." Well, anything except the cheapest development boards usually have non-volatile memory on a separate chip hardwired to the FPGA. So that's easy to fix. There's often a switch to change between volatile and non-volatile mode on those boards and if OP really wants to create their own development board that's the route I'd suggest. – Mast Aug 01 '21 at 09:58
  • @Mast We're talking about the FPGA here, not the board it's on. When you're trying to implement an FPGA on your own board, it doesn't matter that other boards always include external non-volatile memory since your own FPGA board can't make use of that fact. – DKNguyen Aug 01 '21 at 14:28
  • They can make use of that, if they add it to their board. – Mast Aug 01 '21 at 14:34
  • @Mast That's really twisting things, unless you what you meant to do was end off with your intent rather than lead with it. – DKNguyen Aug 01 '21 at 14:34
  • I definitely could've phrased that better, yes. – Mast Aug 01 '21 at 14:48
4

For the XC3S50A-4VQG100C device you use the JTAG interface, not SPI. It has dedicated pins.

JTAG is a somewhat similar interface to SPI but standardized for FPGAs, debug interfaces on many microprocessors and for testing purposes.

There are XC3S50AN devices that do have a non-volatile memory in the same package so you don't need to include a separate flash memory on the board. Xilinx denotes these devices with the 'N' suffix in the part number.

The JTAG signals are on these pins for that device and package:

XC3S50A-4VQG100C JTAG signals

XC3S50A-4VQG100C Datasheet

Kevin White
  • 32,097
  • 1
  • 47
  • 74