+ Post New Thread
Results 1 to 12 of 12
  1. #1
    Member level 4
    Points: 1,414, Level: 8

    Join Date
    Dec 2011
    Posts
    77
    Helped
    0 / 0
    Points
    1,414
    Level
    8

    send/receive data to/from fpga device

    I want to feed some numbers to my vhdl code, save them in an array, process them, send them to the output array and then sends them to the output device. There are several methods to read and write the data. For example, for input I can use a file on SD card or ethernet connection. For the output I can use the SD card, or monitor or the ethernet connection.

    Which one is more handy to use? Any feedback is appreciated.

    •   Alt16th June 2017, 09:24

      advertising

        
       

  2. #2
    Advanced Member level 5
    Points: 35,066, Level: 45
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,423
    Helped
    1871 / 1871
    Points
    35,066
    Level
    45

    Re: send/receive data to/from fpga device

    Ethernet means you can run data hooked up to a PC. With SD card, you're limited to what you programmed to the SD card.



  3. #3
    Super Moderator
    Points: 53,016, Level: 56
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    10,674
    Helped
    2530 / 2530
    Points
    53,016
    Level
    56

    Re: send/receive data to/from fpga device

    Hi,

    You give only vague informations:
    Like: I want to travel, I have some things to carry, I start at some place and I want to reach some place. What transport medium should I choose?

    No one knows from your description:
    * what possible interface your FPGA device offers
    * what is the other end (microcontroller, PC...)
    * what ammount of data in which time you have to transfer
    * what is the transport medium and what distance (it could be on a single PCB, it could be wireless, it could be over the internet)

    Klaus



    •   Alt16th June 2017, 09:48

      advertising

        
       

  4. #4
    Member level 4
    Points: 1,414, Level: 8

    Join Date
    Dec 2011
    Posts
    77
    Helped
    0 / 0
    Points
    1,414
    Level
    8

    Re: send/receive data to/from fpga device

    So, there is a de0 cyclone III board with SD and a spartan board (custom created board) with SD and ethernet connection.
    I want to create a text file on the SD and write some numbers. Then I want to read the numbers, send them one by one to the fpga and store them in an array. After the process, I want to revert the path and get the final result.
    I see the DE0 manual has a demonstration code for SD card. I have to use the NIOS to access the SD card content. The tutorial has multiple files and folders in it and I don't know which one to run. A very basic example which I am trying to do is

    1- Save a file named example.txt on the SD card
    2- Write 0 in example.txt
    3- insert the SD in the board
    4- Load the file and read the number (here it is bit)
    5- Invert the number with a VHDL code
    6- Send the inverted number to the output
    7- Write the result to result.txt on SD card
    8- Unplug the SD from the board
    9- Insert the SD to my laptop and view result.txt



  5. #5
    Super Moderator
    Points: 237,321, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    41,068
    Helped
    12542 / 12542
    Points
    237,321
    Level
    100

    Re: send/receive data to/from fpga device

    Yes, both ethernet and SD card handling (TCP stack respectively file system) are usually implemented through software processor. If you don't want the considerable overhead for an essentially simple application, it may be easier to use a serial interface through RX and TX UART written in HDL.



    •   Alt16th June 2017, 10:43

      advertising

        
       

  6. #6
    Member level 4
    Points: 1,414, Level: 8

    Join Date
    Dec 2011
    Posts
    77
    Helped
    0 / 0
    Points
    1,414
    Level
    8

    Re: send/receive data to/from fpga device

    Actually I am trying to understand SD or ethernet for larger applications.
    Still my question is unanswered.



  7. #7
    Super Moderator
    Points: 237,321, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    41,068
    Helped
    12542 / 12542
    Points
    237,321
    Level
    100

    Re: send/receive data to/from fpga device

    Still my question is unanswered.
    It's answered in post #2, I believe. What's still unclear?

    If your question is related to DE0 demonstration software, there's a description in the user manual how to run it.



  8. #8
    Advanced Member level 5
    Points: 35,066, Level: 45
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,423
    Helped
    1871 / 1871
    Points
    35,066
    Level
    45

    Re: send/receive data to/from fpga device

    You question has been answered - they both work in different ways and have different applications.
    Without details from you, we cannot really give better answers.



  9. #9
    Member level 4
    Points: 1,414, Level: 8

    Join Date
    Dec 2011
    Posts
    77
    Helped
    0 / 0
    Points
    1,414
    Level
    8

    Re: send/receive data to/from fpga device

    Apart from the limitation of SD or ethernet, I want to know which one is better for a starter? I am reading the manual and will ask questions whenever I stuck!

    Regarding the problem description, I just want to elaborate the features on the DE0 board. For example, how to send/receive data to/from fpga. Simple tutorial should be sending 1 (either through ehternet/serial/sd), then flip it with VHDL code, and then receive the result as I said before.



    •   Alt16th June 2017, 16:38

      advertising

        
       

  10. #10
    Advanced Member level 5
    Points: 35,066, Level: 45
    Achievements:
    7 years registered

    Join Date
    Jun 2010
    Posts
    6,423
    Helped
    1871 / 1871
    Points
    35,066
    Level
    45

    Re: send/receive data to/from fpga device

    Quote Originally Posted by mahmood.n View Post
    Apart from the limitation of SD or ethernet, I want to know which one is better for a starter? I am reading the manual and will ask questions whenever I stuck!

    Regarding the problem description, I just want to elaborate the features on the DE0 board. For example, how to send/receive data to/from fpga. Simple tutorial should be sending 1 (either through ehternet/serial/sd), then flip it with VHDL code, and then receive the result as I said before.
    As a starter - do neither, as they will both required a CPU to get it working (well, you can do ethernet without a CPU - its just not that easy)

    Best thing is to go for something like RS232, which is pretty straight forward in an FPGA without a CPU and there are many examples out there on the internet.



  11. #11
    Super Moderator
    Points: 27,821, Level: 40
    ads-ee's Avatar
    Join Date
    Sep 2013
    Location
    USA
    Posts
    6,355
    Helped
    1540 / 1540
    Points
    27,821
    Level
    40

    Re: send/receive data to/from fpga device

    Quote Originally Posted by TrickyDicky View Post
    As a starter - do neither, as they will both required a CPU to get it working (well, you can do ethernet without a CPU - its just not that easy)
    I'll vouch for that, I wouldn't want to do anything much beyond UDP Ethernet as it's probably one of the most simple protocols and doesn't require any re-transmit capability.

    Best thing is to go for something like RS232, which is pretty straight forward in an FPGA without a CPU and there are many examples out there on the internet.
    I agree completely, as you are a novice at FPGAs you shouldn't be delving into using CPUs and complicated IP cores to implement something on an FPGA. Start of with a simple RS232 and other simple serial protocols before jumping into stuff like Ethernet.



  12. #12
    Super Moderator
    Points: 237,321, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    41,068
    Helped
    12542 / 12542
    Points
    237,321
    Level
    100

    Re: send/receive data to/from fpga device

    Even UDP involves some overhead like address resolution protocol to identify the peers MAC address. I'm also not aware of ready-to-use IP for hardware UDP or TCP besides some commercial libraries. Setting it up from the scratch is far beyond the reach of a beginners project.



--[[ ]]--