Hi Andrea! Am Mittwoch, 30. März 2016 23:07:55 UTC+2 schrieb [email protected]: > > My mistake was to build only the FreeBasic library and not the one in the > folder `c_wrapper` >
No mistake, a lucky find. Just use the matching compiler. > I have another question: I'm trying to read from the ADC the sound from a > microphone. So I would like to acquire data at 44100Hz > In order to achive this result I follow your documentation so I've > configured the ADC as follow > > pruio_config(io, 2, 0x1FE, 0x22675, 4) >> > > I put 22675 as a hexadecimal value because if I put it as a decimal number > the library continue to give me the error > > config failed (sample rate too big) > > Can you, kindly, put me in the right direction to achieve my goal? > It's too less code to give detailed advices. What I can see: - You specify only 2 samples (second parameter). That's too less. Your ARM code isn't fast enough to fetch the data value by value with appropriate timing. - You set 0x1FE as step mask (third parameter). Why do you need steps 1 to 8 (defaults to AIN-0 to AIN-7)? The maximum sampling rate for 8 channels is 25 kHz (= 200 kHz / 8). - Your sampling rate (fourth parameter) is 7096.3 Hz (= 1e9 / 0x22765, or in decimal 1e9 / 140917). It's not possible to sample at exactly 44100 Hz, but 44101,43 Hz is possible by using 22765 (= 0x5893) as fourth parameter. So from my point of view you should - Adapt the step mask to the necessary channels (= steps). The correct value depends on your wiring and step configuration (code is missing). - Increase the number of samples (use all ERam: 131070 for one step or 65536 for two steps, when using default configuration of driver uio_pruss). - Adapt the sampling rate (to 0x5893 = 22765). Then use RB mode to fetch the samples (and output them to a file or evaluate them directly) or MM mode for a single shot (~ 3 s recording for 1 step, 1.5 s recording for 2 steps). BR -- 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]. For more options, visit https://groups.google.com/d/optout.
