Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ready for a new project

Status
Not open for further replies.

demestav

Member
Hello to everybody.
I am about to start a new project and i was wondering what components to use.

I have worked a bit with PICs and 8051 microcontrollers. A guy suggested me to use (and learn) FPGA. I have looked a bit in the internet and i saw that FPGA is about constructing your 'custom' microcontroller by using logical gates. fair enough. What i dont understand is how am i going to do complicated operations. Like let;s say implement a communications protocol. I don't know if i am explaining well enough so i am going to use an example:

In a mc that can be programmed with C you can use the following:
Code:
variable packet = packet_received;
if (packet.firstbit==0)
{
    LED = 1;
}

Can you do this using FPGA?????

Thank you.
 
FPGAs contain generic logic that can be programed to implement almost any combination of flipflops and logic gates. You arn't limited to making micorcontrollers in an FPGA; anything that can be make using flipflops and logic gates can be made using an FPGA. FPGAs are great for building a system on a chip. You can put all your perpherals - UARTS, Ethernet MAC, SPI, I2C, and custom logic - in addition to a microcontroller on a single chip.

You dont need to program a microcontroller into the FPGA. There are two popular languages for Programming FPGAs: VHDL and Verilog. Verilog is based on C and VHDL is based on Ada. Both take a bit of getting used to because they are designed for dataflow programming rather than sequantial programming.

You can download free implementaions of an 8051 in VHDL or Verilog. Oregano systems has a free 8051 in VHDL. You can program standard C for the 8051 and download it to the 8051 you program into the FPGA. There are also free PIC controllers out there.

for your example in VHDL it would look like
Code:
signal packet, packet_received : std_logic_vector(7 downto 0); --simple 8 bit value
packet <= packet_received;
if packet(0) = '0' then
   LED <= '1';
else
   LED <= '0';
endif;

--an even simpler implementation would be 
LED <= (NOT packet(0));
This generates a combinatorial peice of logic that would turn the LED on when the first bit of packet is equal to 0.

Take a look at a product by Altium called Nexar. Their live design eval kit is only $99 for a really nice board. Nexar is designed to make it really easy to implement a microcontroller in an FPGA (Z80, 8051 and PIC)- I got one up and running in about 20 min. The eval board also works with free Xilinx tools.
 
Wow! Thanks bmcculla. You really gave me some good information.

I am missing something though. When you talk about 8051 or PIC on the FPGA you mean that there is a free VHDL code that simulates an 8051 on an FPGA? i.e making the FPGA behave like a 8051???

Thank you
 
FPGAs let you program in logic gates and flipflpos. An 8051 or PIC processor is just a bunch of logic gates and flipflops. Witha a standard 8051 the logic is hard - its built out of silicon that you can't change - and you program in software. With an FPGA you have another level of programmability. In the FPGA the logic is soft - you can change it whenever you want. So first you program the logic that is the 8051 into the FPGA and then you can write software for that soft 8051. On that sme FPGA you can program in a PIC or a PIC and an 8051. You can see why FPGAs are so cool. Xilinx has a free tiny microcontroller designed for its FPGAs supposedly you can program in more than 10 of these little processors on a single average size FPGA.

The FPGA insn't simulating the 8051 or PIC in the way that a PC does. PCs execute one instruction at a time. To simulate an 8051 it just executes those instructions fast enough to make the result like an 8051. FPGAs are parallel. Everything happens at the same time. An FPGA makes an 8051 in the same manner as a silicon chip, with some significant differences but the result is the same. You can take the same VHDL that is the 8051 and build it in silicon if you wanted.

There is free 8051 VHLD and Verilog code out there. This code will make the FPGA behave like an 8051 - the instruction set will be the same. FPGAs are cool because you can add whatever you want to the free VHDL. You can design your own processor if you feel like it.
 
bmcculla said:
FPGAs let you program in logic gates and flipflpos. An 8051 or PIC processor is just a bunch of logic gates and flipflops. Witha a standard 8051 the logic is hard - its built out of silicon that you can't change - and you program in software. With an FPGA you have another level of programmability. In the FPGA the logic is soft - you can change it whenever you want. So first you program the logic that is the 8051 into the FPGA and then you can write software for that soft 8051. On that sme FPGA you can program in a PIC or a PIC and an 8051. You can see why FPGAs are so cool. Xilinx has a free tiny microcontroller designed for its FPGAs supposedly you can program in more than 10 of these little processors on a single average size FPGA.

The FPGA insn't simulating the 8051 or PIC in the way that a PC does. PCs execute one instruction at a time. To simulate an 8051 it just executes those instructions fast enough to make the result like an 8051. FPGAs are parallel. Everything happens at the same time. An FPGA makes an 8051 in the same manner as a silicon chip, with some significant differences but the result is the same. You can take the same VHDL that is the 8051 and build it in silicon if you wanted.

There is free 8051 VHLD and Verilog code out there. This code will make the FPGA behave like an 8051 - the instruction set will be the same. FPGAs are cool because you can add whatever you want to the free VHDL. You can design your own processor if you feel like it.


Check opencores.org for free useful HDL like uarts, microcontroller emulators etc...

Check xilinx.com webpack for free hdl tools targeting xilinx silicon of course.
 
Hello and thnx for the replies. I can understand now why FPGAs are so popular.

Now i am hesitating about it, beacause there is a lot of new stuff to learn! It's a bit risky as i have about 5-6 months to complete my project.

Tell me your opinion. What 'scares' me is the design of the FPGA not the programming. I think my programming skills are enough to cover this project (suppose I quickly learn Verilog). Isn't there any begginers website to start with?
 
I think 5-6 months would be fine to get up to speed with FPGAs. I haven't used Verilog but VHDL isn't that hard to learn. It takes a while to get the hang of the non-sequential programming but its not too hard. I think the main thing is to be modest in your project goals to give yourself enough time to learn about FPGAs.

I talked about the product Nexar earlier. It's really easy to learn and use. It provides schematic entry for your FPGA components with the ability to add your own VHDL coded components. They will give you a month trial for free but if you're a student you probably could convince them to extend the free trial to several months - Its good for them to get young engineers interested in their products.
 
Ok thnx for the advice.
I will read a bit more to decide what to do. I think it will be better to learn some other time on my own project.
 
Status
Not open for further replies.

Latest threads

Back
Top