This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

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

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.

 3125.PRUTEST.rar