I think that the work arround to get the bit what i am looking for is to MOV into the register r3 the register r31 with all states then doing right and left shifting to get that bit.
Is it r32 a 32 bits? I am in the right way? Manuel El jun 20, 2014 10:17 PM, "Charles Steinkuehler" <char...@steinkuehler.net> escribió: > 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 > char...@steinkuehler.net > > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to a topic in the > Google Groups "BeagleBoard" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/beagleboard/PzuzGgfGvBU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > beagleboard+unsubscr...@googlegroups.com. > For more options, visit 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. For more options, visit https://groups.google.com/d/optout.