# Calling All FPGA Experts

Status
Not open for further replies.

#### DerStrom8

##### Super Moderator
Greetings all,

Today I begin a new venture: Designing a PCB around a Xilinx FPGA.

Okay, I actually started the venture back a month or two ago when I got a Basys 2 FPGA development board and re-taught myself VHDL, and began writing my program for this new design. I have gotten to the point where having an actual PCB without all the bells and whistles and has just the parts I need using the FPGA of my choice would be a whole lot more useful. There's only one problem: I don't even know where to begin.

I have tentatively selected the Xilinx XC3S50A FPGA (A member of the Spartan-3A family) for this project simply because it is cheap and easy to obtain, as well as (presumably) being comparable to what I have worked with on the Basys 2. Having never designed a board around an FPGA before I am finding it rather difficult to identify what specifications to look for. Here are the requirements I have so far for my board. Bold indicates that further information is required to make a selection:

• Will be using EEPROM (or some other sort of ROM?) to store the bit file for my program to run it on the FPGA
• Would prefer a USB connection for programming the EEPROM (will require some sort of interface, perhaps a microcontroller? Something simpler? I may need to use a JTAG programmer instead, but a simple on-board USB connection is my top choice if possible.)
• Would like some analog inputs (another point for using an actual microcontroller instead of just a simple USB interface - kill two birds with one stone)
• Must have at least 20 digital I/O ports off the FPGA
• Must have 1.2V, 3.3V, 5V, 12V rails (are there any others required for the FPGA?)
• Would like a 50MHz oscillator for the FPGA (maybe 100MHz, but that's probably overkill)
• I/O protection on all used FPGA I/O connections
There may be others but I can't think of them at the moment. I will add them as I remember them. My beginning questions are as follows:
1. What sort of device is recommended to store the program to run the FPGA? I mentioned EEPROM but have no experience in this.
2. What sort of circuitry would be required to interface with the ROM via USB (or JTAG programmer if absolutely necessary) to write my program?
3. On Page 13 of the FPGA Datasheet I see supply voltages of Vccint=1.2V (is this supplied internally, or must I supply it? I'm assuming the latter) and Vccaux=3.3V (could use 2.5 but I'll be using 3.3V elsewhere anyway). Are there any other rails I need specifically for the FPGA?
4. What other circuitry would I need to get this FPGA running (besides bypass caps, of course)? I'm still reading through the datasheet but am struggling to pick out the useful information regarding the circuit design.
I will continue to read the datasheet but thought I would reach out and see if anyone else has experience designing circuits around FPGAs and if there are any rules-of-thumb or insights to the process that they would be willing to share.

I have also been referring to the Basys 2 schematic, but once again I am finding it rather difficult to pick out what is applicable to my requirements and what is not. My biggest problem right now is that the task feels quite overwhelming and daunting, so I need to know where to focus my attention to begin with.

Ultimately what I hope to come out with at the end of this thread is a schematic that I could theoretically turn into a PCB design, plug in, and program with the Digilent ADEPT software to get the FPGA running, minus the functionality of the rest of the circuit (just interested in having IO I can program at this point).

Many thanks,
Matt

Last edited:

#### dknguyen

##### Well-Known Member
Don't use an EEPROM to store the configuration file. It's too small and expensive because it allows random-access which you don't need. I don't think EEPROMs are even supported. The normal way is to use an SPI flash. Quad-SPI Flash is preferred since it allows faster configuration (might be too new to be supported by the Spartan devices). Xilinx has a configuration device application note that will outline supported devices. The FPGA supports it internally based on selecting pins on boot-up. I never bothered searching into it too hard for a Spartan device since they are older and if I would not go to the effort of building wiring up an FPGA myself only to use an older model chip, but this is the document for the newer Artix devices which may help you locate the equivalent for the Spartan devices, or at least give you a feel.:
https://www.xilinx.com/support/documentation/user_guides/ug470_7Series_Config.pdf

Don't forget the programming circuitry and as well as the power supervisory circuit to control the boot-up sequence.

You'll have to pore through the datasheet of the FPGA to figure out what voltages you need. They're usually different depending on which I/O banks you want, whether they have "high-range" I/O which supports "high" voltages like 3.3V, as well as core voltages and configuration voltages. It's a whole whack of stuff a few set rules.

If you build your own board you will need to get an FPGA programmer. I recommend the Digilent HS-3 for the price (and purported greater reliability) over the actual Xilixn Platform cable. Costs about $60-$80.

Are you sure you don't want to just use a FPGA module like one made by Trenz or Micronova Mercury? Using a module would make it as easy as integrating a microcontroller. Also, most FPGAs screw poor users over with their BGA. If you do wire up your own FPGA from scratch, will you ever have the resources to move beyond that and use the other FPGAs which are all BGA mounted? Might not be worth it if you can't ever re-use that experience due to the BGA-barrier.

Your purpose sounds very simple so you might be better off with the Micronova Mercury module which has an ADC onboard the module and the Micronova provides the IP block to use it. It uses a Spartan so you use ISE with it if that's what you learned on. It's really easy. I used it for my first project at work. It also has an onboard programmer that you just plug a micro-USB into and use their uploader software. The whole board costs as much as a Digilent HS-3 but comes with a programmer.

Trenz has the fancier and more capable models based on the Artix-7 that have to use Vivado. Boards like the TE-0725 and TE0714 are cheaper than buying the FPGA separately. These require an external programmer in one form or another (there's a few out there from different third parties). Trenz has schematics that you can learn from. The two boards I listed are the simpler ones without so much extras so the schematics are easier to follow and also cheaper and more bare bones if you want to buy them.

Last edited:

#### DerStrom8

##### Super Moderator
Don't use a ROM to store the configuration file. It's too small and expensive because it allows random-access which you don't need. I don't think EEPROMs are even supported.
Indeed, looking back at the reference design it uses an XCF02S PROM (not EEPROM) for program storage. This must be what I was thinking of.

The normal way is to use an SPI flash. Quad-SPI Flash is preferred since it allows faster configuration. Xilinx has a configuration device application note that will outline supported devices. The FPGA supports it internally based on selecting pins on boot-up. Look through that app note.
Is this the app note you are referring to? https://www.xilinx.com/support/documentation/application_notes/xapp951.pdf

Are you sure you don't want to just use a FPGA module like one made by Trenz or Micronova Mercury?

#### dknguyen

##### Well-Known Member
Something like that, though there are parts I probably wouldn't need like the LEDs. That wouldn't save me much though.

I'm looking at the prices of these parts individually though, and they sure add up. $89 is actually not a bad price for this board, I don't know if I could roll my own for less.... Yeah, that seems to be the case with FPGA boards. Hell, those Trenz modules I pointed you cost just as much as the FPGA alone, sometimes even less. I have no idea how FPGA pricing occurs behind the scenes but it seems that if you are a manufacturer you can get them much cheaper. I don't know what the quantity pricing actually is because Digikey doesn't even bother to list it for such expensive parts. #### DerStrom8 ##### Super Moderator Yeah, that seems to be the case with FPGA boards. Hell, those Trenz boards I pointed you to cost LESS than just the FPGA alone. I have no idea how FPGA pricing occurs behind the scenes but it seems that if you are a manufacturer you can get them much cheaper. Even the quantity pricing from Digikey doesn't compare. Digikey tends to be one of the more expensive suppliers. Most manufacturers will look overseas for discounted parts. This isn't to say counterfeit necessarily, just cheaper to source. Not to mention manufacturers tend to get better rates in general. Lots of negotiation happens behind-the-scenes. #### DerStrom8 ##### Super Moderator Looking at the schematic for the MicroNova Mercury I see a Cypress CY7C1049DV33 (U05) which is a 4Mb SRAM. Is this required in order to run the FPGA? I ask because I see the I/O going to it are also brought out to the I/O headers, so it makes me wonder if it's only there in case you need it for a project. I have no idea if external SRAM is required for FPGA operation. Once again I've never looked at the hardware associated with FPGAs, just the software. Cheers, Matt #### dknguyen ##### Well-Known Member Most Helpful Member no Looking at the schematic for the MicroNova Mercury I see a Cypress CY7C1049DV33 (U05) which is a 4Mb SRAM. Is this required in order to run the FPGA? I ask because I see the I/O going to it are also brought out to the I/O headers, so it makes me wonder if it's only there in case you need it for a project. I have no idea if external SRAM is required for FPGA operation. Once again I've never looked at the hardware associated with FPGAs, just the software. Cheers, Matt Not required. https://www.micro-nova.com/mercury/ "optional" feature of the board I never even knew it had SRAM lol Probably there for MCU emulation Last edited: #### DerStrom8 ##### Super Moderator What I'm thinking of doing is designing my board for both, but leaving the on-board FPGA circuitry unpopulated by default. This would allow me to use the module but if I ever want to make it permanent I can populate my own FPGA instead. I can't seem to find a BOM for the Mercury board. I see part numbers for some of the main ICs on the Resources page but no complete BOM. Is it not publicly-available? Do you know? Thanks, Matt #### dknguyen ##### Well-Known Member Most Helpful Member What I'm thinking of doing is designing my board for both, but leaving the on-board FPGA circuitry unpopulated by default. This would allow me to use the module but if I ever want to make it permanent I can populate my own FPGA instead. I can't seem to find a BOM for the Mercury board. I see part numbers for some of the main ICs on the Resources page but no complete BOM. Is it not publicly-available? Do you know? Thanks, Matt I do not know but if the BOM is not there, I would assume it's not available. It's not too important since you have everything you need in the schematic as far as the important unsubstitutable components go. I would personally replace the level shifters with something else since if you read the manual, there are quirks to the one they use. #### DerStrom8 ##### Super Moderator I do not know but if the BOM is not there, I would assume it's not available. It's not too important since you have everything you need in the schematic as far as the important unsubstitutable components go. I would personally replace the level shifters with something else since if you read the manual, there are quirks to the one they use. That's what I figured, and I already have different level shifters picked out: NXP NVT2010PW,118. I wasn't very comfortable using just the switches they chose for theirs. These cost about$0.30 more in one-off quantities but this is specifically what they're designed for.

I'm still trying to figure out the level shifting they use for the ADC SPI connection. They supply the ADC chip with 5V and I expect the SPI signals to be ~4V, and I see a few FETs and resistors but they seem to be missing a set of resistors on the LV side (not to mention I would have expected the gate of the NFET to connect to the LV side as well not the HV side). What am I missing here?

#### dknguyen

##### Well-Known Member
That's what I figured, and I already have different level shifters picked out: NXP NVT2010PW,118. I wasn't very comfortable using just the switches they chose for theirs. These cost about \$0.30 more in one-off quantities but this is specifically what they're designed for.

I'm still trying to figure out the level shifting they use for the ADC SPI connection. They supply the ADC chip with 5V and I expect the SPI signals to be ~4V, and I see a few FETs and resistors but they seem to be missing a set of resistors on the LV side (not to mention I would have expected the gate of the NFET to connect to the LV side as well not the HV side). What am I missing here?

View attachment 110647
Normally, you hold the source constant and apply a changing gate voltage to modulate Vgs to turn the FET on and off. In this case, they are modulating Vgs by holding the gate constant and applying a changing voltage to the source.

Basically, the MOSFET is wired to be an ideal diode that allows current in the line to flow from the ADC to the FPGA. Therefore the FPGA can only ever directly drive the voltage at the ADC pin low. Whenever it tries to drive it high, the ideal diode blocks from getting to the ADC pin which makes the ADC pin high impedance, but then the pull-up resistor takes over and applies the appropriate logic high voltage to the ADC pin.

You can manipulate Vgs by fixing the source voltage and manipulating the gate voltage, which is what is usually done. In this case, they are fixing the gate voltage and manipulating the source voltage. In either case, you can make Vgs = 0V to turn it off, or Vgs = 5V to turn it on. That's how an ideal diode works. If the gate is fixed at 5V, driving the source to a sufficient positive voltage will make Vgs small and turn the MOSFET off and block the source voltage/signal from reaching the drain, while driving the source low will increase Vgs and turn the MOSFET on and allow the source voltage/signal/current to pass to the drain.

The level shifting method you have in mind where the NFET is on the low-side and a pull-up on the high-side has the problem of inverting the signal.

Last edited:
Status
Not open for further replies.