I'm not sure I understand your question correctly. I think you're asking whether I managed to output the reference clock directly to an output pin, as this is what you tried to do in one of your examples. I found that I could not make this work. I could output half the reference frequency by using another clock block, so a maximum of 200MHz with the code below.ale500 wrote:Did you get the clock output in a pin, the reference clock ?
Code: Select all
#define REFDIV_REGNUM 8
out port clk_out_port = XS1_PORT_1I;
clock ref_clk = XS1_CLKBLK_REF;
clock div_clk = XS1_CLKBLK_1;
int main(void) {
//write_sswitch_reg(get_core_id(), REFDIV_REGNUM, 0x01); // 200 MHz reference clock
write_sswitch_reg(get_core_id(), REFDIV_REGNUM, 0x00); // 400 MHz reference clock
//configure_port_clock_output(clk_out_port, ref_clk); // This did not work
configure_clock_ref(div_clk, 1); // divide by 2. Using a value of 0 here fails to produce any output.
configure_port_clock_output(clk_out_port, div_clk);
start_clock(div_clk);
while(1);
}
I found that changing the XN file to include
Code: Select all
ReferenceFrequency="400MHz"
reports.xobjdump --recources <binfile.xe>
Max.