Jump to content
  • 0

PMOD AD1 with Zedboard, streaming issue


falcon98

Question

Hi,

I want to develop a acquisition and streaming system using Zedboard with AD1. Since AD1 supports 2 channel , 1MSPS rate I want to use it for fast signals.

I used the sample project for interfacing AD1 with Zedboard. 

I am using following simple code in SDK:

while (1)
{
 for (i=0; i<128; i++)
        {
    
        data=ADC1_IP_mReadReg(XPAR_ADC1_IP_S_AXI_BASEADDR, 0);

        xil_printf("%d\r\n", data);
        }
}

 

The issue I am facing is that when I am changing the signal at Function Generator, the ADC signal from UART keeps on with previous signal. I am using LabVIEW for stream and monitoring the signal from serial terminal but I am not able to see the signal change when I change the Function Generator output.

 

Is there some kind of buffer for UART which keeps repeating the signal. 

Let me know if I should test it in some other way.

Also 

 

I wanted to calculate the maximum sampling rate I can achieve with the UART. The ADC (PMOD AD!) is 12 bits so maximum count is 4 digits (upto 4095). Each digit will occupy a character for UART.

UART bit rate: 115200 bps

UART Character rate : 11520 char/sec ( 10 bit for 1 char)

No of chars for each sample : 4 char/sample

Maximum sampling rate: 11520/4 = 2880 samples/s= 2.8KSps

Is my calculation correct? I wanted to find if UART acts as a bottleneck for high speed ADC transfer.

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

In my experience 921600 is a baud rate that can be used without flow control and handled by simple PC applications without dropping data. So, ~90K bytes/s is a fair target to shoot for if you want to transfer data. Streaming data is a different animal than transferring small blocks of data.

You are allocating 4 chars/sample. That's 40 baud periods of UART data per 12 bits of sample data; not the direction that you want to go. Of course, if you want to translate your 12-bit sample data into only 16 7-bit ascii chars then that's the cost of doing business. Perhaps you can think of a way to make this part of your analysis more efficient.

My view is that you've started out with a poor selections of specifications. Perhaps this is OK for a 'back of the envelope' estimate of what you can expect given your early choices:

  1. Zedboard
  2. PS UART
  3. AD1 PMOD

I'd start off with a different set of specifications:

  • what do you want to do with your 'high speed' data acquisition design?
  • what's the bandwidth of interest
  • what's the maximum number of contiguous samples that you need?
  • what kind of data acquisition do you want? This is, are you collecting a lot of samples for post-processing, or can your design do the processing on the fly and reduce the final data rate considerably?

Those are but a few of the specifications to start with. My point is that trying to develop a design that accommodates a large variety of un-planned for uses is harder than designing a more concise but limited application that you can specify completely.

There are a lot of options for the Zedboard, especially if you are using PMODs as ADC inputs. For instance you can add a USB 3.0 development board to the FMC connector and have more than enough bandwidth to handle 2 channels ( or more ) of 1 M/s 12-bit data streamed to a PC. Ethernet is another option.

I'm just suggesting that you re-think your current strategy.

Link to comment
Share on other sites

7 hours ago, falcon98 said:

I wanted to find if UART acts as a bottleneck for high speed ADC transfer.

The math to answer that isn't very complicated. 2 x 1 M/s = 2 M/s. Any UART bard rate < 20 Mbaud/s is a bottleneck. But that's just assuming a data channel that can operate uninterrupted and without any baud periods between UART words.

Link to comment
Share on other sites

22 hours ago, zygot said:

In my experience 921600 is a baud rate that can be used without flow control and handled by simple PC applications without dropping data. So, ~90K bytes/s is a fair target to shoot for if you want to transfer data. Streaming data is a different animal than transferring small blocks of data.

You are allocating 4 chars/sample. That's 40 baud periods of UART data per 12 bits of sample data; not the direction that you want to go. Of course, if you want to translate your 12-bit sample data into only 16 7-bit ascii chars then that's the cost of doing business. Perhaps you can think of a way to make this part of your analysis more efficient.

My view is that you've started out with a poor selections of specifications. Perhaps this is OK for a 'back of the envelope' estimate of what you can expect given your early choices:

  1. Zedboard
  2. PS UART
  3. AD1 PMOD

I'd start off with a different set of specifications:

  • what do you want to do with your 'high speed' data acquisition design?
  • what's the bandwidth of interest
  • what's the maximum number of contiguous samples that you need?
  • what kind of data acquisition do you want? This is, are you collecting a lot of samples for post-processing, or can your design do the processing on the fly and reduce the final data rate considerably?

Those are but a few of the specifications to start with. My point is that trying to develop a design that accommodates a large variety of un-planned for uses is harder than designing a more concise but limited application that you can specify completely.

There are a lot of options for the Zedboard, especially if you are using PMODs as ADC inputs. For instance you can add a USB 3.0 development board to the FMC connector and have more than enough bandwidth to handle 2 channels ( or more ) of 1 M/s 12-bit data streamed to a PC. Ethernet is another option.

I'm just suggesting that you re-think your current strategy.

Thanks for your detailed answer.  My feq queries are:

1) Can we have 921600 baud rate for PS. How can I use PL UART. I think PL UART can support higher baud rates. PS UART baud rate is upto 115200 only. pls correct me if I am wrong.

2) THe ADC counts is of 4 digits so 4 char/sample. I am unable to get proper reconstruction above 200 Hz signal, so I guess overall sampling is 2.7kSps.

3) I aim to develop a data acquisition system with PMOD ADC with UART/Ethernet interface.

I understand that UART is not a good choice for streaming, I just used it as initial point.

 

Link to comment
Share on other sites

20 hours ago, zygot said:

But, thanks. You've given me a great idea for a Project Vault side project that might be of interest to a lot of Digilent customers. I have a feeling that I won't be able to get it out of my head until I implement it.

I hope to get some reference project on this. I have initiated it for learning ZYnq fundamentals.

Link to comment
Share on other sites

1 hour ago, falcon98 said:

Can we have 921600 baud rate for PS. How can I use PL UART. I think PL UART can support higher baud rates. PS UART baud rate is upto 115200 only. pls correct me if I am wrong.

You can set the default PS UART clock and baud rate in the ZYNQ Processor Subsystem block. The ZYNQ on the Zedboard can definately do 921600. Be aware that the Vivoado SDK only supports up to 115200 baud. I've recently posted a project in the Project Vault using the PS UART at 921600 and have seen no issues with that rate. The ZYNQ device on the project board is the same one in the Zedboard. Even with a rather small 32 byte UART FIFO one ARM core can process 921600 baud data on the fly.

1 hour ago, falcon98 said:

THe ADC counts is of 4 digits so 4 char/sample. I am unable to get proper reconstruction above 200 Hz signal, so I guess overall sampling is 2.7kSps.

You aren't going to take 2 parallel 12-bit channels of 1 Msample/s ADC data and serialize them over a typical UART mapped into 16 ascii characters. You can do better than 2.7 KSamples/s.

1 hour ago, falcon98 said:

I aim to develop a data acquisition system with PMOD ADC with UART/Ethernet interface.

The 1 GbE port on the Zedboard is better suited for your choice of ADC data source. It's also a great deal more complicated; even with the SDK support. How are you going to handle Ethernet on the other end of the cable?

 

Link to comment
Share on other sites

2 hours ago, falcon98 said:

I hope to get some reference project on this. I have initiated it for learning ZYnq fundamentals.

The Zedboard was developed by a consortium of companies and there are web sites dedicated to it and variations of that board. So there's more information available for the Zedboard than the typical FPGA board. The Zedboard is getting old but is still a very nifty board to work with and use.

You can stream your 2 channels of ADC data into the PS DDR and then transfer it to a PC over Etherent or a UART, but at a much slower data rate. There's almost always a way to get around obstacles and complete a project if you are willing to give up one or more hoped for performance specifications. 

Link to comment
Share on other sites

@zygot can you pls share the link of project where you have configured PS UART at 921kbps transmission?

thanks

How can i read the second ADC data from PMOD AD1 . I am reading the first by:

        data=ADC1_IP_mReadReg(XPAR_ADC1_IP_S_AXI_BASEADDR, 0);
But I am unable to find reference to read the second channel.

Link to comment
Share on other sites

45 minutes ago, falcon98 said:

can you pls share the link of project where you have configured PS UART at 921kbps transmission?

Here is one project where the main PS UART is set to 921600 baud as I described above to this post. I don't think that it will help you much, except to prove that it's possible even with the 7020 ZYNQ. The Eclypse-Z7 uses the same device as the Zedboard. As I mention in the project notes the SDK IDE doesn't support that rate for the console connection. Why? Who knows?

I don't use the AD1 PMOD nor the typical board design flow for ZYNQ so I don't have an answer about reading the 2nd channel as an AXI peripheral.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...