cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dimpy
Adventurer
Adventurer
510 Views
Registered: ‎06-05-2020

how to configure SPI in Zynq 7000 when you need to connect with atmega128?

Hello,

I need to connect Zynq 7000 (ZC-706) fpga board to microcontroller (ATmega128) using SPI.

How i configure SPI from ZYnq 7000 ? Should i need to write verilog code for SPI of zynq 7000? Or is there any other way?

Please reply as soon as possible.

Thank you.

 

Tags (3)
0 Kudos
11 Replies
dimpy
Adventurer
Adventurer
405 Views
Registered: ‎06-05-2020

Hello @sabankocal 

Can you please guide me?

Thank you.

0 Kudos
sabankocal
Voyager
Voyager
393 Views
Registered: ‎08-02-2019

Hi @dimpy ,

If you have also Petalinux and your design is proper to control these SPI mechanism then you dont need to write any code. Instead you need to follow only this link.
(Tutorial24 has also different approach, you can look also that to understand this topic deeply.)

For example I have another Spartan FPGA and of course there is no Petalinux... That is why I m using there ready to use verilog codes to control SPI device.
If you have a this kind of scenario then I can strongly recommend to look this video and use that source codes.

Saban

 

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->
0 Kudos
u4223374
Advisor
Advisor
376 Views
Registered: ‎04-26-2015

@dimpy What voltage is the ATMega running at? While they'll run at 3.3V, every time I've seen one used they've been at 5V (mostly because if you were going to run it at 3.3V, you'd use a cheaper, faster, and all-round better ARM chip).

 

If it is at 5V, then you need extra hardware too. A 5V SPI output from the ATMega will damage the Zynq.

0 Kudos
sabankocal
Voyager
Voyager
371 Views
Registered: ‎08-02-2019

Hi @dimpy ,

@u4223374 is right. 5V is dangerous for ZYNQ devices. If you wanto to learn about how to connect 5V to ZYNQ device, you can follow this link.
Or as @u4223374 mentioned, you can choose an other pair to ZYNQ as max. 3.3V.

Saban

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->
0 Kudos
dimpy
Adventurer
Adventurer
289 Views
Registered: ‎06-05-2020

Hello @sabankocal  @u4223374 

Thank you for your reply.

Atmega is running at 3.3V. So is it okay to operating Zynq device at 3.3 V?

@sabankocal as you said about petalinux i don't have petalinux so i have write one VHDL source code for SPI and create the ip for same. And make the block diagram. Please find the below attached block diagram for same.

1) Please let me know Block diagram is correct or not?

2) Should i need to add constraints for same?

3) How should i create physical connection for SPI between ATmega128 and ZC-706?

Kindly reply as soon as possible.

Thank you.

dimpy_0-1617684162583.png

 

0 Kudos
venui
Moderator
Moderator
285 Views
Registered: ‎04-09-2019

Hi @dimpy 

ZC706 have PMOD pins which are routed from PL you can use those pins from PS SPI or using AXI-QUAD SPI IP you can connect to Atmega.

Please find the reference for the same in the below diagram for PMOD pins available on ZC706.

venui_0-1617684804415.png

Regards,

Venu

 

0 Kudos
dimpy
Adventurer
Adventurer
268 Views
Registered: ‎06-05-2020

Hello @venui 

Thank you for your reply.

If i want to use PMOD pins from PS SPI should i need to write constraint for it or is there any other way? 

I am new to this, please explain me or give an example.

Thank you.

0 Kudos
venui
Moderator
Moderator
267 Views
Registered: ‎04-09-2019

Hi @dimpy ,

You have to route PS SPI through EMIO once the synthesis is done, you will get "constraint Wizard" where you can assign PMOD pins so that it will add pin assignments for the PS SPI IP.

Regards,
Venu

0 Kudos
dimpy
Adventurer
Adventurer
189 Views
Registered: ‎06-05-2020

Hi @venui 

I have done this and now i am able to route the SPI pins on PMOD header.

I have one another question I have generated the bitstream of my design and export it to hardware and launch the SDK.

What steps i need to follow for using SPI driver? Here FPGA is slave device so i want to use SPI slave.

Please guide me.

Thank you.

0 Kudos
dimpy
Adventurer
Adventurer
175 Views
Registered: ‎06-05-2020

Hello @venui  @sabankocal  @u4223374 

Please reply as soon as possible.

Thank you.

0 Kudos
venui
Moderator
Moderator
127 Views
Registered: ‎04-09-2019

0 Kudos