I am developing a real-time data acquisition system using the XS1-U16 multi-tile device. On tile[0] I am using the internal ADC and USB PHY. On tile[1], I have an external high speed ADC connected to a 16 bit port. Here are two related questions:
- Is it possible to receive an external FRAME_SYNC and clock signal on tile[0] and use it to simultaneously gate the external ADC on tile[1]? Since the clock is relatively slow (2-6MHz), I believe that it is possible to the following work.
//(Needed to transfer clock or frame sync signal to appropriate tile)
void TX_Tile(interface my_interface client Transfer)
{
/**
* Setup interface to observe the clock signal on tile[0] relay it to tile[1].
*
*/
char MEAS_CLOCK_VAL =0;
char FRAME_SYNC_VAL =0;
while(peek(FRAME_SYNC)==1) //FRAME_SYNC gates the entire measurement operation.
{
MEAS_CLOCK_VAL = peek(MEAS_CLOCK);
FRAME_SYNC_VAL = peek(FRAME_SYNC); //Look at the value (0 or 1) on the measurement clock and store it.
//Transfer is the client end of the connection
//let's communicate with the other end.
Transfer.CLK(MEAS_CLOCK_VAL, FRAME_SYNC_VAL);
}
}
void RX_Tile(interface my_interface server Transfer)
{
unsigned Fsync;
while(1)
{
// wait for clock signal to make connection over Transfer.
select {
case Transfer.CLK(char MEAS_CLOCK_VAL, char FRAME_SYNC_VAL):
HS_ADC_TRIGGER <: MEAS_CLOCK_VAL; //Write the clock out to the port.
Fsync = FRAME_SYNC_VAL;
break;
}
// return Fsync; //Poor implementation (change void to char)
}
//return Fsync; //Desperate implementation (change void to char)
}
Here, the HS_ADC_TRIGGER signal is reproduced on Tile[1]. However, the Fsync signal cannot be used globally as it violates parallel usage rules. It seems like it should be trivial to move a sync signal from one tile to another. Can you suggest a better method?
Question 2: Would you recommend using the external signal to signal START for an internally generated 2MHz clock rather than trying to data stream it across tiles?
Thanks in advance from first time XMOS user!