> On Jan 29, 2017, at 2:17 PM, Renzo Fabián <[email protected]> wrote: > > I understand there are many ways to solve the problem. > > 1. Using PRUs via libpruio suggested by TJF. > 2. Using DMA via iio driver suggested by John. Search for iio_generic_buffer, which is in mainline under tools/iio. This will show you how to read the IIO buffer from a user space app.
Alternatively, you can use iiod which you will find in libiio, which allows you to read the samples remotely. You can use IIO_Oscilloscope to connect to iiod. https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope <https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope> Regards, John > 3. Using a external ADC suggested by Woody. > > I understand the solution 1. > > John, can you send a example of ADC sampling and DMA? > > For 3, I don't want to use a external ADC for this project. But, for others > I'll have in mind this solution. This solution would be possible with RPi3? > > Thanks you. > > > El viernes, 27 de enero de 2017, 2:10:27 (UTC-2), Renzo Fabián escribió: > > I have the following C code's parts that uses tables of sins and cosins to > calculate a fundamental phasor of 60 Hz electrical system using 16 samples > per cycle (960 Sps): > > float cosins[]={1, 0.92388, 0.70711, 0.38268, 0, -0.38268, -0.70711, > -0.92388, -1, > -0.92388, -0.70711, -0.38268, 0, 0.38268, 0.70711, 0.92388}; > > float sins[]={0, 0.38268, 0.70711, 0.92388, 1, 0.92388, 0.70711, 0.38268, 0, > -0.38268, -0.70711, -0.92388, -1, -0.92388, -0.70711, > -0.38268}; > > ... > > for(i=0; i <16; i++){ > ret_r=x[15-i]*cosins[i]+ret_r; > ret_i=x[15-i]*sins[i]+ret_i; > } > > return 0.088388*ret_r -0.088388*ret_i*I; > > Is it possible to perform this using the libpruio in order to read 6 analog > inputs? If yes? What is the best way to implement it if other operations were > need, i.e. compute the division of 2 phasors. > > Thanks. > > -- > For more options, visit http://beagleboard.org/discuss > <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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beagleboard/a37f290e-bff8-4456-be21-bd72825b1bf0%40googlegroups.com > > <https://groups.google.com/d/msgid/beagleboard/a37f290e-bff8-4456-be21-bd72825b1bf0%40googlegroups.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- 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/E873E8C4-96B4-4A1B-9ED9-5C6014628D26%40gmail.com. For more options, visit https://groups.google.com/d/optout.
