Programming external FPGA's using DE1's on-board programmer - Page 1
Forum section: electronics / general

author: gregallenwarner
author_rank: Regular Contributor
timestamp: May 12, 2014, 03:00:21 pm
content: This may be a beginner question, but I'm still a beginner with FPGA's so forgive me.I've been experimenting with an Altera DE1, and I'm wondering if it's possible to take my designs and program them into an external FPGA and storage memory using the built-in USB Blaster on the DE1? Basically, what I'm wanting to do is go ahead and design up a finished product for my FPGA designs and buy and embed a dedicated FPGA for the final board, then use my DE1 as a programmer to program that finished board, so I don't have to purchase a separate JTAG programmer. Is that possible?I guess the closest analogy to what I'm trying to achieve is the "Arduino as ISP" function for flashing external ATMega's that you may have on an external board. You can use your Arduino dev board itself as a programmer to flash the external chip and get it bootloaded. Is it possible to do the same sort of thing with FPGA's and the DE1? (Obviously, I know that I'll have to embed some configuration memory along with my FPGA in my embedded design. I just wanna avoid buying another costly programmer if I can use the DE1 in this fashion.)Thanks.

author: miguelvp
author_rank: Super Contributor
timestamp: May 13, 2014, 01:33:19 am
content: You are going to also need an EPCQ (Quad Serial Configuration) device like the EPCQ256. There are alternatives not from Altera as well for the configuration device.What FPGA are you targeting? that way we can check the datasheet for what is needed.As far as JTAG you can configure it also with ISP as I recall, let me dig some more info, but nevertheless if you are targeting an Altera FPGA you need something to flash it at boot time.But knowing the device in particular will help (full part number preferably)Edit: EPCQ dochttp://www.altera.com/literature/hb/cfg/cfg_cf52012.pdf

author: miguelvp
author_rank: Super Contributor
timestamp: May 13, 2014, 02:06:07 am
content: Other way to do it is like fpga4fun does it via a serial interface:http://www.fpga4fun.com/FPGAinfo7.htmlThey have a shop where they sell fpgas and the serial adaptor, but I have never shopped from them so I have no idea how it all works. But here are the links that I think are relevant:http://www.fpga4fun.com/FPGAinfo7.html(look at "synchronous serial" interface)http://www.knjn.com/TXDI.html(you'll need this to program it from a PC)http://www.knjn.com/docs/KNJN%20RS232%20FPGA%20boards.pdf(look at page 17 for the rs232 configuration via pc or even an mcu. Or page 3 for their own rs232 direct configuration to the boards that have "Boot-PROM" as they call them).http://www.knjn.com/ShopBoards_RS232_Parallel.html(for their store for those boards)Another alternative (haven't tried it neither) is:http://www.spansion.com/Support/Application%20Notes/Configuring_Altera_FPGAs_via_SPI_Flash_AN.pdfI only programmed my boards with the built in EPCQ so I haven't tried any of these methods.

author: miguelvp
author_rank: Super Contributor
timestamp: May 13, 2014, 02:19:16 am
content: Also you can implement JTAG on your DE1http://www.fpga4fun.com/JTAG.htmlOn the last page you'll find:Quotebut unfortunately is for a Xilinx FPGA, but no reason you couldn't use it for an Altera one.

author: gregallenwarner
author_rank: Regular Contributor
timestamp: May 13, 2014, 03:18:54 pm
content: Thanks for the tips.The DE1 uses a Cyclone II, so I figured I'd just stick with that for the time being.I'll spend some time researching the links you gave me. Thanks again.

author: marshallh
author_rank: Unknown
timestamp: May 14, 2014, 12:36:42 am
content: No, you can't use the DE1 easily, without modifying the pcb. Instead buy a clone USB Blaster off ebay for $30.Cyclone II series use ST nor spi flash. Depending on the bitstream size you may need a EPCS4 or EPCS16.The ST equivelants are M25P40, M25P80, M25p16. Do not use M25VP**. Anyway these parts are die identical to the rebranded parts and much cheaper. Do not use EPCQ part for cyclone II.

author: gregallenwarner
author_rank: Regular Contributor
timestamp: May 14, 2014, 02:12:30 pm
content: Thanks, marshallh, for the tips.I was a little hesitant of buying one of the cheap USB Blaster clones off Ebay. How often do people get duds? Is it generally a safe bet to go this route?

author: jahonen
author_rank: Super Contributor
timestamp: May 14, 2014, 08:07:36 pm
content: Another (a little bit more expensive, but still cheaper) option is Terasic USB blaster, which is, AFAIK quite similar than the Altera one.http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=&No=46Regards,Janne

author: gregallenwarner
author_rank: Regular Contributor
timestamp: May 14, 2014, 11:59:02 pm
content: I've seen the Terasic one, and, though I'd be willing to pay the cost of that one in a pinch, I was just hoping for a reliable, dirt cheap option.But, for $300 a pop, it seems Altera thinks mighty highly of their USB Blasters, especially considering the product can be cloned and sold on Ebay for <$20. I wonder why such a steep markup? Shouldn't they want their technology to be more affordable, in order to get more people to get onboard with their products?

author: miguelvp
author_rank: Super Contributor
timestamp: May 15, 2014, 12:27:07 am
content: I trust these guys:http://www.ebay.com/itm/USB-Blaster-V2-Download-Cable-ALTERA-FPGA-CPLD-EPCS16-EPC1-4-Programmer-Debugger-/251150460146Their non ebay site:http://www.wvshare.com/product/USB-Blaster-V2.htmBut ordering directly via that site is a bit complicated (as in not really automated)Only way cheaper is to do the same thing as the fpga4fun knjn.com did by rolling their own serial configuration, although their Cyclone II board (pluto-3) is a bit pricey for $79 but comes with the 4Mbit flash.But then you will have to design your own board.Also consider these:http://www.wvshare.com/product/CoreEP2C5.htmhttp://www.wvshare.com/product/CoreEP2C8.htmCombined with their blaster V2 compatible programmer.If only to know what is the minimum you need for a Cyclone II board.Edit: because those cyclones II are not the biggest compared to your 2C20 (even the knjn is only a 2C5)

author: gregallenwarner
author_rank: Regular Contributor
timestamp: May 15, 2014, 12:47:30 am
content: Thanks, miguelvp, since you trust them, I went on ahead and ordered their USB Blaster from them. I'll take some time now and study up on how to properly design a board with an FPGA and external configuration memory before I start buying chips.

author: miguelvp
author_rank: Super Contributor
timestamp: May 15, 2014, 01:20:40 am
content: I ordered directly from their store on May 1st and got my stuff on May 10th, and that included Chinese Labor day which is 3 days long.https://www.eevblog.com/forum/microcontrollers/xc3s500e-dev-board/msg441844/#msg441844Sticking with Cyclone II might be too pricey since Cyclone V seems to be the most affordable at the moment.Just stumbled into this kit:http://parts.arrow.com/item/detail/arrow-development-tools/bemicrocvhttp://download.siliconexpert.com/pdfs/2014/2/11/1/54/10/366/arrowd_/manual/hardware_reference_guide_for_bemicro_cv_1.1.pdfThe good thing is that it has a separate JTAG configuration header on top of the embedded one so you can test the blaster V2 with it. It's also as spartan as it can get, so you might get some good design ideas from it. And it has a similar LE count as yours (well 5K more than yours)If I didn't have this already I would get it in a second.https://www.eevblog.com/forum/microcontrollers/terasic-cyclone-v-gx-starter-kit-(c5g)-review

author: Codemonkey
author_rank: Regular Contributor
timestamp: May 15, 2014, 06:43:42 am
content: I bought one of these:http://hobbycomponents.com/index.php/dvbd/dvbd-altera/altera-fpga-cpld-usb-programmer-usb-blaster-compatible.htmlI also know a couple of other people that did, none had any problems.

author: Scrts
author_rank: Frequent Contributor
timestamp: May 15, 2014, 01:40:42 pm
content: Quote from: Codemonkey on May 15, 2014, 06:43:42 amAgreed. This one works fine and I didn't see any differences from the original one. Even the speed is kind of the same.

author: gregallenwarner
author_rank: Regular Contributor
timestamp: May 15, 2014, 02:11:55 pm
content: Thanks. So, is the Cyclone V going to be much different from a design standpoint than the Cyclone II? Or I guess what I'm asking, if I prototype a design on my DE1 (cyclone II), will my design translate to a Cyclone V easily, or at least with minimal tweaking?

author: miguelvp
author_rank: Super Contributor
timestamp: May 15, 2014, 02:30:30 pm
content: Quote from: gregallenwarner on May 15, 2014, 02:11:55 pmQuartus II has a device migration, I haven't had problems from Cyclone IV to V but have no direct experience with Cyclone IImy Cyclone IV is a DE0-Nano with around 22K LE, the other is a GX Starter kit with 77K LE.So other than redoing the pins seems fine, not sure if the Cyclone II offers anything that the Cyclone V doesn't as far as port configuration compatibility, PLLs etc.

author: olsenn
author_rank: Frequent Contributor
timestamp: May 15, 2014, 02:56:22 pm
content: I would just get an Alterra USB Blaster programmer (clones are cheap). You can even get one that can switch between that and a Xilinx programmer