> On Feb 13, 2018, at 9:49 AM, pierrick.ra...@gadz.org wrote:
> 
> Hi all, 
> 
> I am trying to use the PRUs for real time data acquisition on the Beaglebone 
> black (Linux debian 4.9.45-ti-r57). I have set up the PRU with remoteproc and 
> RPMsg; everything is working fine. 
> The first time, I successfully captured data with the PRU using the SPI 
> protocol and bit banging, and I have sent them to the ARM with RPMsg. 
> 
> Now I want to do the same thing using the I2C protocol, which left me with 
> some questions: 
> - Is it possible to use the on-board I2C bus with the PRUs? 
Yes, and you can also control the SPI interface with the PRU as well. No need 
to do bit banging. 
> - If not, I will enable the pull-up resistor on a GPIO pins using a custom 
> device tree. But after that, I do not really understand how I can read and 
> write the SDA line for I2C? (Contrary to the SPI protocol, I won't have Data 
> In and  Data out lines but only one SDA line).
If you wish to bit bang the I2C, you need to create a state machine for I2. You 
start by outputting the “Address” together with “Read/Write” bit and then the 
“Data”, and then tristate the SDA line and wait for it to go high, which is the 
“Ack” from the slave device. After that, you simply toggle the clock line and 
read back the “Data” line. 
> 
> My final goal will be to use the on-board ADC. There is already a very 
> interesting project PRUADC that captures data using an external ADC. I would 
> like to use the on-board ADC, is there any way to do it ? (I am not afraid of 
> going into complex stuff). 
Yes, you can access the ADC with the PRU, but not sure why you would want to do 
that unless you are doing some closed loop control function. If you are simply 
reading the ADC and sending that info to the ARM, is is better to use the IIO 
driver. This driver uses DMA to transfer the samples to memory and the timing 
between the samples is controlled via the device tree.

Regards,
John
> 
> Thanks,
> 
> 
> Pierrick 
> 
> 
> 
> -- 
> 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/ed0d2be5-9c7f-4fe1-8e79-1f494bde023b%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/beagleboard/ed0d2be5-9c7f-4fe1-8e79-1f494bde023b%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/FBA6A23C-68C9-4AF2-875E-DB835E4F7802%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to