Microcontroller/fgpa language questions

  • Thread starter bassplayer142
  • Start date
  • Tags
    Language
In summary, the conversation discusses the different languages used to program FPGAs and microcontrollers. VHDL and Verilog are commonly used for FPGAs, while C, Assembly, and BASIC are used for microcontrollers. The conversation also mentions the use of pre-made C functions for microcontrollers and the need to modify them for specific boards and software setups. There is a mention of the possibility of using C to program FPGAs, but it is not a popular method. The conversation also recommends Xilinx's software for designing FPGAs and mentions the availability of help on their forums.
  • #1
bassplayer142
432
0
I get really confused about the languages associated with fpgas and microcontrollers. I'm not asking what the difference is between a ucontroller and an fgpa.

1. What different languages can you use to program an fpga? I already know that you can use vhdl/verilog.

2 What different languages can you use to program a microcontroller? I know that you can use C but what else?

Also, we used an hcs12 microcontroller in class with a lot of premade c functions to do many tasks. Would I have to use the same board and setup software (codewarrior) to use these functions. I understand that some of the functions would have to be at least modified (clock frequency, pins, etc...)

Thanks for any help.
 
Engineering news on Phys.org
  • #2
bassplayer142 said:
I get really confused about the languages associated with fpgas and microcontrollers. I'm not asking what the difference is between a ucontroller and an fgpa.

1. What different languages can you use to program an fpga? I already know that you can use vhdl/verilog.

2 What different languages can you use to program a microcontroller? I know that you can use C but what else?

Also, we used an hcs12 microcontroller in class with a lot of premade c functions to do many tasks. Would I have to use the same board and setup software (codewarrior) to use these functions. I understand that some of the functions would have to be at least modified (clock frequency, pins, etc...)

Thanks for any help.

-1- Yes, VHDL, Verilog, and other HDL languages like AHDL, etc. Verilog is very common here in Silicon Valley, but I've heard that VHDL is more popular other places. Don't know if that's true.

-2- C, Assembly, and BASIC are probably the three most common.

On the other questions, usually there will be an API (application program interface) with C functions that you can call to do lower-level hardware things. So yes, those actual functions would generally need to be written for the specific uC, to match the register and pin definitions, etc.
 
  • #3
Thanks for the reply. It would be nice if everything was compatible!
 
  • #4
bassplayer142 said:
I get really confused about the languages associated with fpgas and microcontrollers. I'm not asking what the difference is between a ucontroller and an fgpa.

1. What different languages can you use to program an fpga? I already know that you can use vhdl/verilog.

2 What different languages can you use to program a microcontroller? I know that you can use C but what else?

Also, we used an hcs12 microcontroller in class with a lot of premade c functions to do many tasks. Would I have to use the same board and setup software (codewarrior) to use these functions. I understand that some of the functions would have to be at least modified (clock frequency, pins, etc...)

Thanks for any help.

Some ppl also used C to program FPGAs. I think C is still used to write test benches for testing FPGA designs. Its not popular though.
You can also design by just using schematic. No need to learn vhdl or verilog.

For uC just understand what the(algorithm) function is doing and you can implement it in any language you want.

Berkeman, I thought vhdl was used more in the west coast and verilog in the east coast.
 
  • #5
likephysics said:
Some ppl also used C to program FPGAs.

Berkeman, I thought vhdl was used more in the west coast and verilog in the east coast.

At least in Si Valley, Verilog/RTL is the standard. How do you use C to write code for an FPGA?
 
  • #6
berkeman said:
At least in Si Valley, Verilog/RTL is the standard. How do you use C to write code for an FPGA?

Frankly, I have no idea. I am vhdl newbie myself. I was reading a book on writing testbenches, the author mentioned that he was writing testbenches in C like 10-15yrs ago.
 
  • #7
It may be that he was using C to construct and output his testbench text files.

FPGA/CPLD code is generally targeted at defining state machines and IO paths. There may be a way to morph C code into FPGA/CPLD HDL, but that would be a stretch for convenience, IMO. Verilog/RTL/HDL/VHDL would be the basic thing to learn for ASIC/FPGA/CPLD definition, I would think.

Check out the free software at Xilinx's website for designing FPGA/CPLDs:

http://www.xilinx.com/ise/logic_design_prod/webpack.htm

As long as you have about a free GB on your hard disk, this is a vey good package to learn and use.
 
Last edited by a moderator:
  • #8
berkeman said:
It may be that he was using C to construct and output his testbench text files.
na, that sounds like too much work. Here's a link to C book for fpga -
https://www.amazon.com/dp/0131543180/?tag=pfamazon01-20

FPGA/CPLD code is generally targeted at defining state machines and IO paths. There may be a way to morph C code into FPGA/CPLD HDL, but that would be a stretch for convenience, IMO. Verilot/RTL/HDL/VHDL would be the basic thing to learn for ASIC/FPGA/CPLD definition, I would think.

Check out the free software at Xilinx's website for designing FPGA/CPLDs:

http://www.xilinx.com/ise/logic_design_prod/webpack.htm

As long as you have about a free GB on your hard disk, this is a vey good package to learn and use.

Thanks. I already have ISE and libero. I prefer ISE, but we use actel fpga. So I have to use libero. No synthesis in Libero.
One advantage xilinx has is its forums. I can get help fast. I am still trying to decide if i want to get xilinx kit or actel kit for myself.
 
Last edited by a moderator:

1. What is a microcontroller?

A microcontroller is a small computer on a single integrated circuit that is designed to control a specific operation or task. It contains a CPU, memory, and input/output peripherals, making it a self-contained system.

2. What is an FPGA?

FPGA stands for Field-Programmable Gate Array. It is a type of integrated circuit that can be programmed and reprogrammed by users after manufacturing. This allows for highly customizable digital circuit designs.

3. What are the main differences between microcontrollers and FPGAs?

The main difference between microcontrollers and FPGAs is that microcontrollers are designed for specific tasks and have fixed functionality, while FPGAs can be programmed to perform a wide range of functions and are highly customizable. Additionally, microcontrollers typically have lower power consumption and cost compared to FPGAs.

4. What programming languages are commonly used for microcontrollers?

The most commonly used programming languages for microcontrollers are C and assembly language. Some popular variants of these languages include C++ and Arduino, which are often used for simpler microcontroller projects.

5. Can FPGAs be programmed using high-level languages?

Yes, FPGAs can be programmed using high-level languages such as VHDL, Verilog, and SystemVerilog. These languages allow for a more abstract and efficient way of describing the behavior of the digital circuits to be implemented on the FPGA.

Similar threads

  • Electrical Engineering
Replies
10
Views
2K
  • Electrical Engineering
Replies
17
Views
23K
  • Programming and Computer Science
Replies
1
Views
2K
  • Electrical Engineering
Replies
10
Views
2K
  • Electrical Engineering
Replies
3
Views
2K
  • Programming and Computer Science
4
Replies
107
Views
5K
  • Electrical Engineering
Replies
19
Views
2K
Replies
1
Views
803
  • Electrical Engineering
Replies
2
Views
1K
Replies
13
Views
5K
Back
Top