For what it is worth, I also tried to do it in freebasic. I don't know
anything about freebasic but tried to hack something together and I see
exactly the same behaviour:
' include libpruio
#INCLUDE ONCE "BBB/pruio.bi"
CONST tSamp = 20000 _ '*< The number of samples in the files (per step).
, tmr = 45352 _ '*< The sampling rate in ns (20000 -> 50 kHz).
, NoStep = 8 _ '*< The number of active steps (must match setStep
calls and mask).
VAR io = NEW PruIo() '*< Create a PruIo structure, wakeup subsystems.
WITH *io
DO
IF .Errr THEN ?"NEW failed: " & *.Errr : EXIT DO
IF .Adc->setStep( 7, 0, 0, 0, 0) THEN _
?"step 9 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep( 8, 1, 0, 0, 0) THEN _
?"step 10 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep( 9, 2, 0, 0, 0) THEN _
?"step 11 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep(10, 3, 0, 0, 0) THEN _
?"step 9 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep(11, 4, 0, 0, 0) THEN _
?"step 10 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep(12, 5, 0, 0, 0) THEN _
?"step 11 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep(13, 6, 0, 0, 0) THEN _
?"step 9 configuration failed: " & *.Errr : EXIT DO
IF .Adc->setStep(14, 7, 0, 0, 0) THEN _
?"step 10 configuration failed: " & *.Errr : EXIT DO
VAR mask = &b11111111 SHL 7 _ '*< The active steps (7 to 14).
IF .config(tSamp, mask, tmr, 0) THEN _ ' configure driver
?"config failed: " & *.Errr : EXIT DO
IF .rb_start() THEN _ ' start ring buffer mode
?"rb_start failed: " & *.Errr : EXIT DO
sleep 10
' here current ADC samples are available in array Adc->Value[]
FOR n AS LONG = 0 TO 13 ' print some lines
FOR i AS LONG = 0 TO 7 ' all steps
PRINT " " & HEX(io->Adc->Value[i + 8 * n], 0); ' output one channel
in hex
NEXT
PRINT ' next line
NEXT
LOOP UNTIL 1
IF .Errr THEN SLEEP
END WITH
DELETE(io)
Output:
C2D D7 747 F 117 F9F 4F 197
927 BF 4BB F 117 F9F 4F 197
757 A7 377 13 11F F9F 53 197
62F 9B 2EF 17 123 F9F 57 19F
56F 8F 2BF 17 127 F9F 57 19F
4EF 8F 2AF 17 127 F9F 57 19F
4AF 87 29F 17 12F F9F 57 19F
47F 7F 29F 17 12F F9F 57 19F
45F 7F 29F 17 12F FAF 57 19F
457 7F 29F 17 12F FAF 57 19F
44F 7F 29F 1B 12F FAF 57 19F
44F 7F 29F 1F 12F F9F 57 19F
43F 7F 29F 1F 12F FAF 5F 19F
Should I ask if this is pocket beagle related in a general forum or support
or does exactly the same happen on the BBB with ringbuffer mode? And is
this related to the processor or could there be a bug in libpruio?
Thanks for thinking with me.
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/a98fe5ef-a025-441b-8e72-e9e150c07eaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.