The PRU has very powerful instructions for bitwise manipulation.

Review the instruction set in the PRU reference guide, or be a bit more
specific about exactly what you're trying to if you want some example
code.  Otherwise, I'm not understanding why just adding:

ADD R4, R4, R3

...to the code below doesn't do what you want.

On 6/23/2014 12:17 PM, Manuel Berro Madero wrote:
> You are right! I can read any pin with a simply:
> 
> LSR r3, r31.b0, 3                        //shift and mask
> AND r3,  r3, 0x01
> 
> 
> How can I increment a register eg. r4 bit by bit with the last state of
> r3 ? what I need is add bits to register.
> I tried with SET but without luck.
> 
> 
> 
> 
> 
> On 06/23/2014 11:57 AM, [email protected] wrote:
>> ----Ursprungligt meddelande----
>> Från: [email protected]
>> Datum: 2014-06-23 14:04
>> Till: <[email protected]>
>> Kopia: <[email protected]>
>> Ärende: Re: [beagleboard] Re: BBB PRU input test
>>
>> On 6/23/2014 6:52 AM, TJF wrote:
>>> Am Montag, 23. Juni 2014 06:19:52 UTC+2 schrieb [email protected]:
>>>> why "set r3, r31.t16" results in r3=0x08 ?
>>>>
>>>> I'd like the pru asm compiler just reject this code as it seems of
>> little
>>>> sense.
>>>>
>>> Yes, I agree. pasm should output the same error message as for
>>>
>>>    MOV r3, r31.t16
>>>
>>> which is
>>>
>>>     ???.p(?) Error: Operand 2 use of .T field not allowed here
>> There is no error from pasm because this is a valid form of the SET
>> command (Format 3, Source Abbreviated).
>>
>> The problem here is that you are reading from R31 using the SET
>> command,
>> which the PRU reference guide explicitly states does not work.  The
>> reference guide indicates the source will be NULL, which one might
>> *assume* means all zeros, but in reality could mean just about anything
>> (including something like "the source input pins on the ALU are
>> floating").
>>
>> So if you *REALLY* want to know, go ask TI if they'll share details
>> about what happens when using R31 as a source for the SET/CLR
>> operations, but I don't think you'll get very far.
>>
> 


-- 
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