start cogs with n+n clock cycles.
events
Posts: 27
Hello to all.
It is possible with p8x32:
n +0 clock cycle -> starts cog0
n +1 clock cycle -> starts cog1
n +2 clock cycle -> starts cog2
n +3 clock cycle -> starts cog3
another question:
have an output pin, and in the next clock cycle pass to input?
there is some waiting time in this situation?
thank you
It is possible with p8x32:
n +0 clock cycle -> starts cog0
n +1 clock cycle -> starts cog1
n +2 clock cycle -> starts cog2
n +3 clock cycle -> starts cog3
another question:
have an output pin, and in the next clock cycle pass to input?
there is some waiting time in this situation?
thank you
Comments
I think the only sure way to do this is to pass the future timer value into the cog, where at the "top" of each cog you have a loop that suspends program execution until the counter has reached the target value.
I am guessing that you are wanting to get 4 cogs in sync staggerd by 1 clock apart. This is possible by using waitcnt. Be aware that hub accesses _ rdxxxx/wrxxx - will alter this.
I wrote a datalogging program a few years back that sampled the input pins using 4 cogs spaced 1 clock apart. Not sure if I put it in the obex. Later I discovered a similar method had been used (by Beau ???) - it might also be in obex.
BTW this can onlybe done using pasm.
n -> cog0 pin is output
n +1 -> cog1 puts the same pin in input
There is only one cycle of clock difference.