I would be stunned if the GPIOs don't have synchronizer flip-flops as they 
are sampling a signal asynchronous to the 200MHz clock.  That would account 
for 2 clocks.  You probably need one extra to clock data into R31.  And 
then one clock to read R31.

50MHz is a pretty smoking speed for SPI--you normally need to start 
thinking about series termination and some basic signal integrity.  You 
normally need the clock to capture to flop directly if you want things to 
work.

I suspect you probably need to use the 16-bit Parallel Capture Mode while 
feeding your clock out back as clock in.  You'll still probably be 4 clocks 
behind when the data hits R31, but the data will get *captured* by the 
PRU<n>_CLOCKIN edge properly so the delay will now be deterministic if you 
are generating the 50MHz clock yourself.

On Thursday, February 25, 2021 at 12:15:18 PM UTC-8 rpau...@gmail.com wrote:

> With a sample size of one, r31 appears to be 4 instructions behind the 
> state of the pin.
>
> On Thursday, February 25, 2021 at 12:26:16 PM UTC-5 Paul Beam wrote:
>
>> I am, unfortunately, bit-banging SPI with the PRU, and I seem to be 
>> running into a speed limit < 50 MHz I desire.  I can certainly create a 
>> clock that fast, but reading data seems to be delayed.  I can see on the 
>> logic analyzer a "0" clearly being read as a '1" so there is either a delay 
>> in my clock output or a delay in my input or both.  I would like to think 
>> that r30 and r31 are tied directly to the outside world, but now I am 
>> thinking there is something in between that is either clocked or just has 
>> significant output delays.  Anyone else encountered this?  
>
>

-- 
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/f88c700e-69c2-4ac4-bc64-d44a1715460dn%40googlegroups.com.

Reply via email to