Hello,
I’m trying to generate pattern with the PRU in several channel at the same time.
So the objective is to be able to send different sequence of value on six channel of the PRU and all of them need to be sent at the same (based on a clock signal).
For example send
channel 0 : 0 1 1 0 0 0 1 1 0 0
channel 1 : 1 0 1 0 0 1 1 1 0 0
channel 2 : 0 1 1 0 0 0 1 0 0 0
channel 3 : 0 1 1 0 1 0 1 1 0 0
channel 4 : 0 0 1 0 0 1 0 1 0 0
channel 5 : 1 1 1 0 0 0 1 1 0 1
And on each rise up of the clock, the data are sending out.
(The value of the data are not important, it’s just an example).
To do so I’have follow the chapter 13 of Derek molloy book on ADC.
Then from the PRUADC.p program, I have extract the part which allowed me to do shift out of data, I have regroup it in the file pru_sequence_one_channel_out.p.
I have also use a pru_sequence.c (based on the PRUADC.c program) which allow me to send the assembly code into the PRU
(Just to be clear I have rename pru_sequence.p into pru_sequence_one_channel_out.p in order be able to explain you the difference with pru_sequence_two_channel_out.p).
This example works very well, I observe the expected data on the pin P9_29.
However, when I tried to send two data at the same time it is not working, in the way that I can’t observe anything on P9_27 (but I still observed the same signal on the P9_29).
It’s not due to the DTS, because if I change the PIN of the DATA_OUT to P9_27, it’s work well.
The code is on the pru_sequence_two_channel_out.p program, it is use with the same pru_sequence.c program. The main change are on SEQCLK part.
I have also tried to move the part for the OUT_2 on different places in the program, but I didn’t succeed to making it works.
In addition, I have tried to shift out the same data in two channels, but it’s still doesn’t work.
So I’m wondering if it’s possible to do shift out on multiple Pins at the same time ? If yes, have you got an example which can do that,
or have you some clue on what I’m doing wrong ?
Remark :
I have also think to the Direct Connection mode instead of the Shift out one. However, I didn’t know how can I do such a thing with a clock synchronization because each movement will cost me one clock cycle.
Thanks by advance
Regards
Vincent
pru_sequence.c (2.54 KB)
pru_sequence_one_channel_out.p (3.85 KB)
pru_sequence_two_channel_out.p (4.44 KB)