📜 ⬆️ ⬇️

Take a step to the FPGA



Did you wait for the sign? Here he is!

For many years I did not dare to start programming the FPGA, because it is difficult, expensive and painful (as it seemed to me). But it is good when there are friends who help to make the first step. And now I do not understand one thing - why did I wait so long?
')
Now I will help you take the first step!


Why do I need it?


Are you tired of constantly reading the docks on your MK or keeping a lot of information in your head. You rewrote everything on asm, but the speed is still not enough. You connected two external devices to your MK, you connect the third, but you have run out of interrupts, those modules that have already worked have stopped working. You take another MK, more powerful of the same line, but again manuals, flag registers, bits ... hell. You change the platform: you switch to another MK and throw your knowledge on the old platform into the garbage bin. Whatever you do, it comes hard. You find a popular platform in which you can easily assemble a project from the components, but you still cannot jump above the hardware limitations of this MK ... Somewhere on the edge of consciousness, sometimes the thought jumps that it would work on the FPGA quickly and in parallel that “It’s exactly the task that would have to be solved on the plis”, but I’m old / stupid / busy / etc to manage / start doing it.



Do you want to finally breathe freely? Go ahead!

Joy on FPGA design


I had a hard working day. From one job I arrived at the second job, then to the dacha, in the evening housework, lessons, then family watching a movie, and only at 23 o'clock I was completely free! To say that I was tired is to say nothing. But in this state, I sat down at the laptop with a firm goal: to make a meander generator at 440 Hz. It took 20 minutes and I already heard it in my headphones. I did not believe my ears! It took me another 15 minutes to make PWM and change the volume. By that time, I had only one FPGA board for a week, and before that I had just flipped through a couple of books on Verilog.

That evening I understood: HERE IT! Here is the platform in which I can quickly and easily turn my thoughts into a really working iron!



Why is that?


I will describe the advantages that exist in the study and application of FPGAs, although everyone already knows them:



Problem of choice


Greatly stop the questions, what to choose: Altera / Xilinx, Verilog / VHDL, which debug board to take. But first things first.

Manufacturer


I chose Altera . Why? Well, we decided this way with a friend, although the name Xilinx is more beautiful to me. BUT. If you cannot choose now, then I will do it for you. You need Altera! Why? I dont know. Now it is more important to take a step: to make a choice. I chose Altera and have not regretted it yet.



Tongue


We take Verilog - because ... well, you understand.


Debug board


The choice of the debug board took the most time. It is clear that the boards differ in the installed FPGA chip. A FPGA chip differs from each other in the number of elements. But it is not at all clear how much they will need for your test projects. Therefore, most of the time I spent on the search for various projects on the FPGA in order to find out how much they consume FPGA resources.

In the Altera family, for reasonable money, we can buy boards with CPLD MAX II for 240, 570 and 1270 elements, or older FPGA chips that have Cyclone 1, 2, 3, 4 with up to 10,000 cells or more. How to choose?

Even on the basis of 240 cells, the project Mars Rover does just a huge number of projects . I strongly recommend that you read it in order to have a rough idea of ​​the complexity of projects that can fit in 240 cells. On the other hand, there are projects that are fully programmed for a hardware copy of a specific PC, including the processor and all the logic around it ( NES , Speccy , Orion , UT-88 , etc). To do this, it already takes five, ten or more thousand cells. Plus, these boards contain additional external devices.

Therefore, I would advise you to take something between 240 and 10,000 cells, with preference upwards depending on the available funds. On the debug board extra cells it is not scary, and if they are not enough - nothing can be done. Then, when the device is debugged, it will become clear how many cells you need, to buy at the right amount, without unnecessary weight, cheaper and leave it in the finished device.

What really differs MAX from Cyclone'ov, in addition to the number of cells, is:
1) The MAX series does not have a PLL inside. Each debug board has a generator, usually at 50 MHz. The bulk of the projects that will be enough. All synchronization will occur by dividing 50 MHz by some value. Or, you can take the external generator and submit to a separate input of the FPGA. And what if you need a frequency above 50 MHz? I did not manage to find generators above 50 MHz on the move. But here the PLL comes to the rescue and is built into the Cyclones. It can multiply the frequency, for example, up to 100 MHz.
2) The multiplication units are built into the Cyclone series. Their number depends on the specific model - just then you can “look at the instructions all the way” to find out how much. If you intend to do some kind of DSP, then they will be useful: they will save cells, increase speed. On the other hand, if there are no multipliers, they can be synthesized, but a small FPGA may not have enough resources for this.

In all other respects, my “climbed / not climbed” criterion. Debugging on a knowingly larger than the board needs, followed by pouring into the minimum necessary for this.

How much money is needed?




Programmer
I think that I don’t have time to solder the programmers on the payload.

300 rubles. I took mine on ebee , it looks like this:


Debug board
The choice is wide, depending on the amount of money.

The initial level of 350 - 550 rubles. These are boards on MAX II ( 240 or 570 cells). May be suitable for initial familiarization and further attachment to end devices. The board has a generator, a pair of buttons, a pair of LEDs, the remaining 80 pins are at your discretion.


Power Supply
Must be, but not always included. A 5 volt power supply and 2A current is required.

The average level is from 900 to 1500 rubles. These are Cyclone 1, 2, 3, 4 boards differing mainly in the number of cells.
Marked like this:
EP 2 C 5 T144 - Cyclone 2 approximately 5k cells
EP 4 CE 6 E22C8N - Cyclone 4 approximately 6k cells
EP 2 C 8 Q208C8N - Cyclone 2 approximately 8k cells

You may notice that Cyclone 3 may have more cells than Cyclone 4.

Here are a few options:

835 rubles.
ALTERA FPGA CycloneII EP2C5T144 Minimum System Board for Learn good


880 rubles
Altera CycloneII EP2C5T144 FPGA Mini Development Learn Core Board E081


1265 rubles
EP2C8 EP2C8Q208C8N ALTERA Cyclone II FPGA Evaluation Development Core Board


Boards with advanced features . These are boards on which additional modules are installed (UTP, USB, AUDIO), connectors (SD, VGA), buttons, switches, LEDs, seven-segment indicators, etc. Or the baseboard can go, and expansion cards can be attached to it separately.

I have such a kit - a board + expansion card:
Altrea EP4CE10E22 FPGA CORE Board + Device Board USB / Sound / Ethernet / SD Card / VGA
2760 rubles

Here is the main board. It has 2 LEDs, 2 buttons, 4 switches, a seven-segment intikator and a memory chip.


Expansion Board. On it are soldered SD, VGA, as well as USB controllers (High Speed ​​USB2.0 Chip: CY7C68013A), AUDIO (Sound Card up to 96kHz / 32bit ADC / DAC: WM8731S), UTP (100M Ethernet interface: DM9000A):


These boards are simply inserted one into the other, but I still have it in the box. For my crafts I have a mockup with which I connect with a train that comes with it. Also included is a 5 volt power supply.

More options:

Altera Cyclone NIOS II SOPC FPGA Development Learning Board EP2C8Q208C8N + LCD1602 - 2,670 rubles


Terasic Altera FPGA DE0-Nano Cyclone IV Development and Education Board - 4600 rubles


A wide selection of Alter motherboards and extensions to them
Mars Rover Project

But in general, I would not recommend to buy large and expensive debugging boards immediately. Expensive purchases must be justified, but now it’s not clear what will work best. It will become clear when the practice begins.

Order, wait


As long as the boards go, you can start preparing yourself mentally and technically:
- Install Quartus II v.11.1
Read:
- Book: .. Polyakov VHDL and Verilog languages ​​in the design of digital equipment 2003
- www.kit-e.ru/articles/circuit/2008_3_161.php - HDL Short Course
- Lessons on the rover on the rope , architecture , simple style tips .
- VERILOG as a way of life
- Good examples (EN)
- How to start working with FPGA (Xilinx)

EVERYTHING!


We are waiting for you interesting projects on the FPGA!



Ps. Appealing to you on “you”, I address, as an equal, person, and not part of the crowd. If the appeal to “you” is offended, please excuse me.

ATTENTION! Verilog and FPGA are not a silver bullet and a magical means of solving any problems; they cannot replace microcontrollers in all projects. To work with FPGA requires a certain level of technical training. You are responsible for all the decisions in your life. The author disclaims responsibility for possible financial and temporary losses associated with your research in the field of FPGAs and Verilog.

Source: https://habr.com/ru/post/274829/


All Articles