Jump to content
  • 0

Zedboard: USB-UART to PL


moreabhinav

Question

9 answers to this question

Recommended Posts

  • 0

Hi @moreabhinav,

 

Welcome to the Digilent Forums!

To clarify, you are wanting to send and receive data between a PC and the Zedboard through the USB UART Bridge. The connector labeled UART ( J14 ). 

The Zedboard has a ZYNQ processor. The USB UART bridge is connected directly to the ZYNQ Processor. Although it is not impossible to use the USB UART Bridge with VHDL/Verilog it is not a trivial task.

I would suggest using the ZYNQ Processor to accomplish your task. The following steps will help you get a basic project using the USB UART bridge:

1) Make sure you have installed the Digilent board files. 

2) create a project and then a block design.

3) Add the Zynq processor to the block design.

4) Run block automation using the default settings which will be the board files

5) Tie the FCLK_CLK0 pin to the M_AXI_GP0-ACLK pin

6) right click on the block design in the sources tab and create a wrapper.

7) generate a bit stream, export the hardware including the bit stream and launch SDK

8). once in SDK create and application and select the hello world template. 

9) Program the FPGA and right click on the application and run as -> launch on hardware(system debugger)

Here is a slightly different tutorial that has the USB-UART bridge being used. 

best regards,

Jon 

 

ZYNQ.jpg

Link to comment
Share on other sites

  • 0

Hi @moreabhinav,

As described above in the diagram the PS is directly tied to  the USB UART.  Its my understanding that to use HDL(Verilog/VHDL) to send data through the USB UART  on a ZYNQ chip you would need to facilitate communication and the command protocols to and from the ARM processor. You would still be using the PS to send and receive date through the USB UART.  

Can you be more specific about your project needs? 

best regards,

Jon

 

 

Link to comment
Share on other sites

  • 0

@moreabhinav

I'm not sure that I understand your requirements either. As Jon mentioned the UART USB connector is tied to the PS. You can route PL pins to PS resources but your software will use the PS resources. For example you can connect PL pins to the unused uart resource in the PS and it will be used just like the one attached to the UART USB connector on the board. The SDK will even create a driver for it. Also, what you have then are 2 logic pins for Tx and Rx. You can use these internally in the PL with designs of your creation or externally but with additional hardware. If you want to connect this uart to a PC then assign the signals to a PMOD and attach those pins to a TTL  USB UART cable or module that you buy separately. Adafruit and SparkFun both offer inexpensive versions. This approach would allow you to connect a PC to both uarts in the PS, both controlled by the ARM cores. The Zedboard PS has 2 Ethernet controllers and the same concept can be used to provide a second Ethernet port to the PS. In this case you will need to supply your own PHY using the FMC connector. What you can't do is mux the PS pins into the PL to, say create your own MAC-less (or custom MAC of your own design) Ethernet interface using the Ethernet RJ-45 connector already on the board.

It is certainly possible to use 2 PL pins connected to an HDL uart instantiated in the PL logic resources and send/receive data between it and the PS. In this case you will have to write your own drivers as the SDK doesn't have code to handle this. You will have to understand AXI bus interconnect IP.

Don't think of the Zynq as an FPGA with an embedded ARM core. Think of it as a big ARM uController with more resources than MIO pins but with a mux to allow routing signals to the PS to use resources that the board designers aren't using. The issue then becomes if the board designers offer IO connectors and routing that support doing that.

Let's say that you have logic in your PL to count pulses on PMOD pins and you need to reset the counts from the PS; you want to do this using the USB UART connector that comes with the board. You can certainly connect the output of your logic design to the PS through the AXI bus resources, directly as GPIO, or indirectly through BRAM or FIFOs. Perhaps this is closer to an answer to your question. If it is then you have some reading to do... There are tutorials about how to create custom IP and connect it to the PS... but I don't have links to them on hand.

Edited by zygot
Link to comment
Share on other sites

  • 0

Hi @jpeyron, @zygot

Specification about my project :

I am to implement a scrambler on the zedboard, to which I have to give 256 bit input and get back the same number of bits. I wish to use the connector labeled UART (J14) to send and receive the bits. I already wrote the code for the scrambler and verified it's result by simulation. All I need to do now is to implement the same on ZedBoard. 

Link to comment
Share on other sites

  • 0
7 hours ago, moreabhinav said:

implement a scrambler on the zedboard

I assume that you mean that you implemented a scrambler in the PL.

If this is the case you need to add some IP provided by Vivado to allow the PS to pass data between the PS and the PL The PS will communicate with the PC uart using software and the PL logic will handle the communication between the PS and the PL using the interconnect There are a number of ways to do this. If you look in the IP Catalog you will see a variety of AXI and AXI-lite possibilities to allow your ARMs to pass data to and from the PL and your logic. You can't bypass the PS uart resource connected to the connector and send the signals to the PL directly. The easiest approach would be to use something like the AXI_GPIO IP, though you won't be connecting the signals to pins ( just logic )  The IP Catalog doesn't  make finding all of the IP easy so keep expanding all of the categories until you find it. Once you export your hardware design to the SDK it will write a driver for you though you will still have to do some software development to create a complete application. There are a number of tutorials showing how to do this.

So the steps are:

  •  add the AXI peripheral interconnect IP of your choice to the board design schematic and generate the design
  •  build a new bitstream configuration file
  • export the design to the SDK
  • create an application that gets data from the uart and sends it to your PL scrambler then reads the output and sends the result back to the uart.

You will have to figure out a few details to make it all work but the tutorials should help with the basic concepts and using the tools. [edit] So I just realized that the previous steps are not quite right for you. I would have Vivado create an HDL to encompass the board design and then instantiate that into a toplevel design of my own that instantiates the scrambler. I think that what you are supposed to do is create your own scramble IP that you will integrate directly into the board design ( not use a standard AXI interface as I mentioned..) This is a bit more complicated than how I'd do it but there are tutorials on how to create and add IP to your own IP catalog.

To anyone else reading this thread for help in a similar project. This is a good example of why the Zynq isn't the best platform for all FPGA projects. You can do this project with a CMOD-A7 without the hassle and complexity of the board design and SDK. If this were a product the Zynq device would be too costly to be viable in the marketplace. As a project that makes you learn how to do the basic Zynq development flow it's a pretty good project. [edit] Personally, I find the whole IP creation thing to usually be too much trouble for the benefit, though I could see where I might want to do this. Sometimes it's good to learn how to do things that you never have to do...

Edited by zygot
Link to comment
Share on other sites

  • 0

This is two years later, but incase anyone else attempts to do what moreabhinav was trying to achieve but was disappointed to find the UART ties to PS instead of PL, then try the USBUART PMOD. https://digilent.com/reference/pmod/pmodusbuart/start?redirect=1

I don't understand how there could be any uncertainty about what the initial poster was trying to accomplish, it was clear.

-Lexis

Link to comment
Share on other sites

  • 0
6 hours ago, Lexis Mazerski said:

I don't understand how there could be any uncertainty about what the initial poster was trying to accomplish, it was clear.

You mean this: "I wish to use the connector labeled UART (J14) to send and receive the bits." ? ( on my Zedboard the connector labeled UART is J13 ) Since this UART is connected to the PS through the MIO pins it implies that that the design requires a separate PS/PL connection.

But you are correct that you can certainly create a ZYNQ PL design that the PS has no knowledge of; just implement a UART in your HDL and connect the TxD/RxD pins to a PMOD connector, and those to a USB UART Bridge device. I much prefer using a USB TTL UART cable or breakout board but the solution that you mention will work as well. Of course, this means purchasing additional hardware.

Were this question posted more recently, I'd probably point them to this: https://forum.digilentinc.com/topic/22512-manipulate-pl-logic-using-ps-registers/

No additional expense required.

I don't share your certainty about what the initial poster was looking for, but I do believe that suitable answers were provided, though perhaps not directly. Since there were no follow-up posts it's reasonable to assume that the original poster figured out his solution based on the responses. Rarely are questions posted to this forum as clear as some readers might assume. Sometimes it takes a conversation to resolve questions satisfactorily.

Edited by zygot
Link to comment
Share on other sites

  • 0

Warning!!! Purely Editorial Post in Progress!!

It's hard to read a post like the one above by Lexis without inferring a tone of indignation that he, not the original poster, has been failed by inattentive people providing useless answers to simple questions. Sometimes, while reading stuff posted to threads about technical questions I have a recurring daydream about starting a non-profit to aid the plight of the poor schlubs who have the audacity to post answers to such questions. If you are in the western world ( and who isn't, depending on where you sit? ) you've seen the ads begging for donations to save the whales, save the children, save the puppies... etc etc. I have to admit that when I see these ads by billion dollar organizations carefully orchestrated to communicate directly to the primitive brain, bypassing the conscience brain, I tend to wonder who it is exactly that is being abused.... and poof, the daydream is over.

Anyway, my point is that what's obvious to one person isn't so obvious to another person. We all know the danger of offering unsolicited advice, but occasionally trying to help when help is specifically requested results in responses that are discouraging, to say the least. Don't pity the idiots posting answers to questions, but do try and comprehend the complexity of trying to communicate ideas.

The whole post a question, get an answer becomes a bit warped when the question is more about completing a homework assignment than discussing technical hurdles.

BTW Do donate time and money to worthy causes... just do your homework to make sure that a significant portion of your contribution is actually being used for what you expect it to be...

Edited by zygot
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...