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.

Linux/BEAGLEBN: Beaglebone black - AM3358 - PRU0 read ADC(SPI) (bits shifting left or losing bits on MISO)

Part Number: BEAGLEBN

Tool/software: Linux

Hi,

I'm reading the ads8860 with the PRU0 of the Beaglebone Black Rev C, and the PRU1 is doing a timer to get a 500kHz sampling rate, so i adapt the code from the Derek Moloy example(exploringbeaglebone.com/.../ ) to the mcp3008, to this ADC(ads8860), but i'm getting to many samples with erros.

After many tests i discover the problem, for example when i have a constant voltage in analog input, like 3,3 V i should receive 43253(16 bits resolution with Vref=5V) or something close to that on all samples, but i have many samples with 43261, 43317, 43512, ... all this error samples are +8,+16,+24,+32,...+256 or -256 than the original value. So my conclusion is my software is shifting or losing the less significant bits of the samples, and after the first error, the percentage of error start growing. I did the same communication in a 23k256 memory(SPI), and reading an adress where is the value(15-1111), the software reads many 14(1110) and 12(1100).

There is the PRUADC.p and the PRUClock.p and PRUADC.c for the communication with the ads8860.

4532.Codes.rar

Any help would be aprecciated, and if you want more informations about this, please say.

Best Regards,

David