I had asked a question before about RZ/V2L Evaluation Kit ADC Pin Layout and after researching into embedded linux and understanding the build process and yocto, I managed to get a better understanding of how this board works. Thank you in advance to those replies.
In my previous forum post, one of the replies had mentioned to execute this command:
I was able to retrieve values from this command but one thing I noticed is when I run this command I find that all of the channels are outputting around the same value (~1800 - 1900) even though for most of them there is nothing connected to their respective channels. Then to test if everything was working ok, I connected a basic potentiometer to channel 2 and I was able to see the values go up and down as I turned the sensor, however, the values being returned were showcasing very large jumps in value (e.g., it would go from 4 to 500 to 1800 to 4090 as I turned the potentiometer from low setting to high), there wasn't a steady increase.
Thank you in advance, I'm relatively new to embedded linux and programming with this board so all help is greatly appreciated!
1) I would check the voltage with a multimeter, input range is 0-3.3V.2) Just open and read it as a file, plenty of guides on the web on this.
#define ADC_FILE "/sys/bus/iio/devices…
noclue said:I tried this script too: https://github.com/renesas-rz/rza_linux-4.9_bsp/blob/master/adc_example/adc_example.c.
Just FYI, the idea of that program was to access the ADC registers directly…
Just FYI, the idea of that program was to access the ADC registers directly from an application.
The reason was that some users did not like the standard Linux API interface, so this this was an example of how a user program could just access the ADC registers directly. No device driver is needed. Basically......like what you could do in a bare-metal or RTOS environment..
Since the ADC is very simple, and only a couple registers, making a full "proper Linux Device Driver" might be overkill. Since this is "Embedded Linux"......I suggest just breaking the rules and doing some things more simple.
Hi Chris, thank you for your reply. That makes sense now, I'll try to keep it simple then and build on the code MicBis pasted above. Thank you again for your help!