On 5/18/2016 3:45 AM, Vincent lc wrote:
> 
> So is it the idea to shift out more bits at the same time, or is it 
> completely 
> something else ?

I can only guess at what you are trying to do based on the changes you
made to the code.

What I *THINK* you want is to have two (or more) values you're
shifting out, each in it's own PRU register, and have each value
shifted out on it's own PRU pin.

If that's the case, you want to test and set each value register and
then toggle the clock.  So in (totally not optimized) pseudo code:

Loop:
  test left bit of value 1
  set/clear output 1 as appropriate
  shift value 1

  test left bit of value 2
  set/clear output2 as appropriate
  shift value 2

  ... (repeat for however many values you have)

  Set the clock high
  Delay for clock-high time

  If all bits have been shifted out then
    read new values from memory

  Set the clock low

  goto Loop

Instead of testing and setting each bit individually, you can use a
byte or word move to PRU register 31, but that will require the C
program to seralize and interleave the data before sending it to the
PRU (or you could do this on the PRU, but it would take more cycles).

There are lots of other options for tweaking the code, depending on
how fast it needs to run and whether or not you need all the outputs
to change simultaneously.  Since you're currently delaying 12 cycles
for each state of the clock, you could pretty easily update eight
outputs without slowing down the code, but you'll have to be
pre-calculating the next outputs instead of busy-waiting in the clock
delay loops.

-- 
Charles Steinkuehler
char...@steinkuehler.net

-- 
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/573C898D.6030903%40steinkuehler.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to