Author Topic: FPGA configuration  (Read 7274 times)

0 Members and 1 Guest are viewing this topic.

Offline fagianoTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: it
FPGA configuration
« on: September 03, 2013, 06:02:54 pm »
Hi,
I'm designing a board with a Xilinx FPGA and I'm scratching my head on how to setup the bitstream configuration.
I'd like to have 3 programming modes:
 *an SPI flash in master mode(the FPGA sucks the bitstream from it at startup)
 *being able to program the bitstream from the MCU that will also be on the board
 *JTAG for developing
Now I think I understand how to do both the SPI and MCU options, but for what I can see I'll have to share the SPI pins on the FPGA.
My problem is that I'm not sure how to isolate the MCU or the SPI flash when one or the other is not used.
I'm quite a newbie in electronics, so far the only thing I can think of is to pass both SPI interfaces through two separate 3-state buffers(74LVC125A) and put in high impedance mode(from the MCU or jumper) when I want to isolate the interface connected to it.

Am I missing something? Is there a better way?
Also I assume the JTAG will be able to program the SPI from Impact, right?

thank you for your time

ciao
Alberto

PS: I also plan to have a jumper to set the FPGA mode.

 

Offline jeroen74

  • Frequent Contributor
  • **
  • Posts: 396
  • Country: nl
Re: FPGA configuration
« Reply #1 on: September 03, 2013, 07:02:54 pm »
So far I know... the FPGA tristates the SPI lines to the SPI Flash after it has read out the contents of it; the DONE pin indicates this. The MCU can then take control. If you keep PROG_B low you can stop the FPGA from reading the Flash.

You can program the SPI flash from Impact; it basically downloads a small FPGA configuration first that funnels the data from JTAG to the SPI.

All these little details are the configuration guide of the FPGA family you are using :)
 

Offline fagianoTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: it
Re: FPGA configuration
« Reply #2 on: September 03, 2013, 07:58:21 pm »
Thank you, I missed the fact that the pins go into high impedance after the programming is done. I went though the configuration reference but
but I'm just starting with electronics, so for me this kind of documents are a lot to chew :) .

Anyway, do you mean that I don't have to isolate the MCU data/clk pins from the flash ones? The MCU defaults to "input floating" on reset.

Alberto
 

Offline jeroen74

  • Frequent Contributor
  • **
  • Posts: 396
  • Country: nl
Re: FPGA configuration
« Reply #3 on: September 04, 2013, 06:42:54 pm »
Yes, with all those different possible configuration methods it's not for the faint hearted :)

Yes, I see no reason to add extra hardware as long you can tristate the MCU pins.
 

Offline marshallh

  • Supporter
  • ****
  • Posts: 1462
  • Country: us
    • retroactive
Re: FPGA configuration
« Reply #4 on: September 04, 2013, 06:52:26 pm »
As always the solution is to RTFM.... Find what volume of the documentation deals with it, and read ALL of it
Only way to not bake a coaster pcb...
Verilog tips
BGA soldering intro

11:37 <@ktemkin> c4757p: marshall has transcended communications media
11:37 <@ktemkin> He speaks protocols directly.
 

Offline fagianoTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: it
Re: FPGA configuration
« Reply #5 on: September 05, 2013, 07:32:29 am »
Thank you again jeroen74, I'll give it a try.

marshallh i did RTFM, as I stated, but as I'm a newbie I was looking for validation on what I've got from it. So thank you too for the wise advice .

ciao
Alberto
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: FPGA configuration
« Reply #6 on: September 05, 2013, 09:07:48 am »
As well as TFM, look at schematics of development boards for details of config stuff (but bear in mind some may provide for more options than you need)
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline Hardcorefs

  • Regular Contributor
  • *
  • Posts: 81
Re: FPGA configuration
« Reply #7 on: September 05, 2013, 09:52:48 am »
Hi,
I'm designing a board with a Xilinx FPGA and I'm scratching my head on how to setup the bitstream configuration.
I'd like to have 3 programming modes:
 *an SPI flash in master mode(the FPGA sucks the bitstream from it at startup)
 *being able to program the bitstream from the MCU that will also be on the board
 *JTAG for developing
Now I think I understand how to do both the SPI and MCU options, but for what I can see I'll have to share the SPI pins on the FPGA.
My problem is that I'm not sure how to isolate the MCU or the SPI flash when one or the other is not used.
I'm quite a newbie in electronics, so far the only thing I can think of is to pass both SPI interfaces through two separate 3-state buffers(74LVC125A) and put in high impedance mode(from the MCU or jumper) when I want to isolate the interface connected to it.

Am I missing something? Is there a better way?
Also I assume the JTAG will be able to program the SPI from Impact, right?

thank you for your time

ciao
Alberto

PS: I also plan to have a jumper to set the FPGA mode.

The JTAG overrides all others.
You  use the mode select pins to configure other modes.

go check out the xilinx 'targeted'  white papers there is a range of solutions carefully laid out , also go pull some schematics to see how other implement the re-use of pins
 

Offline Crazy Ape

  • Regular Contributor
  • *
  • Posts: 181
Re: FPGA configuration
« Reply #8 on: September 05, 2013, 06:31:37 pm »
How big is the MCU involved, or perhaps, how much free space is on it would be the better question?

A design I was toying with, and will get back to (it works well) uses the MCU to read an xsvf file from SD card and configure the FPGA directly through the JTAG pins.
I used ChaN's FAT to handle the SDcard and xsvf player to program the FPGA via JTAG.
In this case I used an NXP LPC1768 as the MCU and I was programming a Xilinx XC3S200A FPGA.

If your project already has SDCARD support then you're already half way there.

'Sprites mods' takes this idea to the extreme (no SDcard or FAT support though) using an ATTiny85 microcontroller here:
http://spritesmods.com/?art=stdalonejtag&page=1
« Last Edit: September 06, 2013, 02:13:26 am by Crazy Ape »
 

Offline fagianoTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: it
Re: FPGA configuration
« Reply #9 on: September 06, 2013, 07:19:56 pm »
The MCU is big, is an STM32F407Z with 1MB of flash. I was thinking of adding a 1Gbit of nand flash as my sd card pins are already used but I'll leave that for a future revision as doing the PCB layout with two 144QFP components is already redefining my meaning of tedious :).

mikeselectricstuff: I looked at the schematics of a devboard with similar MCU+FPGA and that is what got me insecure/confused, they are using some electronic switch and tristate between the flash/MCU/FPGA (PS: I'm a big fan of you channel).

For now I'll try to just share the pins as jeroen74 suggests, if it doesn't work, I'll just have to try again.

Thank you all for the advice.

ciao
Alberto
 

Offline Crazy Ape

  • Regular Contributor
  • *
  • Posts: 181
Re: FPGA configuration
« Reply #10 on: September 06, 2013, 07:31:30 pm »
The MCU is big, is an STM32F407Z with 1MB of flash. I was thinking of adding a 1Gbit of nand flash as my sd card pins are already used but I'll leave that for a future revision as doing the PCB layout with two 144QFP components is already redefining my meaning of tedious :).

I'm waiting on a STM32F407IGT6 to arrive in the mail, very similar device.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: FPGA configuration
« Reply #11 on: September 07, 2013, 02:20:56 pm »
doing the PCB layout with two 144QFP components is already redefining my meaning tedious

You call that tedious ? I call that half an hour of fun. I did one yesterday ( and the day before) with a 208 pin qfp, a 144 qfp and three tsop48 memories... And a bunch of level translators 74vhcx4245) in tssop . Had to fit in 6x10 cm... Absolute fun. I did it on 2 1/2  routing layers  short hops are interspersed on the powerplane, he ne the 1/2 layer
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13748
  • Country: gb
    • Mike's Electric Stuff
Re: FPGA configuration
« Reply #12 on: September 08, 2013, 10:32:01 pm »
Quote
doing the PCB layout with two 144QFP components is already redefining my meaning of tedious :)
Not usually a big deal with FPGAs as there is so much scope to juggle pins around to make the PCB easier, unless you have multiple bank voltages, when things can get more constrained.
Most of my FPGA designs have been on 2 layer PCBs, including a QFP144 driving two LCDs & a NAND flash
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline fagianoTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: it
Re: FPGA configuration
« Reply #13 on: September 09, 2013, 05:09:42 pm »
The last 2 posts make me wonder about my layout methodology  :-// , I have to route the memory controller pins from the MCU to the FPGA. That is about 40 pins scattered on 4 sides of the microcontroller and I'm trying to put the address bus all on the same bank of the FPGA(is this necessary? I guess so, not sure), this is cross cutting both my top and bottom layers in 2 and I'm having big troubles routing all the rest (USB phy, LCD, and power, io). Should I redesign my board so is easier to layout(connect to different banks) or should I just keep it as it is and go nuts with vias? The major issue for me is finding some documentation on PCB layout than is neither trivial arduino-class or advanced stuff like DDR3, just figuring out when a via is acceptable. All this papers about vias inductance made quite paranoid on hopping through layers. I'm pretty much guessing on my own and I feel bad on posting 1000 trivial questions on forums. In the past I did some incredibly educational PCB, one had so much crosstalk on a sound chip that it could almost be considered a wireless transceiver :-DD(that is how I learned about return currents, and ground planes) Is there some source to learn this kind of stuff or should I just stick on trial and error(and staring at devboards)?

Alberto
 

Offline larry42

  • Regular Contributor
  • *
  • Posts: 174
  • Country: 00
Re: FPGA configuration
« Reply #14 on: September 09, 2013, 06:02:00 pm »
Is there some source to learn this kind of stuff or should I just stick on trial and error(and staring at devboards)?


Four years of university and a decade in industry helps... I think you might be starting a bit too big. How many pins are your devices and how many layers is your PCB?
If you have an animated GIF in your avatar or signature then I reserve the right to think you're a dolt.
 

Offline fagianoTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: it
Re: FPGA configuration
« Reply #15 on: September 09, 2013, 06:13:54 pm »
two 144TQFP, one 48TSOP, one 32QFN, two 10MSOP. Two or Four layers I'm experimenting with both but four layers looks easier. I did few boards before with smaller MCUs and CPLDs, I want to step up one level. I bought my first breadboard about 1 year ago.

Alberto
« Last Edit: September 09, 2013, 06:15:38 pm by fagiano »
 

Offline jeroen74

  • Frequent Contributor
  • **
  • Posts: 396
  • Country: nl
Re: FPGA configuration
« Reply #16 on: September 09, 2013, 07:02:44 pm »
Maybe it helps to post a screenshot of your PCB.
 

Offline fagianoTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: it
Re: FPGA configuration
« Reply #17 on: September 12, 2013, 06:01:33 pm »
I did a lot of practice in the last few days by trying to layout one chip to the MCU at the time rather than trying to do all the board at once. I'm starting to get a grip on the whole PCB layout, my biggest problem was IC placement. I think I just have to take a deep breath and power though it with trial and error.

thanks for the help I'm sure I'll be back before I'm done with this board :)

ciao
Alberto
 

Offline Crazy Ape

  • Regular Contributor
  • *
  • Posts: 181
Re: FPGA configuration
« Reply #18 on: September 13, 2013, 02:10:38 am »
I see lots of boards that have high pin-count devices placed at a 45 degree offset, this helps with routing to other high pin-count devices as you have two sides of the device exposed in any direction for routing. Something to consider if you haven't already.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf