Jump to content
Electronics-Lab.com Community

when should use FPGA?


Recommended Posts

Hi,

My question is:

when should the project use a microcontroller, or when should it uses FPGA? Can you provide a good example of the project. The project that comes to my mind are:
            a.  A pong game using LCD interface and push buttons.
            b.  A stepper motor controller that will control 2-3 motors
            c.  A simple version of Atari game console
            d. An oscilloscope
            e. A project that involve image processing from camera input
At first I thought that from a hobbiest, that they will make it in microcontroller but in industry they will do it using FPGA. But after further thought, since the cost of FPGA is more that a simple microcontroller, this is not making sense.

Thank you,

Shahriar

Link to comment
Share on other sites


  I thought an FPGA was a socket you put a chip into. Then I did a web search and found out that FPGA stands for Field Programmable Gate Array.  I guess I don't know anything about fpga's but I do know a little about Microcontrollers and if I did a web search on just about any of the projects you listed something would show up.
                                Good Luck
                                  gogo

Link to comment
Share on other sites

Dear gogo
Thank you for your reply!

I asked the same question from a FPGA Expert that I found his email in his website http://www.fpga4fun.com

This is what he asnwered:

Use a MCU when you need to do something once in a while, use an FPGA
when you must do something continuously.

For example, doing an Ethernet packet analyzer can be done with a MCU,
since you receive packets once in a while. But doing the Ethernet
physical receiver needs to be done in hardware (FPGA), since the
receiver is actually the piece of hardware that continuously listens
to the wires to see if a packet is coming.

Hope that's (kind of) clear.
Jean

Link to comment
Share on other sites

  • 1 month later...

Dear Shahriar!
As u know MCUs like AVR can work in frequencies about 16 or 20 MHz
but FPGa can work in very high frequencies.i'm just working on an oscilloscope project in university of GILAN.and i found out that for this case FPGA is a better choise than MCU.
If u get any information plz tell me about it.my mail:[email protected]

Link to comment
Share on other sites

Hi,
to Ante, one remark, yes the FPGA is not a CPU, but .. i think is not very far from MCU. The princip is different, but in this moment in many FPGA application is used IP core for different procesor, and second, for FPGA is used program languages.

About this when you can use FPGA and when MCU. The question is very difficult, the FPGA or CPLD is a logic elemnt, and you can create many differents configuration between. The one of the best way is to combine logic and MCU, but in different case you can use mcu or fpga, actualy this is valid for complex procces. For example, if you want to have a SDRAM or DDR interface, but your CPU nt have this interface, the only ine way is using the CPLD or FPGA. If you have a need off fast respons and fast signal dating, i talk for a digital signal the logic is better, one of the advantage is the high frequency, and paralel processing. For exampel, if you have several different signal, and whant to make some datting, let this is sum betwen sygnal, for examlple A,B,C 4 bit bus, in FPGA or CPLD the output response is depend only from CPLA element delay, in this case around 10 ns, for CPLD, in to same case in microcontroler you must read different signal, after then make a sum, but this is not a parlel proces, you first read, A, after this read B, after this C, after this add A to B, after this add B to C, and finally put the result in to output, how you see this is many opperation, and if yu use the RISC cpu, at 20 Mhz, and 1 instruction for clock = 50 ns, the response time will be no less that 300 ns, if the cpu architecture can solve the problem with 6 operation.
The advantage of FPGA is that you can put CPU core in to chip, and combine it with other logic. Very good example is the car ECU, for good engine control, you must can control evry chanel searetly, if you have 6 cylinder engine, this is a 6 chanel for ignition, and 6 chanel for injection. Ok, good resolution is 1 uS, then you must have a 12 indipendent chanel, that can caontrol delay after some sync signal, and send impuls with some weidth. If you use CPU, this is not very easy, becouse you must look at 12 different timer, or counters, and compare it value to some variable. The CPU can do this, if CPU have several capture - compare modules, and you set some limitation on the sygnal condition, then you can make this. If you use logic, this is a very easy to be solved, you must put several counter and comparator, and this is all, you can use any resolution up to 10 ns, and you will have a 10 ns response time.
On the other hand, for this ECU you must calculate several parameters, delay and impuls weidth, if you use the FPGA for this, you must use IP core, but for this you must have a bigger FPGA, on the other hand every CPU canmake this calculation very easy, because this is not a very fast procces. And ... the result you have several way, to use cpu with many CCP modules, but this is not guaranty that all wil be OK, to use the big FPGA with IP core, this is a very good solution, may be more costly, or to use cpu and CPLD combination.
Another example is digital analisator, in this case you can't use the cpu, becouse you have a need off very fast response. But if you want to make some simple protocol converter, may be is better to use the CPU.
I can give you many different examples, but better is to understood what is the differents, and what is the advantage of the CPU and logic, FPGA or CPLD.

p.s. may be this is not very good english, and can't get the pulicer but i hope you will understood me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
  • Create New...