I'm relatively new to XMOS and am starting what I'm realizing is an ambitious project - an expandable high speed waveform generator/analyzer. I'd really like to see this through though. With a little bit more success I'll create a formal project for it. My concept is that separate chips will be responsible for driving DAC and reading ADC. Because my target data rate is so high (16bit@10MHz) there are some challenges with communication across the xlinks - but I think this can be overcome (calculations would be done on-chip, results pushed off-chip - sections of waveform could be sampled in real-time, viewable from ethernet connected software).
Right now I'm just working on the basics though. Trying to do basic sine wave generation at 10MHz using a look-up table.
I'll also say that I've looked at
Web Oscilloscope
http://archive.xmoslinkers.org/node/284
High Speed Data Collection project
http://www.xcore.com/projects/high-spee ... ac-and-adc
High Speed data collection (DAC and ADC) topic
http://www.xcore.com/forum/viewtopic.ph ... +speed+DAC
Generating Sine Waves topic
http://www.xcore.com/forum/viewtopic.php?f=26&t=2213
and not sure if I should respond to one of these or start a new topic... but new topic it is!
~:~
So far I'm using the ethernet module to send and receive TELNET commands to my XC-2 board (G4 device), parsing the packets into channel commands, and I can drive my LTC1668 16bit parallel DAC, at first thought without a problem.
But my sine-waves should be 100kHz (10MHz/100samples) - 10us period, and they sit at 15us. This makes sense once I run the simulation and see that the DAC gets updated at a rate alternating between 100 and 200ns - but I don't know why this happens.
This comes after a lot of debugging and headscratching, and is the result of simplifying the code as much as I know how to do at the moment.
Code: Select all
on stdcore[1] : out port dacOut = XS1_PORT_16A;
on stdcore[1] : out port clkOut = XS1_PORT_1E;
on stdcore[1] : clock clk = XS1_CLKBLK_1;
on stdcore[0] : out port x0ledB = PORT_LED_0_1;
// cosine look-up table in header
static short cosLUT[100] = {
65535 ,
65470 ,
65277 ,
64955 ,
64506 ,
.
.
.
64955 ,
65277 ,
65470
};
void initialize(out port dacOut, out port clkOut, clock clk)
{
configure_clock_rate(clk, 100, 10); // first/second, 10MHz Clock
configure_out_port(dacOut, clk, 0);
configure_port_clock_output(clkOut, clk);
start_clock(clk);
}
void outputMain(out port dacOut, out port clkOut, clock clk)
{
short value = 0;
initialize(dacOut, clkOut, clk);
while(1) {
dacOut <: cosLUT[value];
value++;
if(value>99) {
value = 0;
}
}
return;
}
int main(void) {
chan c_xtcp[1];
chan c_tasks;
chan wv[4];
par
{
// The main ethernet/tcp server
on ETHERNET_DEFAULT_TILE:
ethernet_xtcp_server(xtcp_ports,
ipconfig,
c_xtcp,
1);
// The webserver
on tile[0]: xprot(c_xtcp[0], c_tasks);
// The taskmaster
on tile[0]: taskmaster(c_tasks);
on tile[1]: outputMain(dacOut, clkOut, clk);
}
return 0;
}
A) for help in meeting my 100ns timing deadline
B) for thoughts about using the XMOS architecture to achieve 10MHz signal acquisition and response. After extensive reading I'm starting to doubt this was a good choice, maybe I'd be better off with FPGA - but I really like the XMOS environment.
C) Is there interest in this project? Possibly having the end result available as a dev platform?
End goal is DC to 500kHz modulation/demodulation, highly modular/expandable (n-channels), multi-frequency mod/demod possible, real-time amplitude / frequency control, ethernet controlled for waveform viewing, industrial communication protocols for analytical result communication.