I succeed (at least on simulator) with following code but I had to set ReferenceFrequency="200Mhz" in the .xn file.
Is my code legal/correct?
Code: Select all
#include <platform.h>
out port ClkPort[] = { XS1_PORT_1I, XS1_PORT_1J, XS1_PORT_1K, XS1_PORT_1L };
clock Clk = XS1_CLKBLK_1;
int main(void)
{
timer tmr;
unsigned t;
configure_clock_rate(Clk, 100, 1);
for(t=0; t < 4; t++)
{
configure_port_clock_output(ClkPort[t], Clk);
set_pad_delay(ClkPort[t], t);
}
start_clock(Clk);
tmr :> t; /* for debug, just to stop simulation after a while */
t += 1000;
tmr when timerafter(t) :> void;
return 0;
}
Tried to set Clk = XS1_CLKBLK_REF; but had "invalid resource used" by compiler althought I saw XS1_CLKBLK_REF used in some examples?
Is set_pad_delay usage correct or it should be used only to delay inputs?
Sorry for my many questions but I'am newbie to xmos processor.