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.

Connecting FPGA and a microcontroller

Status
Not open for further replies.

electrobuz

Member level 2
Member level 2
Joined
May 20, 2013
Messages
46
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Visit site
Activity points
1,638
I want to send data from a Spartan 3E FPGA board to an AVR microcontroller. I did some searching and found out about SPI. I have used SPI for connecting two microcontrollers but using it with an FPGA is something new. I am not getting any good resources for this. Can anyone help me on this?
 

If your MCU is the master, then it shouldn't be so difficult to write an SPI slave that can handle the protocol. If you're a bit lazy, look at opencores and you'll find some examples that can help you further.

If your FPGA is the master, proceed with writing an SPI master in the HDL language of choice - again not so difficult to achieve - a bunch of counters, a state machine (maybe 2), some registers, there you are.

And maybe, you can browse through the forum - you'll definitally find some examples
 

You can simple parallel port interfaing if you dont want SPI...
This will be more easier...
 

Thanks for the tip. But just out of curiosity, what will be the fastest way to have the communication?
 

Thanks for the tip. But just out of curiosity, what will be the fastest way to have the communication?

Do you mean SPi vs parallel, or fastest communication method implementable? If it's the latter; in general, the faster you get, the more complex and difficult it will be to implement. I would recommend a beginner start with the simplest (serial/parallel) and work his or her way up from there.

Take a look at this wikipedia list page for some examples of common data rates for different communication protocols.

https://en.wikipedia.org/wiki/List_of_device_bit_rates
 

Yes what i meant was serial vs parallel. It is true that the complications increase with increasing the speed. This was just an inquisitive question.
Thanks
 

If transferring 8 bits, for example, parallel will theoretically be 8X faster as you are transferring all 8 bits at once vs. 1 at a time. It would also be the easier of the 2 to implement. For serial communication, the data normally comes is 8 bit chunks and then sent to a circuit to serialize it. You wouldn't need the "serializer".
 

Parallel will be more faster if you are doing continous data write at highest possible clock rate of microcontroller....
 

If possible you could use LVDS that will give 100s of Mbps datarate. However if just simple data transfer is required than a simple parallel connection or SPI is sufficient. To make things more complex you might look into Qsys Avalon interface as this can prove handy.
 
Parallel interface is only reasonable if you manage to implement an interface that is supported by the microcontroller hardware, otherwise you won't achieve a speed benefit over SPI. In case of an ATmega processor, a XMEM/XRAM interface makes sense. Make the FPGA act as a peripheral device with multiplexed A/D bus and connect directly to the XMEM interface.
 

If your MCU is the master, then it shouldn't be so difficult to write an SPI slave that can handle the protocol. If you're a bit lazy, look at opencores and you'll find some examples that can help you further.

If your FPGA is the master, proceed with writing an SPI master in the HDL language of choice - again not so difficult to achieve - a bunch of counters, a state machine (maybe 2), some registers, there you are.

And maybe, you can browse through the forum - you'll definitally find some examples


BTW.there is no need to write a code of SPI if there are hardblock or soft component present in the spartan.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top