LED Driver

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

The counters of ports only count synchronously when 1) the ports
are on the same clock and 2) that clock is enabled for them at the
same time. You did not configure p.ledclk to run off p.lclk, things
should go more smoothly if you do ;-)


User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

I can see two ways to do what you want.

The first is to run all ports off the refclk, and quadruple all bits you
send out the led ports.

The second is to run lclk (the clock) off ledclk (the port). That will
make the led ports change slightly delayed to the edges on ledclk;
if I remember correctly, it's two system clock periods, i.e. 4ns if you
run the system at 500MHz. You can choose which edge, too. This
is a bit gross but it does work...
User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

Oh, and with that second solution you do not do @time for the
led ports.