Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

communicationg with my fpga.

Status
Not open for further replies.

thetrice

Junior Member level 1
Joined
Mar 26, 2013
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,406
ok my fpga is spartan 3a starter kit it comes with :
usb port
Ethernet port
rs232 port
Now my fpga generates an output of binary and i want to rcieve that output on my computer( through a program written with java)
I want the most UN-complicated solution by your experiment with this cases , i think if i want to communicate with a java program I will not have any other solution except through Ethernet and usb.
even if i get an Ethernet or usb library in java and send data to FPGA there is no refrence on where is this data stored to to use it inside fpga or even how to send out data from this ports .....
Just point me in the direction and i will follow it , but Only people who worked with these kinds of things before , I don't want assumptions of people who didnt try this before.
 

I would suggest either of two things:

1) Use RS-232 rather than USB or Ethernet. You can definitely implement USB or Ethernet in an FPGA, but it's a LOT of work.
2) Use an RS-232 to USB/Ethernet converter.

I don't know Java, but I have to believe there are libraries available to to handle serial port communications.
 

Yeah it would be easier to use RS-232 or Ethernet but here are their problems and correct me if i am wrong :
The maximum speed of RS-232 is 9600 bits/sec while i need at least 56MBps so the choice would be ethernet then , but problem with Ethernet is that a packet or 2 can be dropped and still considered normal for Ethernet port and i cant have any error in transmission of this signals, Both of rs-232 and Ethernet interfaces are available to me using MicroBlaze , but for I cant find any info on USB interface which seem my only choice now .
 

RS-232 can run up to 230 K-bit/sec, but that's nowhere near the speed you require.

Ethernet will not "drop packets" in the sense that you are going to lose data. It will retransmit lost data; the Ethernet protocol is designed to handle collisions/ loss of data.
 

while i need at least 56MBps
One thing is to chose an interface standard that is able to transmit data at 56 MBPS (I presume you mean net + sustained rate).
The other thing is to check, if both the FPGA and PC side will achieve the intended throughput. This looks easy for the FPGA side, but it isn't necessarily for standards that involve a protocol overhead like Ethernet or USB. It's far from being easy on the PC side.

IO standards known to achieve the throughput:
- Ethernet with hardware TCP stack on the FPGA side, at best using UDP and Gigabit medium
- HS USB
- PCIe
- PATA/SATA
 

After alot of searching i saw some desginers using LVDS although i still need to know what is it and how to connect it to the pc and make pc detect it ....
 

Well, luckily FvM already gave you a list of likely candidates. From that list the easiest two are either ethernet or USB. Ethernet is doable provided you stick to something simple like UDP packets, static arp, etc. USB is also fairly easy if you use something like a CY7C68013A.

In both cases you will still be coding a bit of verilog/vhdl to get it going. Mostly a big FSM really.

And you're lucky that serial is off the table, because all the java serial libs I have have had the displeasure to work with were ... suboptimal. Networking is actually pretty good, so UDP etc should be no problem. Low level USB I expect to have the potential for pain. There is a java wrapper for libusb though, so that might be okay.

Soooo, on the fpga side I think something like the CY7C68013A is easiest. And on the java side I think networking is easiest. Nice combo! I guess it will depend a bit on your other requirements. Oh yeah, at least ethernet has the bonus of 1) loooong cables and 2) essentially free isolation.
 

the problem is not on the pc side , its on fpga side as there is no source for a ready made ethernet vhdl mac controller , so i will have to use microblaze to interface with ethernet port , but problem is when i program my microblaze on my fpga it deletes my fpga implementation so all i get is a microblaze that can communicate with pc and my implementation is not even on fpga .....
 

See previous post. CY7C68013A on the fpga side, code up an FSM that takes care of filling up the fifo. As for "microblaze deleting your fpga implementation" ... I have no idea what you are on about. Your microblaze should be able to co-exist with your other stuff.
 

See previous post. CY7C68013A on the fpga side, code up an FSM that takes care of filling up the fifo. As for "microblaze deleting your fpga implementation" ... I have no idea what you are on about. Your microblaze should be able to co-exist with your other stuff.
1st The IC CY7C68013A cannot be acessed through the vhdl( correct me if i am wrong) but did u see anyone tries to communicate with it from fpga side ?
2nd Microplaze cant coexist with other vhdl files simply because when you program the fpga you delete it first .(again correct me if i am wrong)
Thanks for your replies btw .
 

mrfibble, FVM and Barry

I think if you can point out example designs where all the communication is also provided, it would help thetrice

Thanks
 

mrfibble, FVM and Barry

I think if you can point out example designs where all the communication is also provided, it would help thetrice

Thanks
I hope thats possible , but i dont think it will happen :(
 

**broken link removed** this site conatins no implementation or a tutorial of usb implementation , its just a discussion, btw i cant use usb on my spartan 3a the CY7C68013A is just used to implement vhdl code to fpga.

Thanks mrflibble for reply (and time spent) but its useless( no insult , as i have passed by these websites myself and many of others)
now with this link :http://tristesse.org/FPGA/DigilentAtlysResources
Again author describes his story in struggling then gives out a verilog example of 36 verilog files with using core generator models and not a single code of help.

I spent 4 days now just researching every website i can find and watching lots of videos , and i came to conclusion that people who know how to use ethernet and usb dont post their effort on the internet , some of them sell it though
even all the topics here in this forum with all this replies are just to understand what the op wants and once the y understand that he is searchinf for ethernet or usb implementation in vhdl , no one replies because nobody knows .
Again thanks for the replies and your effort.
 

Thanks mrflibbldre for your reply but i have went through this sites and here are their problems :
**broken link removed** this website just posts a discussion with no tutorial or vhdl code present , and Spartan3A cant use CY7C68013A , as CY7C68013A is used to implement vhdl into fpga using usb port , although xlinix sdk can communicate with microblaze through usb port with help of jtag.
http://tristesse.org/FPGA/DigilentAtlysResources has a verilog example with nearly 36 files and using core generated modules and with no line of help to how to use this pile of code and its in verilog .
I have spent 5 days straight searching internet for Ethernet working example or tutorial of vhdl implementation but none , whose who know how to do it don't post their effort online , so i think thats it.
 

Just a short comment, CY68013 is in fact a good choice for a high speed USB interface, because all the USB related stuff is done inside the chip, it apperas to the FPGA as a 16-bit wide FIFO with handshake signals. In so far it's quite easy to handle on the FPGA side.

On the other side, the CY68013 needs programming itself. Usually a specific processor code (CY68013 has a built-in x51 processor core) is downloaded by the USB driver to the chip. A software developmen kit is provided by Cypress, but seriously speaking, that's a software project on it's own.

CY68013 is still an interesting option, a number of commercial products that rely on high speed communication is built with a CY6801x/FPGA combination. Cypress has application notes that show the achievable throughput, it's not much below the net HS USB rate.

I did not search the Internet for ready-made solution, but I'm not sure if you'll find it. Needless to say, that the developers of the said commercial products usually designed the software from the scratch rather than copying it from the internet. You can surely get important hints and design ideas, but some work has to be done by yourself.
 
Actually, those links are far from useless for someone looking for a solution in a pro-active way. If you are expecting a solution presented to you on a silver platter ... too bad.

Hint du jour: You are NOT going to find a ready made solution that you can just drop in with zero effort or. You WILL need to learn some things, sometimes even just to be able to integrate what you managed to find on the net.

As FvM pointed out, the CY68013A is a good option. You might even think this is why I mentioned it. ;) You can get pretty good transfer rated on it, definitely enough to meet your requirements.

As for this:
http://tristesse.org/FPGA/DigilentAtlysResources has a verilog example with nearly 36 files and using core generated modules and with no line of help to how to use this pile of code and its in verilog .

Are you kidding me? The code in that .zip right there! I use it myself, and use it to send UDP packets at around 500 MBit/s because that's what I needed. I think the average rate was about 550 Mbit/s. Did this come with commercial quality documentation? Nope. Did I have to modify verilog code to get it to do what I wanted? Yep. But did it save me valuable time and get me started a whole lot quicker? Hell yes!

All the links I send you are in the same vein. I do not expect that you will use those 1:1, but I do think that it can help you jump start getting a solution.

Anyways, how good is your tolerance for java pain? That'll probably dictate the choice between ethernet and usb. I expect java networking for the ethernet choice pretty easy. And I expect low level usb to be potentially painful. So if you feel your java skills are up to it, I would say pick the CY68013A. That solves all sorts of problems on the fpga side. Becaaaaaaaaaause as FvM pointed out, and you will have found out if you read the datasheet, the CY68013A serves as a fifo between USB and FPGA. You simply connect the fifo to your fpga and ready to go!

You indeed need some software on the CY68013, but there's source code floating for that out there as well. How do I know? Well, years ago I downloaded this source code myself, modified it and used it. :p Ergo it's there if you care to look.

Right now I am too lazy to dive into my old code and rummage through notes (can't seem to find the links I am thinking of right now), so I'll just let you practice your google skills for a bit. I'll post the related links whenever I feel like it, don't count on it being today ... I've got a PCB to finish. After all, if this project is important to you then you won't mind searching for some solutions, right? Yes yes you have searched 4 or 5 days. Well, search harder. It's good for you! :) Google skills are the library research skills of this century. :)

Edit: Shame on you for having me go through some of my old stuff. My eeeeeyes, the pain!!!

Anyways, related to the CY68013 ... found what I was looking for. Some quick notes which may or may not help you, depending on specific solution you are looking for and specific value of the proactivity field metric at your location:

http://www.sensicomm.com/main/projects/fpga/digilent_nexys_usb.shtml

apt-get install fxload libusb-dev sdcc-nf sdcc-ucsim-nf

http://www.sensicomm.com/main/projects/fpga/ieee_fpga.shtml#nexys_usb

http://home.myfairpoint.net/vzenxj75/downloads/fpga_usb_090227.tgz

http://sourceforge.net/projects/fx2lib/

http://www.triplespark.net/elec/periph/USB-FX2/software/fx2pipe.html

http://www.triplespark.net/elec/periph/USB-FX2/software/fx2pipe-0.7.tar.gz

That's the info + code tidbits I used to get data going between the PC and an fpga. Also note the CY68013 firmware in there. Works for me on both a spartan-3 and spartan-6 board, though specific fpga is not all that relevant. You will probably need to do some work yourself to get it to do precisely what you want, but it should get you started.
 
Last edited:
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top