Jump to content
  • 0

AD1 Pmod Values and Zedboard


efkean

Question

Hi, 

I want to read analog data from ad1 pmod. For Vivado part, I use digilent pmod ips  to connet fpga. For SDK part, I use AD1.h and AD1.c library in examples. My sensor sends to me analog values between 0-3.3V. (This is a heart rate ECG values). During using arduino, all heart beat data can be read. But I use same function for zedboard, Analog values doesnt look like arduino's. How I can configure and fix this problem? 

As you see ad1-zedboard connection as below.

 

AD1.jpg

Edited by efkean
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi @efkean,

I would recommend taking a look at these two threads on our Forum (link1 link2) that discuss getting the Pmod AD1 running on a Zedboard. What do you mean when you said the analog values don't look like the Arduino's? That the values are different by a few millivolts, completely different voltage readings, different format, or something else?

Thanks,
JColvin

Link to comment
Share on other sites

  • 0

Hi again, 

This  is my ecg sensor. (link1) As you see in picture1 and link1, ECG sensor has built-in chip and it only sends processed analog data as ecg signal. So in arduino example, Analog output of sensor is pluged-in Arduino's analog input port. Then You can easily see the ecg graph in Serial plotter screen. I want to see this graph clearly like arduino's serial plotter. I have vivado-library for digilent pmods ip. in FPFA side, I only use this ready-to-use IPs. In SDK Side, I use PmodAD1 library and their example code. But this code is not working as well as arduino's. I wonder why the processed data is not appear like arduino's. I want zedboard to only visualize the processed data. 

arduino-ecg.PNG

Edited by efkean
Link to comment
Share on other sites

  • 0

Hi @efkean,

Unfortunately (presuming I understand your question correctly), the serial terminals that are typically used with Xilinx SDK (Tera Term or the built-in serial terminal) do not have a plotting feature available, so you will not get the same user experience in this way. You would need to export the data to a different software such as Matlab or Octave. Alternatively, you can find a way to visualize the data through something like Python in a similar way that was done on this project.

Thanks,
JColvin

Link to comment
Share on other sites

  • 0

Hi again @JColvin and sorry for the missing narration. 

I use unity for data visulation. Processed sensor data is sended to Zedboard via PMOD AD1, then zedboard sends to Unity. Before I send data to Unity, I wonder which processed data come to me. So, I use built-in serial terminal on SDK. When I examine on the built-in serial terminal, I think there is an error in the PMOD AD1 library or the sample code. Because, I map the coming data from AD1 to between 0-1024 like arduino's. But Arduino's data is like ECG signal(True one), however AD1 data in serial terminal on SDK is more like a noise signal.

I wonder that is this higlighted values true for ad1 pmod ip? (picture 2) 

picture 2- pmod ad1 ip.PNG

Edited by efkean
Link to comment
Share on other sites

  • 0

Hi @efkean,

Are you taking into account the fact that the Pmod AD1 IP already converts the data into the 0 V to 3.3 V from the 12-bit range of 0 to 1024?

The values you referenced on the Pmod AD1 IP are accurate provided that the AXI clock connected to the IP core is not faster than 100 MHz (as per the Readme on the Pmod AD1 IP core on our GitHub).

If you wanted to just have the 0 to 1024 data, you would need to change the functions used in the main.c file (within the SDK project) to only call AD1_GetSample and not call AD1_RawToPhysical (and adjust the printf functions to use RawData variables rather than PhysicalData values) to get a similar result.

Let me know if you have any questions about this.

Thanks,
JColvin

Link to comment
Share on other sites

  • 0

Hi @JColvin,

I found the problem with a basic test. I use a potantiometer to read voltage from ad1 input data 2. Also I use 100 Mhz clock for PmodAD1 IP and when I change the reference voltage, I can scale the incoming data to the desired range regardless of 12 bits. I know the data comes as 12 bits, but it doesn't matter to me. If we come to the problem, as you can see in video below, the potentiometer value changes from 0 to 3.3V once, while the voltage read by AD1 starts twice. I think digilent example PmodAD1.c file has a error while parsing commen data from spi. I changed this parsing and masking method from (*RawDataPtr)[1] = (data >> 16) & 0xFFF  to  (*RawDataPtr)[1] = (data >> 17) & 0xFFFFFF. All problem corrected.

 

 

Edited by efkean
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...