I just started learning programming in xC by reading the language reference https://www.xmos.com/download/XMOS-Prog ... 8E%29.pdf/ and following along with a xCore-200 eXplorer board and XTC 15.3.1 and I am stuck trying to generate a clock signal.
I followed the example (page 66), but when running the code and monitoring the p_clock_out pin with a logic analyzer, the pin just stays low.
Toggling the pin manually, however, works as expected, so the error must be with the clock itself.
Code: Select all
#include <platform.h>
#include <xs1.h>
on tile[0]: out port p_out = XS1_PORT_8A;
on tile[0]: port p_clock_out = XS1_PORT_1A;
on tile[0]: clock clk = XS1_CLKBLK_1;
int main()
{
configure_clock_rate(clk, 100, 8); // 100/8 = 12.5 MHz
configure_out_port(p_out, clk, 0); // p_out clocked by clock clk with initial value 0
configure_port_clock_output(p_clock_out, clk); // causes clock signal to be driven in the pin connected to port p_clock_out
start_clock(clk);
for (int i=0; i<5; i++)
{
p_out <: i;
}
return 0;
}Thanks!
