On 6/20/2014 6:37 PM, Manu wrote:
> After a long time I am back with the PRU :)
> 
> I need to read the bit r31.t16 and capture the current state either 1 or 0 
> and set it to r3, I do that with this instruction:
> 
> SET r3, r31.t16    //set the bit r31.t16 to r3
> 
> When I read r3 the value is not 0 or 1, the returned value is 0x8
> 
> Any idea what is happening?

I'm pretty sure you don't understand the operation of the SET
instruction, which is used to *SET* a bit (ie: make it a one) rather
than copy it's value (the preceding value is lost).  Add to that the
note in the PRU Reference Guide that when using R31 as the source for a
SET instruction, "the resulting bits will be NULL and not reflect the
current input event flags that are normally obtained by reading R31",
and it's not surprising your code isn't working as expected.

Perhaps the MOV or shift (LSL/LSR) instructions will behave more like
what you're wanting?

-- 
Charles Steinkuehler
[email protected]

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to