> On Jan 27, 2017, at 4:43 PM, Renzo Fabián <elrre...@gmail.com> wrote:
> 
> john3909,
> 
> there's no reason to use the PRUs. I only need read 6 analog inputs in 
> real-time. I thought the only way would be using the PRUs. And the best way 
> by means of lbpruio.
Well, it all depends on what you mean by realtime? The ADC on the AM3358 uses a 
sequencer that samples the analog channels at a fixed sampling rate and places 
those samples in a FIFO. It does not matter if you use PRU or the IIO driver, 
because the channel sampling occurs at the same time. The difference is the PRU 
samples the ADC status and then copies the data into DDR and the IIO driver 
uses DMA to move the samples into DDR. The IIO driver is faster and can achieve 
higher sampling rates. Also the IIO driver is easier to use because you just 
read from /dev/iio:deviceX. Better still, you have both PRUs available for more 
important work. 

Regards,
John
> 
> 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 beagleboard+unsubscr...@googlegroups.com 
> <mailto:beagleboard+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/beagleboard/6b983516-e883-4f94-91c5-e57aedf214e4%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/beagleboard/6b983516-e883-4f94-91c5-e57aedf214e4%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 beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/A121A094-E91B-448F-9369-6F5657EE7345%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to