is it worth running a soft arduino on spartan FPGA - Page 1
Forum section: electronics / general

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 05:54:56 pm
content: can I make use of the full power of the FPGA if i use the arduino soft core on this FPGA boardhttp://proto-pic.co.uk/papilio-pro-lx9/is it worth it or should i wait for the Arduino tre.What im planning todo is read an ADC (i would like more than 8 bit resolution) and wright to a DAC and draw on an LCDso is it worth it?

author: Hideki
author_rank: Frequent Contributor
timestamp: April 17, 2014, 06:50:44 pm
content: no

author: codeboy2k
author_rank: Super Contributor
timestamp: April 17, 2014, 07:07:42 pm
content: It's almost never a good idea to run a soft core inside an FPGAunlessyou somehow already have the space available in the fabric and are also physically space limited on the PCB.In a final production unit, it will always be more cost-effective and more power-efficient to use an external hard microprocessor and leave the FPGA resources available for doing what it does best.You also have many more choices for an external microprocessor than you do for an internal soft-core.Finally, when you aren't trying to stuff a soft core into the FPGA, you can downsize it to a smaller, cheaper FPGA or even a CPLD and it can sometimes only cost 1/5th as much as your savings to add back the hard microprocessor chip.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 07:10:23 pm
content: Well the thing is I want the eas of arguing and the power of the FPGA and I have no experience programming FPGAs

author: amyk
author_rank: Super Contributor
timestamp: April 17, 2014, 07:22:48 pm
content: A soft-coreArduino!?The task you describe doesn't even require an FPGA. A regular Arduino would be enough.

author: dannyf
author_rank: Super Contributor
timestamp: April 17, 2014, 07:24:18 pm
content: QuoteWhether it is worth it or not is highly subjective and only you know for sure. No one else can answer that for you.If you tell us what you are looking for in this exercise, we may be able to better advise you.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 07:35:08 pm
content: well i need the ease of arduino programming and the power of an FPGA, so no an arduino micro on its own is not going to be enough for my aplication

author: dannyf
author_rank: Super Contributor
timestamp: April 17, 2014, 07:39:00 pm
content: QuoteSounds like you want to run Arduino on FPGA.Then, other than an Arduino soft-core on FPGA, you have no other choices.Whether it is worth or not doesn't even come into play at all.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: April 17, 2014, 07:43:57 pm
content: Quote from: electronics man on April 17, 2014, 07:35:08 pmTo read from an ADC, write to a DAC, and draw on an LCD? How fast are you updating the ADC/DAC and/or how big is this LCD???Is it "worth it" from an educational perspective - IE: learning how to implement a soft-core processor on an FPGA - absolutelyIs it "worth it" from a cost/power perspective - absolutely not

author: suicidaleggroll
author_rank: Super Contributor
timestamp: April 17, 2014, 07:44:30 pm
content: Quote from: electronics man on April 17, 2014, 07:10:23 pmThen pick up a book on VHDL/Verilog and start reading.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 07:47:06 pm
content: Quote from: suicidaleggroll on April 17, 2014, 07:43:57 pmneeds to do everything in about a second; and im not sure how big the lcd is, i may use the VGA "wing"

author: suicidaleggroll
author_rank: Super Contributor
timestamp: April 17, 2014, 07:52:40 pm
content: Quote from: electronics man on April 17, 2014, 07:47:06 pmA second is slow in processor-land. If you were running the ADC/DAC in the tens/hundreds of kHz or up in to the MHz range, then I could see the benefit of throwing in an FPGA, but any microcontroller can handle 1 ADC read, 1 DAC push, and an LCD update in a second.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 07:58:20 pm
content: Quote from: suicidaleggroll on April 17, 2014, 07:52:40 pmobviously the faster the better but im being realistic because there will be maths to do between the adc read and the screen update

author: suicidaleggroll
author_rank: Super Contributor
timestamp: April 17, 2014, 08:05:21 pm
content: Quote from: electronics man on April 17, 2014, 07:58:20 pmUnless you're trying to solve for pi, that's still very little work for anything but the slowest of the slow microcontrollers.To give you a point of reference, I have a system using a lowly 16 MHz MSP430. It's reading from 4 ADCs (2 10 bit, 2 16 bit), doing a full PID control calculation, and writing to a 16 bit DAC every millisecond, on top of driving a 128x64 graphic LCD at 10 FPS, providing the user with a full menu-driven front end, and doing system checks (temperature, voltage, etc.) in the background, and it still has plenty of cycles left over to sit around and twiddle its thumbs.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 08:10:15 pm
content: i might just go for a fast arduino like the the arduino due

author: dannyf
author_rank: Super Contributor
timestamp: April 17, 2014, 08:15:51 pm
content: QuoteSure.For what you are trying to do, even the slowest of the slow mcus can do it.Unless, of course, you deliberately slow down the mcu.It is far more helpful to you, I think, if you just pick an arduino and play with it before anything. It is a lot easier and faster to take baby-steps first.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 08:18:16 pm
content: Quote from: dannyf on April 17, 2014, 08:15:51 pmeven if a slow one can do it i wont have enough IO on something like the uno

author: dannyf
author_rank: Super Contributor
timestamp: April 17, 2014, 08:22:04 pm
content: QuoteThen run the soft arduino on a fpga.It doesn't sound like you ever wanted to give yourself a choice.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 08:24:36 pm
content: i will do it on a due its cheaper

author: dannyf
author_rank: Super Contributor
timestamp: April 17, 2014, 08:35:32 pm
content: QuoteDoesn't that fail to do what you wanted to do? Use arduino language on fpga?

author: Monkeh
author_rank: Super Contributor
timestamp: April 17, 2014, 08:37:44 pm
content: Quote from: dannyf on April 17, 2014, 08:35:32 pmHe thought he needed an FPGA because he has such a complicated task to perform.I daren't ask what he's trying to do.

author: granz
author_rank: Regular Contributor
timestamp: April 17, 2014, 08:40:26 pm
content: If you just want to get something done, you won't have fun trying to do it with a soft-core on an FPGA, considering you don't have past experience with FPGAs. If you want to try it for educational reasons, that could make sense. As others have pointed out, running a soft-core on an FPGA is a very inefficient use of resources. By just taking an FPGA and throwing a soft-core on it you don't gain much, because you aren't taking advantage of the parallel processing ability of custom logic. A soft-core can be useful as an overseer to manage tasks at a higher level, but many commercial designs don't even do that, they just use an external dedicated processor.I guess you've decided on using a Due then, which I think is a good choice. It sounds like that should be more than up to the task you will ask of it.

author: electronics man
author_rank: Frequent Contributor
timestamp: April 17, 2014, 08:44:13 pm
content: Quote from: Monkeh on April 17, 2014, 08:37:44 pmim an analog guy trying to build a low frequancy (100MHz) spectrum analyser and i need to display the output it doesnt need a fast ADC as the signal has pased into an envelope detector, there is a lot of system stuff that needs to be done, i have the spectrum analyser working i just need a way to display the output.

author: codeboy2k
author_rank: Super Contributor
timestamp: April 17, 2014, 09:01:22 pm
content: Quote from: dannyf on April 17, 2014, 08:35:32 pmBad Danny. time out. Put down the soldering iron and go sit in the cornerlol

author: AlfBaz
author_rank: Super Contributor
timestamp: April 17, 2014, 09:37:57 pm
content: Reading through this thread the question going through my mind is if your programming ecosystem has a perceived performance lag, instead of jumping into the complex world of FPGA's (as flexible and useful as they are), ditch the arduino training wheel's and pick an MCU that CAN handle the job

author: dannyf
author_rank: Super Contributor
timestamp: April 17, 2014, 09:55:43 pm
content: QuoteUnless you have some super-duper lcd with billions of pixels, a slow mcu works just fine.

author: neslekkim
author_rank: Super Contributor
timestamp: April 17, 2014, 10:48:54 pm
content: Why so much hate?Anyway, the Papilio Pro are interrsting things, I have the Papilio one, pro, and some other fpga boards, not exactly gotten around to learn fpga stuff yet, but the ability to rund Zpuino on these are very nice.With the wishbone interface, one can add on various "peripherals" in the fpga, for instance as is done with the Retrocade, where zpuino communicates with soft-Sid and other sound chips from the old days.They also are making something called Papilio Schematic library, where they are giving you the option to create your own little SoC on the fpgaBut of course, worth it?, depens on what it means to you, cost in money?, or cost of learning?

author: nctnico
author_rank: Super Contributor
timestamp: April 18, 2014, 12:06:05 am
content: Quote from: codeboy2k on April 17, 2014, 07:07:42 pmI couldn't agree more. I'm currently working on an open source project/product where they 'forgot' to put a processor on the board. It uses the Lattice Mico 32 soft core instead but loading new firmware is a major PITA. It would have been so much easier if they put a Linux capable ARM processor on the board. It isn't a particular low cost solution so the extra parts would be less than peanuts.

author: miguelvp
author_rank: Super Contributor
timestamp: April 18, 2014, 12:34:05 am
content: If you decide to go with the FPGA, here is a dev board that will work for you:https://www.eevblog.com/forum/microcontrollers/terasic-cyclone-v-gx-starter-kit-(c5g)-review/But FPGA programming is not for the faint hearted, It will literally take you at least 3 months to get your head around it, and you will learn a lot. Just connecting eclipse or whatever IDE you want to use to hook into the soft core will take a lot of research. You can use the NIOSII soft core but Altera doesn't offer it for free.There might already be work done to connect the Arduino dev environment to the soft core but I haven't look into that.Altera has a good guided course curriculum that will help you along, but expect to spend a lot of hours and because iteration makes for better learning you will need to revisit the courses until you know exactly what's what or at least to the degree that you don't have to go through the training tutorials.If the GPIOs in there are not enough, then you can get this card too for more GPIO's that you can handle.http://www.altera.com/education/training/curriculum/fpga/trn-fpga.htmlNote it does have HDMI out but you will have to learn I2C to communicate and setup the chip then drive it with a frame buffer programmed in the FPGA.So it's doable but it's gonna require a lot of dedication and a lot of learning to get there.Alternate to this is to grab a Pioneer board and an lcd shield, it's a 32bit Arm Cortex M0 with programmable analog and digital components. But this won't take sketches (I believe that's what programs are called on that world) It will however allow you to program in C. And tons of exampleshttp://www.element14.com/community/thread/23736/l/100-projects-in-100-daysAll that said, if you want 100MHz, forget the pioneer, you might get 20KHz at best.The other one, will take a lot of coding and you will need a better ADC and ACD that the one on board. But money talks:http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=67&No=360&PartNo=2Two 14-bit Analog to Digital (A/D) converter channel with 150MSPSTwo 14-bit Digital to Analog (D/A) converter channel with 250MSPSOne Audio CODEC with Line-In, Line-Out, MIC and HeadphoneWith that you might get 50MHz using 3 samples but that would be crappy, 20MHz might be more realistic.But you can only use one HSMC card, so no extra GPIOsBy the time you are done, you could have bought a Spectrum Analyzer, but once you have this hardware, you could do say, SDR, or really anything you want.Of course there are other ways around all this but it all will require learning a lot of things.For example for Software Defined Radio, if you have a PC for $20 you can get this:http://www.nooelec.com/store/computer-peripherals/tv28tv2-sdr-dvb-t-usb-stick-set.html#.U1BxEVVdVn8Need an up converter for 125MHz, throw in another $45http://www.nooelec.com/store/ham-it-up-v1-0-rf-upconverter-for-software-defined-radio.html#.U1BxQ1VdVn8There is a lot of software out there for it too, that can do FFTs for example:http://sdrsharp.com/http://www.winrad.org/I guess more details on what you want to achieve.

author: amyk
author_rank: Super Contributor
timestamp: April 18, 2014, 01:45:23 pm
content: Quote from: dannyf on April 17, 2014, 09:55:43 pmYou may find this amusing...http://ossmann.blogspot.ca/2010/03/16-pocket-spectrum-analyzer.html

author: Psi
author_rank: Super Contributor
timestamp: April 18, 2014, 02:01:48 pm
content: Programming a FPGA soft core using Arduino is like buying a 16 core Xeon workstation and installing Windows 3.11 inside Dosbox for your OS.ok, maybe im being a bit mean, but yeah. Arduino is designed to make programming as simple as possible.FPGAs are at the other end of the spectrum. Putting them together is just wrong.

author: nctnico
author_rank: Super Contributor
timestamp: April 18, 2014, 02:27:09 pm
content: FPGA programming isn't more difficult / easier than any other kind of programming. It just takes time and effort to learn. The biggest difference is that FPGA programming languages are parallel (every statement of a program is executed simultaneously).

author: dannyf
author_rank: Super Contributor
timestamp: April 18, 2014, 03:00:19 pm
content: One interesting application of hd44780 is to make it into a quasi graphics display.

author: codeboy2k
author_rank: Super Contributor
timestamp: April 18, 2014, 06:45:44 pm
content: Quote from: nctnico on April 18, 2014, 12:06:05 amSometimes, especially in the opensource / openhardware arena, they just don't know any better, or get sidetracked with the cool factor, or get pulled in by peers questioning "why should we include an external MCU.. we have an FPGA, brah.. !"