Hi TMF!
The left shift was not the problem although it helps removing it for
clarity. I have read some in chapter 12 of the AM335x documentation but I
am afraid I still do not totally understand.
What I can see is that it seems that the ADC process does not get finished.
At least that is my guess. I always end up with a situation where either
the last 2, 3 or even 4 bits stay high. That looks like an unfinished ADC
process where you would start with 011111111111 and its corresponding
reference voltage then if the voltage is higher this gets changed to
101111111111, if the voltage is now lower then we get 100111111111 end so
on. When measuring 0V I always end up with 7 as the lowest value or 15 and
then 23, 31 etcetera. Or sometimes some 19 in between but often not. As if
the procedure does not get to the last 2, 3 or even 4 bits.
I tried to fiddle around with the sample and open delay settings but that
seems to have no effect other then getting error messages telling me that I
use too high sample rates (that message appears already when I use low
numbers but it can handle 1). As stated earlier when I lower my sample rate
with a factor 10, if that was the problem, I would expect the problem to
vanish, but it does not. Further I set averaging to 1. And finishing, It
does not make any difference starting from step 1 or from step 7 (as is
done in the initialisation code that I provide here):
void ADC::initPruio() {
pruio_adc_setStep(io, 7, 0, 1, 0, 0); //Step 7, AIN-0
pruio_adc_setStep(io, 8, 1, 1, 0, 0); //Step 8, AIN-1
pruio_adc_setStep(io, 9, 2, 1, 0, 0); //Step 9, AIN-2
pruio_adc_setStep(io, 10, 3, 1, 0, 0); //Step 10, AIN-3
pruio_adc_setStep(io, 11, 4, 1, 0, 0); //Step 11, AIN-4
pruio_adc_setStep(io, 12, 5, 1, 0, 0); //Step 12, AIN-5
pruio_adc_setStep(io, 13, 6, 1, 0, 0); //Step 13, AIN-6
pruio_adc_setStep(io, 14, 7, 1, 0, 0); //Step 14, AIN-7
if (pruio_config(io, 220500, 255<<7 , 45352, 0)){ // upload settings:
220500 (* 8) samples (, 255 is bin 11111111, 22.05 kHz, 12 bits,
printf("config failed (%s)\n", io->Errr);}
if (pruio_rb_start(io)) printf("rb_start failed (%s)\n", io->Errr); //
start measurement //Starts in rb_mode
printf("initialized\n");
}
I hope you can point me in a more concrete direction.
Best, Hans.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/b2b6d660-1c85-4460-92b1-c3e41b94fdd6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.