Forum Discussion
Pro& Cons using FPGA???
Hello everyone,
Can someone pointed out to me what are the pros and cons using fpga compare to microcontroller? What I know is fpga execute our program in paralel order and uc execute the program sequentially. Because of that reason, I think fpga tends to make less delay compare to uc. It is needed for example when I would like to operate multiple motor which I need accuracy. FPGA convert our hdl later into some sort of gate array but the uc use only bunch of instruction. (please someone correct me if I'm wrong) What are other pro& con using fpga compared to uc? Thank you everyone.11 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- What do you mean when you said "reconfigurable"? I think uc is also reconfigurable. --- Quote End --- Not the same thing, not even close. Programming an FPGA is much like designing a digital integrated circuit: You draw* the circuit using logic gates (AND, OR, etc) and flip-flops and some other bits and pieces. Then you use the FPGA software to synthetize and map the circuit you draw into a FPGA configuration and when you load the configuration into the FPGA, it will behave as the circuit you draw. * Or you describe the behavior of the circuit in Verilog/VHDL - Altera_Forum
Honored Contributor
--- Quote Start --- It would be appreciated if someone can tell me in which application fpga perform better than uc and vice versa. --- Quote End --- You'll get a lot of different opinions on this question. The answer depends heavily on your application. If your problem involves lots of parallel data processing and can be visualized as a 'stream' of processing steps, then this works quite nicely in an FPGA. But it also works quite nicely on a bank of parallel DSP processors. If you were a DSP programmer, then the DSPs would be your perfect solution. However, if you were an FPGA programmer, the FPGAs would be the obvious solution. If your problem involves lots of control and monitoring applications, then a microcontroller might be the solution. But what if the microcontroller doesn't have 'just the right mix' of peripherals? Well, you add a CPLD or an FPGA to its local bus (or SPI port, or I2C port) and use each where they perform the best. Look at the Cypress PSoC and the MicroSemi Fusion devices - they are microcontrollers with programmable analog or digital blocks. I use PowerPC processors and FPGAs. Why? Well, it allows the partitioning of the real-time tasks in the FPGA, and the non-real-time (or less real-time) tasks to a processor. You can then partition the system design across multiple people, with multiple skill sets. In my current project, I'm looking at using the ARM STM32F4 as a power controller for my more expensive FPGAs; it'll turn the power on, monitor temperatures, currents etc, and can be used as the device programmer. Why use a microcontroller? Its one chip, its cheap, and after programming it to do its job, its just a chip on the board (no software maintenance required). Cheers, Dave - Altera_Forum
Honored Contributor
It would be appreciated if someone can tell me in which application fpga perform better than uc and vice versa.
- Altera_Forum
Honored Contributor
Yeah actually I know in my case, i could just use uc. But at the time I decided to use fpga for this project, i have in mind that I would like to learn fpga which is why I choose it. But now that I have use fpga, I don't know what the advantage of using it.
- Altera_Forum
Honored Contributor
Actually I don't need any analog to digital converter. I don't need any external device(instead of the sensors itself)
- Altera_Forum
Honored Contributor
Could someone give me a "list of questions" I have to ask myself everytime I start a new project to decide which to use(fpga or uc)?
- Altera_Forum
Honored Contributor
--- Quote Start --- I use 3 sensors and later with the data I got, I need to perform calculation (in which I also need trigonometric calculation) for my control. After that the result of the control is gonna actuate a actuator. Given a choice of uc and fpga, which should I use? What critical here is time respond until the system become stable. --- Quote End --- This sounds like a microcontroller task. If sensors are analog voltages, they will need to be analog-to-digital converted; which for an FPGA requires an external component, but exists on a microcontroller. If you are using actuators, then I would imaging your 'speeds' are quite slow. Well within the capabilities of microcontrollers . For example, the STM32F4-Discovery kit is available from ST for free. Its got a 168MHz ARM Cortex-M4 core, with floating-point unit, fast I/O, USB, etc. That may even be overkill. Cheers, Dave - Altera_Forum
Honored Contributor
Oh yah I also forgot to mention I also need to perform communication from pc to uc or fpga(depends on which I use). If fpga, I am trying to use virtual jtag. If uc, I am trying to use usb to serial communication.
- Altera_Forum
Honored Contributor
--- Quote Start --- - There's no decent chip in the market that fits your needs and you don't have the time to design your own. - You could use some existing chips but it's cumbersome or poor performing. - You need the flexibility to reconfigure your system. --- Quote End --- Thank you for both of your replies. How poor performing is it? In which application should we use fpga or uc? What do you mean when you said "reconfigurable"? I think uc is also reconfigurable. In my case, I use 3 sensors and later with the data I got, I need to perform calculation (in which I also need trigonometric calculation) for my control. After that the result of the control is gonna actuate a actuator. Given a choice of uc and fpga, which should I use? What critical here is time respond until the system become stable. Sorry for the basic questions. I already know what is fpga and its architecture. Thank you. - Altera_Forum
Honored Contributor
Actually, there are µCs with dedicated PWM hardware which can achieve timings not achievable with an FPGA.
Anyway, FPGAs are re-configurable logic devices. They contain thousands of basic digital blocks. These blocks, and the way they are connected, can be configured to behave as any digital chip you can think off. Then can be.. whatever you can build blocks within a FPGA. Which is a lot. An FPGA can be configured to be a CPU, a µC, a USB controller, a UART, the chip you'd like to have but doesn't exist, etc. However, compared to dedicated chips, FPGAS are expensive, slow, have high power consumption, tend to require more components and other stuff. So, good reasons to use a FPGA: - There's no decent chip in the market that fits your needs and you can't afford to design your own. - There's no decent chip in the market that fits your needs and you don't have the time to design your own. - You could use some existing chips but it's cumbersome or poor performing. - You need the flexibility to reconfigure your system. So, a more practical example. Once upon a time, we needed to control a bunch of I2C ADCs and DACs, Since we were running out of address space, we decided to use multiple I2C buses. Since we couldn't find any µC with enough I2C masters, we used an FPGA and implemented a design with a 8051 µC and several I2C masters to fit our needs. Problem solved.