Is it possible to use system clock to drive the ports instea Topic is solved

If you have a simple question and just want an answer.
User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Is it possible to use system clock to drive the ports instea

Post by sethu_jangala »

View Solution
User avatar
sethu_jangala
XCore Expert
Posts: 589
Joined: Wed Feb 29, 2012 10:03 am

Post by sethu_jangala »

Yes, it is possible.
 
Use the following code:
 
#include <xs1.h>
 
clock clk = XS1_CLKBLK_1;
 
void app()
 
{
 
 unsigned clock_divider = 2;
 
  configure_clock_ref(clk, clock_divider);
 
  asm("setclk res[%0], %1"::"r"(clk), "r"(XS1_CLK_XCORE));
 
}
 
int main()
{
  par
    {
      app();
    }
  return 0;
}