It creates a unsigned ts and then uses it to trigger it for the high speed adc interface.
Where is the update rate of this communication?
And where is the initialization of the ts variable?
For timers we use "t :> time;" to synch up values.
What am I missing here?
I read XC Clocked Input and Output but didn't understand the use of it.
https://www.xmos.com/published/xc-clock ... and-output
Code: Select all
unsigned data_1,data_2,ts;
//reference clock is set to 50MHz
configure_clock_rate(clk,100,2);
configure_port_clock_output(p_clk_out, clk);
//Configuring all the ports synchronous to reference clock
configure_out_port(p_convsr, clk, 0);
configure_out_port(p_sdi, clk, 0);
configure_out_port(p_rd, clk, 0);
configure_in_port(p_sdoa, clk);
configure_in_port(p_sdob, clk);
p_rd<:0x0000000;
p_convsr<:0x00000000;
p_sdi<:0x00000000;
set_port_shift_count(p_sdoa,16);
set_port_shift_count(p_sdoa,16);
start_clock(clk);
p_cs<:0;
while(1)
{
p_rd @ (ts+5)<:0x00010001 ;
p_convsr @ (ts+5) <:0x00010001;
//write LSB first for two channels at a time
p_sdi @ (ts+7) <:0x05555550;
//Read two channels at a time. As we are usign 32 bit buffered ports
p_sdoa:> data_1;
p_sdob:> data_2 @ ts;
//Send the data read to the application using channels
c<:data_1;
c<:data_2;
}
}