• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Calling All FPGA Experts

Status
Not open for further replies.

DerStrom8

Super Moderator
Most Helpful Member
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
Most Helpful 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
Most Helpful Member
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?
I considered this for quite some time, but tentatively decided to roll my own, for the experience if nothing else. I already have most of the tools I need to program the Xilinx Spartan FPGAs, so unless there's an ultra-simple Spartan-based FPGA development board with all the IO brought out and an existing programming interface for less than $50, then it's probably not worth it for me. I am open to suggestions though. This project is still in its early stages.

Don't forget the programming circuitry and as well as the power supervisory circuit to control the boot-up sequence.
This is precisely the circuitry I am looking for, but my searches for descriptions or examples of what circuitry is required has proven fruitless so far (though I have just begun).

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.
Working on that as we speak.
 

dknguyen

Well-Known Member
Most Helpful Member
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.


Is this the app note you are referring to? https://www.xilinx.com/support/documentation/application_notes/xapp951.pdf
Yes, that's the one. It also contains the programming circuitry you want.

For sample power supervisory circuits, look at the schematics for the Trenz modules I linked. They'll at least help you get a feel for things like I/O bank, programming wire, clock wiring, and the SPI wiring. When looking at these two schematics, make sure you check out the block diagram of what comes on the board so you can disregard the extraneous non-essential accessories that are included.
http://www.trenz-electronic.de/file...725/REV03/Documents/SCH-TE0725-03-100-2I9.PDF
http://www.trenz-electronic.de/fileadmin/docs/Trenz_Electronic/TE0714/REV02/Documents/SCH-TE0714-02-50-2I.PDF

Make sure to check many Xilinx user guides. One of them has the power-up sequence and requirements. I don't think there is a dedicated guide for it though since it's not too big a topic. I know TI has a general solutions guide:
http://www.ti.com/lit/an/slyt598/slyt598.pdf

But Micronova also provides a schematic for their Mercury which is more directly applicable to you:
https://static1.squarespace.com/sta...0545df6ef/1414876472673/mercury_schematic.pdf

EDIT: Mistakenly linked to the Mercury baseboard. Corrected link to the actual FPGA module.
 
Last edited:

DerStrom8

Super Moderator
Most Helpful Member
I'm liking the MicroNova Mercury board. It's a bit on the pricey side but it is reusable (just pop it out of my main motherboard and use it elsewhere), plus it has everything on-board. I like that. Their schematic is very nicely laid out too, and is easy to follow. You've got me reconsidering my DIY decision now....
 

dknguyen

Well-Known Member
Most Helpful Member
I'm liking the MicroNova Mercury board. It's a bit on the pricey side but it is reusable (just pop it out of my main motherboard and use it elsewhere), plus it has everything on-board. I like that. Their schematic is very nicely laid out too, and is easy to follow. You've got me reconsidering my DIY decision now....
Yeah, it is a bit pricey but it's real easy to use. It's basically responsible for getting me my current R&D job because it took care of a bunch of nitty-gritty FPGA stuff and provided good guides and initial setup which I didn't have time to learn because I had other things to worry about in the first project to prove myself.

I will say though that the Trenz TE0725-03-100 (which you can buy from Digikey) costs twice as much but is MANY times more than twice as powerful or twice as large as the Micronova Mercury and would be the best bang for your buck. It's also reusable and has an ADC (on-chip rather than onboard), but uses Vivado rather than webISE and no onboard programmer, though it as accomodations for the XMOD programmer. But if you already have the tools, might as well just wire up the programming connector on your board.

If you're doing any math on the FPGA, the Micronova Mercury fills up real quick. That first project of mine has a configuration file that is mostly filled up (about 50%, maybe even 75%) with somewhere between 16 to 32 equations to scale and normalize ADC readings when it's only 10% of the function of the code. I was using the 200K version of the Mercury.
 
Last edited:

DerStrom8

Super Moderator
Most Helpful Member
Yeah, it is a bit pricey but it's real easy to use. It's basically responsible for getting me my current R&D job because it took care of a bunch of nitty-gritty FPGA stuff and provided good guides and initial setup which I didn't have time to learn because I had other things to worry about in the first project to prove myself.

I will say though that the Trenz TE0725-03-100 (which you can buy from Digikey) costs twice as much but is MANY times more than twice as powerful or twice as large as the Micronova Mercury and would be the best bang for your buck. It's also reusable and has an ADC (on-chip rather than onboard), but uses Vivado rather than webISE and no onboard programmer, though it as accomodations for the specific third-party programmer to directly into the module.

If you're doing any math on the FPGA, the Micronova Mercury fills up real quick. That first project of mostly became filled up just having 16 or 32 equations to scale and normalize ADC readings when it's quite a functionally minor part of the whole configuration code.
I can't think of any serious math that my FPGA would need to do. It's mostly just me telling it to "read from these inputs" and "write to those outputs". Cost is definitely the limiting factor here, and not power. My project is not remotely worth something that costs $170 USD, so the Trenz is pretty much off the table for now. Not to mention I've already got half my project done in ISE and that's what I'm used to, and the built-in programmer is a huge plus.
 

dknguyen

Well-Known Member
Most Helpful Member
I can't think of any serious math that my FPGA would need to do. It's mostly just me telling it to "read from these inputs" and "write to those outputs". Cost is definitely the limiting factor here, and not power. My project is not remotely worth something that costs $170 USD, so the Trenz is pretty much off the table for now. Not to mention I've already got half my project done in ISE and that's what I'm used to, and the built-in programmer is a huge plus.
Yeah, it's all up to your needs and budget I guess. I assume you already know you actually need an FPGA and can't just use an MCU. Or an XMOS.
 

DerStrom8

Super Moderator
Most Helpful Member
Yeah, it's all up to your needs and budget I guess. I assume you already know you actually need an FPGA and can't just use an MCU. Or an XMOS.
An XMOS device would probably meet my needs to an extent but I have no experience whatsoever with them. At least I have some experience with FPGAs (programming and all), just not designing a circuit around them.

The more I think about it the more the $89 cost is bothering me. Yes, it's reusable, but my project isn't really worth $89 and this is the only project I'll be using it for in the foreseeable future. I'm back on the fence regarding whether or not I want to roll my own. With the Mercury schematic I feel that the DIY solution is slightly more within reach.

Argh, I'm going to have to sleep on this :mad::p
 

dknguyen

Well-Known Member
Most Helpful Member
An XMOS device would probably meet my needs to an extent but I have no experience whatsoever with them. At least I have some experience with FPGAs (programming and all), just not designing a circuit around them.

The more I think about it the more the $89 cost is bothering me. Yes, it's reusable, but my project isn't really worth $89 and this is the only project I'll be using it for in the foreseeable future. I'm back on the fence regarding whether or not I want to roll my own. With the Mercury schematic I feel that the DIY solution is slightly more within reach.

Argh, I'm going to have to sleep on this :mad::p
Are you just going to copy the schematic verbatim into capture software and lay it out? haha
 

DerStrom8

Super Moderator
Most Helpful Member
Are you just going to copy the schematic verbatim into capture software and lay it out? haha
Something like that, though there are parts I probably wouldn't need like the LEDs. On the other hand that wouldn't save me all that much in cost.

I'm looking at the prices of these parts individually 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....
 

dknguyen

Well-Known Member
Most Helpful 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
Most Helpful Member
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
Most Helpful Member
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
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
 

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
Most Helpful Member
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?

ADC.png
 

dknguyen

Well-Known Member
Most Helpful 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.

Latest threads

EE World Online Articles

Loading
Top