FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
6189 Discussions

DE2_UDP example for download here free (feedbacks are wellcomed)

Altera_Forum
Honored Contributor II
6,928 Views

Hi all. 

My goal is to get about 3Mbytes/sec data transfer rate from my DE2 board to PC. 

Here in this example I get about 1.2 Mbytes/sec.  

I'll accept comments about, how to speed up this, as well as suggests to improve the code, and some feedback from people that have interest in this theme. Could be in this thread or private. 

You can download the full project from: 

http://www.btxsistemas.com.ar/net2.zip 

 

I've used Quartus II 7.2 full suite. And the Wireshark software (http://www.wireshark.org/) like a net sniffer, but also, I've included in the main project folder, a UDP reciever to test the comunication between the DE2 board and the PC, if you wont to download the wireshark. 

Don't forget to specify your IP address and your MAC address in the NIOS hello_word "C" code to get it work properly. 

The main project is a modification of the DE2_NET demostration code that comes with the DE2 board. 

 

Have fun, and I'll be waiting for some comments.
0 Kudos
94 Replies
Altera_Forum
Honored Contributor II
1,709 Views

That's all I need to test it. 

Thank you very much
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

You're wellcome, I hope that code was usefull for you & somebody more. 

I test it again with my new PC net card, and I get 5.9 Mbytes/sec. !! 

Which is too much that I expected. 

I'll try to send something more usefull too, when I've some free time, maybe video.
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Hello, I would like to know how to receive packages or information from the PC to the FPGA using Ethernet? You have the code for this task? 

Thank you.
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Hi. That is my next task man. 

But still I get no time free to play with that. 

Once I get it, I'll post again, maybe too, I will ask some about that, I was trying a little bit after finished the send process, but I had some problems and I did leave it.
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Look at any of the examples that provide a web server and the example code available with AN 429, available on Altera's AN Literature page (http://www.altera.com/literature/lit-an.jsp). The code for AN429 implements a subset of what a full tftp server would provide in order to perform remote configuration and it is pretty simple to understand. 

 

These won't work out of the box on the DE2, but they should get you 90+% of the way there. 

 

Good luck! 

 

- Ura
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Oh !! Thanks a lot Ura. 

I downloaded it yet, I'll advise when I've notices.
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Thanks Ura!

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Already tried to add this code in the last lines? 

if (ior(0xFE)&0x01) 

iow (0xFE,0x01); 

ethernet_interrupts(); 

else 

usleep(10);  

return 0; 

 

for receive!
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

If I don't remember bad, the recieve part code was commented in my original code, but if not, you can take it from the DE2_NET example. Then you need to understand it, and try to get work it fine. I did it but I had some problems.

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Dear BTXSistemas, Thanks alot for this project, but I don't know how to specify MAC and IP adress,also how using "wireshark", please help me,Thank you

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Hi. 

You can specify a MAC address and a IP simply, write them in the correct place of the code....do you take a look at it ?? 

Wireshark is a net sniffer...just download it, and read the help file, it is very easy to understand. 

Cheers  

Alberto.
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

I know that I can write the MAc an IP Adress, but how can I find them in my PC? also IP adress for DE2 is always the same?

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Hi. 

You have in the NIOS code: 

IPsource_1 = 0xC0; // Assign ie: 192.168.0.44 IP for the DE2 IPsource_2 = 0xA8; IPsource_3 = 0x00; IPsource_4 = 0x2C; IPdestination_1 = 0xxx; // Insert your IP data here IPdestination_2 = 0xxx; IPdestination_3 = 0xxx; IPdestination_4 = 0xxx; Mac_dest1 = 0xxx; // Insert your MAC address data here Mac_dest2 = 0xxx; Mac_dest3 = 0xxx; Mac_dest4 = 0xxx; Mac_dest5 = 0xxx; Mac_dest6 = 0xxx; Mac_source1 = 0x01; // Assign an MAC address for DE2 Mac_source2 = 0x60; Mac_source3 = 0x6E; Mac_source4 = 0x11; Mac_source5 = 0x02; Mac_source6 = 0x0F; Well, look for in your OS "net conections" (If it's XP) and see the details for the active one. 

You'll be find there your machine IP and your MAC address, write them in IPdestination and Mac_dest respectively. No more to do. 

The NIOS code has asigned an IP for your DE2 and a Mac too, you can change it if you want for another, So your DE2 will have for ever you run that code the same IP and MAC, change the IPdest and Macdest if you run the code in another computer.....or READ some more about net connections. 

Cheers. 

Alberto.
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Thanks a lot, I've got it.

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Dear BTXSistemas , The program is full work, but I wonder if you use MATLAB to receive data, because i've tried, but I can't get the data.

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Hi everybody! Can you send NET2.zip for me? my mail "phungthanhtu010708@yahoo.com". Thank you very much. I'm beginer.

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

Hello! 

Thanks for a project, but an archive seems to be broken. Could you repack it and upload somewhere else? I'd be very grateful.
0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

I just tested the archive and it is fine.

0 Kudos
Altera_Forum
Honored Contributor II
1,709 Views

 

--- Quote Start ---  

I just tested the archive and it is fine. 

--- Quote End ---  

 

 

Yep. WinRar turned down to unpack that files, but 7zip. Thnx for help.
0 Kudos
Altera_Forum
Honored Contributor II
1,611 Views

The file was compressed using Winzip, I've tested it, and it is fine.

0 Kudos
Reply