Le samedi 20 septembre 2014 16:42:31 UTC-4, Charles Steinkuehler a écrit :
>
> On 9/19/2014 6:39 PM, Cedric Malitte wrote: 
> > 
> > I do coding for microchips and I thought ( beat me ) that the pruss 
> would 
> > behave the same concerning IOs, I mean direct access. 
>
> It does, if you use the direct PRU inputs (ie: read register R31). 
>
> It's when you use the GPIO registers via the SoC interconnect that reads 
> become very slow. 
>
> -- 
> Charles Steinkuehler 
> [email protected] <javascript:> 
>

Thanks Charles, I think I got it ! 

I will try tomorrow if I got time, but should look like this:

        MOV r3, 0 // Sensor_1 and Sensor_2 16 bits data
        MOV r4, 0 // Sensor_3 and Sensor_4 16 bits data
        
        CLR     r30.t14 //  CS low        
        MOV     r0, 0 // bit counter
LOOP1:
        SET     r30.t15 // CLK high
        MOV     r2, r31.b0 // Read in the data

        QBBC    ChkSensor2, r2.b0.t0 // if r2.0, set r3.0
        SET     r3, 0   
ChkSensor2:
        QBBC    ChkSensor3, r2.b0.t1 // if r2.1, set r3.15
        SET     r3, 15
ChkSensor3:
        QBBC    ChkSensor4, r2.b0.t2 // if r2.2, set r4.0
        SET     r4, 0
ChkSensor4:
        QBBC    EndCheck, r2.b0.t3 // if r2.3, set r4.15
        SET     r4, 15

EndCheck:
        CLR     r30.t15 // CLK low
        QBEQ    DataDone, r0, 15        

RotateData:
        LSL     r3, r3, 1
        LSL     r4, r4, 1
        ADD     r0, r0, 1
        JUMP    LOOP1

DataDone:        
        SET     r30.t14 //  CS high


I could also do bitmasking for the data in, as timing should be equal 
whatever the bit value is.

I'll chek what I have on the scope and I'll decide later.

Regards,

Cedric

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