Strange behavior with input and output port

larryd:
Why?

How fast?

How many iterations are there here?
for (int j = 0; j < l; j++)
and
for (int i = 0; i < l; i++)

The achieved square waves ( 0.5 MHz ) is enough.
The number of iterations is fixed by l that in my case is 512, but is ok also for "l=whatever even number".
The first for is used to create the array that is scanned by the second for.