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)