• 0
pooja

uart through FPGA

Question

Posted (edited)

Hi,

I am using Arty 7 to generate clock with different frequency. I wanted to save this data in my PC .since baud rate is 115200 and i am generating clock with 5MHZ ie at Rate of 5mbps. here speed of generation and data transfer are not same,speed of data transfer is much less than generation. please suggest me how can I save the data which i am genereting at same time.should I use ethernet for It?

 

Edited by Ionel
Remove empty lines.

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

It is not clear what you want to transfer over UART (note the Asynchronous  in UART)

Are you running a stand alone application on Arty (07s or 10 both are z7) or a Linux (petalinux) ?

Share this post


Link to post
Share on other sites
  • 0
9 minutes ago, Ionel said:

It is not clear what you want to transfer over UART (note the Asynchronous  in UART)

Are you running a stand alone application on Arty (07s or 10 both are z7) or a Linux (petalinux) ?

Thanks lonel,

I wanted to transfer same data to PC which I generated in fpga .(I am generatting clock through fpga so i want to save binary file in computer which should reperesent the  clock generated by FPGA  .inary 1 for high and 0 for low). I need to keep record of data what i have transfered through FPGA so i want to generate and save parellely.please suggest what is correct approach to do it.

Share this post


Link to post
Share on other sites
  • 0
7 hours ago, pooja said:

please suggest me how can I save the data which i am genereting at same time.should I use ethernet for It?

It's not clear to me exactly what it is that you want to do. What is your data rate and width?

The standard UART is not a synchronous interface. While UARTs between two FGPAs running at 10 Mbaud is feasible, operating a UART between your FPGA and a PC at that rate is non-trivial, if even possible. USB and Ethernet might be better options for high speed data transfer between the Arty A7 and a PC. Neither of these is as easy as using a UART. I supposed that it's possible to split up your data transfer into multiple parallel UART 'lanes' but this wouldn't be trivial either.

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

What is the point on having a file with a sequence of 0 and 1? Why not send the number of times the clock toggled (use a counter)?

Your PC won't be able to handle 5MHZ in realtime because of the scheduler it your OS kernel, unless you have dedicated hardware to react to the time events and do the expected actions in time.

You can generate a sequence of 0 and 1(CLK) at one frequency then say it was generated on a different frequency if you just transfer the sequence  over UART, USB, ETHERNET or other means that can't validate the timings. Timing information is simply lost. However if you make it part of the data that is another story since data can be  consumed at a different frequency than produced.

In short: Arty board has a different clock than your PC but you already knew that.

If the sequence is not just 0 and 1, and each bit is a time event then the data can be processed at any rate, even interrupted. example 0010011 (not really a CLK). In this case ethernet will do.

Edited by Ionel

Share this post


Link to post
Share on other sites
  • 0

Thankyou lonel for your suggestion.

you are correct that there is no point on having a file with a sequence of 0 and 1. I want to save timing information of pulses at rising edges ( If my clock frequency is 5MHZ then data file should have 5 mega data point which should show the timing of rising edge that means at which time it occured.)Now you might have question that if signal is periodic then what is point to save all?but my signal is RNG having 200ns bit duration.so it is importent for me to save each edges because signal is not periodic.please suggest me how can I save timing information of pulses with frequency 5MHZ in real time.

Share this post


Link to post
Share on other sites
  • 0

Thankyou zygot for your suggestion.

you are correct that there is no point on having a file with a sequence of 0 and 1. I want to save timing information of pulses at rising edges ( If my clock frequency is 5MHZ then data file should have 5 mega data point which should show the timing of rising edge that means at which time it occured.)Now you might have question that if signal is periodic then what is point to save all?but my signal is RNG having 200ns bit duration.so it is importent for me to save each edges because signal is not periodic.please suggest me how can I save timing information of pulses with frequency 5MHZ in real time.

Share this post


Link to post
Share on other sites
  • 0
33 minutes ago, pooja said:

my signal is RNG having 200ns bit duration

I'm still not quite grasping what you are trying to do. Am I correct that your are generating a pseudo-random number at a 5 MHz rate and want to capture the values? If so how many bits are your values?

 

37 minutes ago, pooja said:

so it is importent for me to save each edges because signal is not periodic

This tells me that my previous assumption is incorrect, and I have no idea what it is that you are doing.

Let's assume that you have a single bit that will toggle at some variable interval. Let's assume that you create this signal by loading a random n-bit pseudo-random value into a shift register and the signal is either the msb or lsb, depending on which way you are doing shifts. This is something that I can understand. But now I don't understand what it is that you want to measure. 

Perhaps you could try and explain the purpose that your signal is supposed to provide.

Share this post


Link to post
Share on other sites
  • 0

@pooja

You know in advance that the acquisition rate is 5MHz which will give you 5Mbit file of 0 and 1 in a random order for 1 second.
Yet the result will not be periodic and a raising edge can come after lets say 100 bits, where each bit took 200ns to obtain(sample).

In this case buffer the output then send it at what rate you can (the sampling rate is known and is fix). If you want to stream this stuff and recreate the sampling clock at destination, then my or your understanding is not clear of how things work. Or it is not enough information to properly understand what you are trying to do.

Share this post


Link to post
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