XC-1A clocked output

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
cicga
Active Member
Posts: 51
Joined: Tue Oct 11, 2011 4:48 pm

XC-1A clocked output

Post by cicga »

hi all
I am working on clocked outputs and have some problem. here is code:

Code: Select all

#include <platform.h>
on stdcore[2]:  out port outClock = XS1_PORT_1A ;
on stdcore[2]:  out port     outP = XS1_PORT_1B ;
on stdcore[2]:          clock clk = XS1_CLKBLK_1 ;

 void config()
 {
	configure_clock_rate (clk , 100 , 8);
	configure_out_port (outP , clk , 0);
	configure_port_clock_output ( outClock , clk );
       start_clock (clk );
 }

 void gen()
 {
timer tmr;
unsigned time;

	config();
	while(1)
	{
		for( int x=0;x<16;x++)
		   outP <:(43365 &(1<< x))/(1<< x);
        tmr:>time;time+=100;
        tmr when timerafter (time):>void;
	}
 }

int main ( void )
{

    par{
          on stdcore[2]: gen();
      }
      return 0;
}
it simple ,I expect to see on LA clock signal on 1A port and data on 1B port, but instead I have garbage.
pls see image. somebody has an idea why this happen?
Attachments
clocked_out.jpg
(283.36 KiB) Not downloaded yet
clocked_out.jpg
(283.36 KiB) Not downloaded yet
Last edited by phalt on Tue Dec 06, 2011 3:23 pm, edited 1 time in total.
Reason: Code tags please!


Ali
Member++
Posts: 22
Joined: Mon Jun 07, 2010 12:50 pm

Post by Ali »

Hi Cicga

The code you have is correct, it runs correctly for me on the simulator.
Have you been able to get it to work?

Ali
Post Reply