Author Topic: is it worth running a soft arduino on spartan FPGA  (Read 9893 times)

0 Members and 1 Guest are viewing this topic.

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
is it worth running a soft arduino on spartan FPGA
« on: April 17, 2014, 05:54:56 pm »
can I make use of the full power of the FPGA if i use the arduino soft core on this FPGA board http://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 LCD

so is it worth it?
follow me on twitter @get_your_byte
 

Offline Hideki

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: no
Re: is it worth running a soft arduino on spartan FPGA
« Reply #1 on: April 17, 2014, 06:50:44 pm »
no
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: is it worth running a soft arduino on spartan FPGA
« Reply #2 on: April 17, 2014, 07:07:42 pm »
It's almost never a good idea to run a soft core inside an FPGA unless you 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.
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #3 on: April 17, 2014, 07:10:23 pm »
Well the thing is I want the eas of arguing and the power of the FPGA and I have no experience programming FPGAs
follow me on twitter @get_your_byte
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8539
Re: is it worth running a soft arduino on spartan FPGA
« Reply #4 on: April 17, 2014, 07:22:48 pm »
A soft-core Arduino!? :o

The task you describe doesn't even require an FPGA. A regular Arduino would be enough.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: is it worth running a soft arduino on spartan FPGA
« Reply #5 on: April 17, 2014, 07:24:18 pm »
Quote
is it worth it

Whether 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.
================================
https://dannyelectronics.wordpress.com/
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #6 on: April 17, 2014, 07:35:08 pm »
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
follow me on twitter @get_your_byte
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: is it worth running a soft arduino on spartan FPGA
« Reply #7 on: April 17, 2014, 07:39:00 pm »
Quote
well i need the ease of arduino programming and the power of an FPGA,

Sounds 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.

================================
https://dannyelectronics.wordpress.com/
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: is it worth running a soft arduino on spartan FPGA
« Reply #8 on: April 17, 2014, 07:43:57 pm »
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

To 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 - absolutely
Is it "worth it" from a cost/power perspective - absolutely not
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: is it worth running a soft arduino on spartan FPGA
« Reply #9 on: April 17, 2014, 07:44:30 pm »
I have no experience programming FPGAs
Then pick up a book on VHDL/Verilog and start reading.
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #10 on: April 17, 2014, 07:47:06 pm »
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

To 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???



needs to do everything in about a second; and im not sure how big the lcd is, i may use the VGA "wing"
follow me on twitter @get_your_byte
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: is it worth running a soft arduino on spartan FPGA
« Reply #11 on: April 17, 2014, 07:52:40 pm »
needs to do everything in about a second; and im not sure how big the lcd is, i may use the VGA "wing"

A 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.
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #12 on: April 17, 2014, 07:58:20 pm »
needs to do everything in about a second; and im not sure how big the lcd is, i may use the VGA "wing"

A 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.

obviously the faster the better but im being realistic because there will be maths to do between the adc read and the screen update
follow me on twitter @get_your_byte
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: is it worth running a soft arduino on spartan FPGA
« Reply #13 on: April 17, 2014, 08:05:21 pm »
needs to do everything in about a second; and im not sure how big the lcd is, i may use the VGA "wing"

A 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.

obviously the faster the better but im being realistic because there will be maths to do between the adc read and the screen update

Unless 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.
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #14 on: April 17, 2014, 08:10:15 pm »
i might just go for a fast arduino like the the arduino due
follow me on twitter @get_your_byte
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: is it worth running a soft arduino on spartan FPGA
« Reply #15 on: April 17, 2014, 08:15:51 pm »
Quote
i might just go for a fast arduino like the the arduino due

Sure.

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.
================================
https://dannyelectronics.wordpress.com/
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #16 on: April 17, 2014, 08:18:16 pm »
Quote
i might just go for a fast arduino like the the arduino due

Sure.

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.

even if a slow one can do it i wont have enough IO on something like the uno
follow me on twitter @get_your_byte
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: is it worth running a soft arduino on spartan FPGA
« Reply #17 on: April 17, 2014, 08:22:04 pm »
Quote
even if a slow one can do it i wont have enough IO on something like the uno

Then run the soft arduino on a fpga.

It doesn't sound like you ever wanted to give yourself a choice.
================================
https://dannyelectronics.wordpress.com/
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #18 on: April 17, 2014, 08:24:36 pm »
i will do it on a due its cheaper
follow me on twitter @get_your_byte
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: is it worth running a soft arduino on spartan FPGA
« Reply #19 on: April 17, 2014, 08:35:32 pm »
Quote
i will do it on a due

Doesn't that fail to do what you wanted to do? Use arduino language on fpga?
================================
https://dannyelectronics.wordpress.com/
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8155
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #20 on: April 17, 2014, 08:37:44 pm »
Quote
i will do it on a due

Doesn't that fail to do what you wanted to do? Use arduino language on fpga?

He thought he needed an FPGA because he has such a complicated task to perform.

I daren't ask what he's trying to do.
 

Offline granz

  • Regular Contributor
  • *
  • Posts: 136
  • Country: us
  • 6.62606957
Re: is it worth running a soft arduino on spartan FPGA
« Reply #21 on: April 17, 2014, 08:40:26 pm »
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.
 

Offline electronics manTopic starter

  • Frequent Contributor
  • **
  • Posts: 686
  • Country: gb
Re: is it worth running a soft arduino on spartan FPGA
« Reply #22 on: April 17, 2014, 08:44:13 pm »
Quote
i will do it on a due

Doesn't that fail to do what you wanted to do? Use arduino language on fpga?

He thought he needed an FPGA because he has such a complicated task to perform.

I daren't ask what he's trying to do.

im 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.
follow me on twitter @get_your_byte
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: is it worth running a soft arduino on spartan FPGA
« Reply #23 on: April 17, 2014, 09:01:22 pm »
Doesn't that fail to do what you wanted to do? Use arduino language on fpga?

Bad Danny. time out.  Put down the soldering iron and go sit in the corner :) lol
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2187
  • Country: au
Re: is it worth running a soft arduino on spartan FPGA
« Reply #24 on: April 17, 2014, 09:37:57 pm »
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
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: is it worth running a soft arduino on spartan FPGA
« Reply #25 on: April 17, 2014, 09:55:43 pm »
Quote
i have the spectrum analyser working i just need a way to display the output.

Unless you have some super-duper lcd with billions of pixels, a slow mcu works just fine.
================================
https://dannyelectronics.wordpress.com/
 

Offline neslekkim

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: no
Re: is it worth running a soft arduino on spartan FPGA
« Reply #26 on: April 17, 2014, 10:48:54 pm »
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 fpga

But of course, worth it?, depens on what it means to you, cost in money?, or cost of learning?
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28515
  • Country: nl
    • NCT Developments
Re: is it worth running a soft arduino on spartan FPGA
« Reply #27 on: April 18, 2014, 12:06:05 am »
It's almost never a good idea to run a soft core inside an FPGA unless you 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. 
I 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.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: is it worth running a soft arduino on spartan FPGA
« Reply #28 on: April 18, 2014, 12:34:05 am »
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.html

Note 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 examples

http://www.element14.com/community/thread/23736/l/100-projects-in-100-days

All 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=2

Two 14-bit Analog to Digital (A/D) converter channel with 150MSPS
Two 14-bit Digital to Analog (D/A) converter channel with 250MSPS
One Audio CODEC with Line-In, Line-Out, MIC and Headphone

With 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 GPIOs

By 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#.U1BxEVVdVn8

Need an up converter for 125MHz, throw in another $45
http://www.nooelec.com/store/ham-it-up-v1-0-rf-upconverter-for-software-defined-radio.html#.U1BxQ1VdVn8

There 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.
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8539
Re: is it worth running a soft arduino on spartan FPGA
« Reply #29 on: April 18, 2014, 01:45:23 pm »
Quote
i have the spectrum analyser working i just need a way to display the output.

Unless you have some super-duper lcd with billions of pixels, a slow mcu works just fine.
You may find this amusing...

http://ossmann.blogspot.ca/2010/03/16-pocket-spectrum-analyzer.html
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 10414
  • Country: nz
Re: is it worth running a soft arduino on spartan FPGA
« Reply #30 on: April 18, 2014, 02:01:48 pm »
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.   >:D

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.
« Last Edit: April 18, 2014, 02:08:10 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Online nctnico

  • Super Contributor
  • ***
  • Posts: 28515
  • Country: nl
    • NCT Developments
Re: is it worth running a soft arduino on spartan FPGA
« Reply #31 on: April 18, 2014, 02:27:09 pm »
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).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: is it worth running a soft arduino on spartan FPGA
« Reply #32 on: April 18, 2014, 03:00:19 pm »
One interesting application of hd44780 is to make it into a quasi graphics display.
================================
https://dannyelectronics.wordpress.com/
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: is it worth running a soft arduino on spartan FPGA
« Reply #33 on: April 18, 2014, 06:45:44 pm »
It's almost never a good idea to run a soft core inside an FPGA unless you 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. 
I 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.

Sometimes, 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.. !" :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf