output problem

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
ENGHK
Member++
Posts: 16
Joined: Fri Feb 19, 2010 7:03 am

output problem

Post by ENGHK »

Hello, would someone please help me to solve the following simple problem? I don't know why.
My question is just outputting the incoming signal . I don't know how to read the "1" and "0" from the port 1C and then store to x and printf 1 bit by 1 bit.I have physically connected the pins and have checked that no problem in incoming signal. The signal is SPI and 24 bit.

Code: Select all

# include <xs1.h>
#include <stdio.h>
#include <platform.h>

on stdcore[1]: in buffered port:1 in8P = XS1_PORT_1C ;
on stdcore[1]: in port INCLK = XS1_PORT_1A ;
on stdcore[1]: in port CS = XS1_PORT_1B ;
on stdcore[1]: clock clk = XS1_CLKBLK_2 ;

 int x ;

int main ( void ) {
	par
	  { 
	    on stdcore[1]:
	    {
                 configure_clock_src (clk , INCLK );	
	    	 configure_in_port (CS , clk );
	     	set_port_inv(CS); 
	    	configure_in_port_strobed_slave (in8P , CS , clk );
	    	start_clock (clk );
                 in8P:> x : 
	    }
	  }
                   }

Last edited by ENGHK on Tue Feb 23, 2010 6:07 am, edited 1 time in total.


ENGHK
Member++
Posts: 16
Joined: Fri Feb 19, 2010 7:03 am

Post by ENGHK »

In fact, my question is that I cannot get a "24bit" signal ? Do I use 32bit buffered port or 8 bit buffered one? which one is better ? I only need 24 bit from data line.


On the other hand, is there any function just similar to "endin"? Once I "endin", i cannot reuse the buffered port....
ENGHK
Member++
Posts: 16
Joined: Fri Feb 19, 2010 7:03 am

Post by ENGHK »

solved.
Post Reply