Firstly I would just like to say that I've only started using XMOS microcontrollers so I'm very inexperienced. So please bear with me!
I have a question regarding the use of an external clock. I'm hoping to use a C++ computer program to send a clock signal to a XC-1A board via a USB connection.
In my XC program I have two threads running on stdcore[0]. One thread is used to receive either bytes of data or bits from the external clock. The other thread is used for processing the input data and outputting the correct signals to the output ports.
My question is this... how can I set up a clock on one thread and then stream the signal via a channel to the other thread? If my code was all running on one thread I know that I would set up the clock as follows:
Code: Select all
out buffered port:4 LEDs = XS1_PORT_4C; // Button LEDs 1,2,3,4
in port RXD = PORT_UART_RX; // setting up RXD to be the IN port
clock clk = XS1_CLKBLK_1; // Clock block identifier
void foo(in port RXD, out port LEDs)
{
configure_clock_src(clk, RXD);
configure_out_port(LEDs, clk, 0);
start_clock(clk);
}
Code: Select all
configure_out_port(LEDs, clk, 0)
Code: Select all
configure_clock_src(clk, RXD)
Any help or advice would be greatly appreciated. Thanks.
Peter