Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 149095

Forum Post: Analog read from all 7 inputs using PRU and a host C program for beaglebone black

$
0
0

Hello all, I'm kinda new to the beaglebone black world running on a AM335X Cortex A8 processor and I would like to use the PRU for fast analog read with the maximum sampling rate possible.

I would like to read all 7 inputs in a loop form like:

while( n*7 < sampling_rate){ //initial value for n = 0     read(AIN0); //and store it in shared memory(7*n + 0)     read(AIN1); //and store it in shared memory(7*n + 1)     read(AIN2); //and store it in shared memory(7*n + 2)     read(AIN3); //and store it in shared memory(7*n + 3)     read(AIN4); //and store it in shared memory(7*n + 4)     read(AIN5); //and store it in shared memory(7*n + 5)     read(AIN6); //and store it in shared memory(7*n + 6)     n++; }

so that I can read them from a host program running on the main processor. Any idea how to do so? I tried using a ready code called ADCCollector.c but I can't figure out how to get all the addresses and values of the registers used.

Attached is the code I was trying.

Another question is: if I simply changed the #define Samplig_rate from 16000 to any other number below or equal to 200000 in the (.p) file, I will get that sampling rate? or should I change other things?

Thanks in advance.

 (Please visit the site to view this file)


Viewing all articles
Browse latest Browse all 149095

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>