Hi TJF!
Again, since I forgot a line of code and I think this post is more clear:
I read your suggestion and spend some time reading but I cannot really
figure out what I could do to remedy the issue. The bit shifting does not
change anything either but it gave insight.
I do have an inkling about what happens now. My strong suspicion is that
the ADC conversion process does not finish.
With 12 bits we would start the ADC sample process with 011111111111 and
look if the corresponding voltage is lower or higher then our input. If our
input voltage is higher the next probe would be 1011111111111, if that is
lower we probe 100111111111. When I measure 0V I often get values like 15
with some 23 mixed within. There are also some values of 19 but much less
then we see the value 23 which is odd since we would expect something like
a normal distribution. This suggests that the process mostly stops before
the last three bits are processed by the ADC.
My configuration of the pruio is below:
pruIo *io = pruio_new(PRUIO_DEF_ACTIVE, 1, 0x98, 0); //Create a new
driver structure
void ADC::initPruio() {
pruio_adc_setStep(io, 7, 0, 1, 0, 0); //Step 1, AIN-0
pruio_adc_setStep(io, 8, 1, 1, 0, 0); //Step 2, AIN-1
pruio_adc_setStep(io, 9, 2, 1, 0, 0); //Step 3, AIN-2
pruio_adc_setStep(io, 10, 3, 1, 0, 0); //Step 4, AIN-3
pruio_adc_setStep(io, 11, 4, 1, 0, 0); //Step 5, AIN-4
pruio_adc_setStep(io, 12, 5, 1, 0, 0); //Step 6, AIN-5
pruio_adc_setStep(io, 13, 6, 1, 0, 0); //Step 7, AIN-6
pruio_adc_setStep(io, 14, 7, 1, 0, 0); //Step 8, AIN-7
if (pruio_config(io, SAMPLE_RATE, 255<<7 , 45352, 0)){ // upload
settings: 220500 (* 8) samples (, 255 is bin 11111111, 22.05 kHz, 16 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 help me to point me in the right 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/e65cbd4e-1bf2-4187-a997-c127b7df05e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.