Slow ADC not working

Applications, development tools, FPGA, C, WEB
Post Reply
gabvif
Posts: 2
Joined: Thu May 28, 2020 4:22 pm

Slow ADC not working

Post by gabvif » Mon Sep 05, 2022 10:52 am

Hi all,

I'm trying to read a voltage on the slow ADC through the extension connector, the setup is exactly as described in https://redpitaya.readthedocs.io/en/lat ... -exm1.html.

I'm using a STEMlab 125-14 with OS v 1.04 build 18 and the standard API.

When I try to read the slow ADC using rp_ApinGetValueRaw(pin, &value); the result is still 0 no matter of which PIN number is selected. I checked using the multimeter that the input voltage on the pin is 1.5 V.

Can someone help me to figure out why?

Thanks!

Alessio

User avatar
redpitaya
Site Admin
Posts: 624
Joined: Wed Mar 26, 2014 7:04 pm

Re: Slow ADC not working

Post by redpitaya » Wed Sep 07, 2022 1:26 pm

Hello gabvif!

The function to get the data from an Analog pin in C code is:

rp_ApinGetValue(pin) => data
(note that there is no Raw at the end of the function)

If you wish to get the raw ADC value, there is currently no such functionality, but you can add a requenst in the Ideas&Features section of the forum.

gabvif
Posts: 2
Joined: Thu May 28, 2020 4:22 pm

Re: Slow ADC not working

Post by gabvif » Tue Sep 20, 2022 3:08 pm

Hi!

I checked the source code of the API library on your git, it seems that the rp_AIpinGetValueRaw exists and is used by rp_AIpinGetValue and using the rp_AIpinGetValue result is still 0; maybe I'm checking/using the wrong version.

Anyway, reading the raw value from the IIO device (as below) works fine and is enough for my application.

FILE *fp = fopen ("/sys/devices/soc0/amba_pl/83c00000.xadc_wiz/iio:device1/in_voltage11_vaux8_raw", "r");
uint32_t value = 0;
fscanf (fp, "%u", &value);
fclose(fp);

Thanks!!

Alessio

User avatar
redpitaya
Site Admin
Posts: 624
Joined: Wed Mar 26, 2014 7:04 pm

Re: Slow ADC not working

Post by redpitaya » Tue Sep 20, 2022 3:32 pm

Thank you for the update.

We will test the function and fix it, if it is broken.

User avatar
redpitaya
Site Admin
Posts: 624
Joined: Wed Mar 26, 2014 7:04 pm

Re: Slow ADC not working

Post by redpitaya » Wed Sep 21, 2022 3:09 pm

Both rp_AIpinGetValue and rp_AIpinGetValueRaw are working as of latest Beta OS (1.04.28) (tested on STEMlab 125-14)

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 4 guests