A separate forum for the new XS1-L1-64 board might be good idea. The Xlinkers forum is fine for questions about the XMOS chips and software, but the board has one or two problems that might be more appropriate for discussion here.
One problem is that the board is very fussy about the power up and XTAG-2 connection sequence. The sequence that works is as follows:
-
Attach the XTAG-2. Do not connect the XTAG-2 at this stage.
-
Attach the USB connector or 5V supply.
-
Ensure the power switch next to the USB connector is on. The red LED should be on.
-
Attach the XTAG-2 USB connector. The XTAG-2 should enumerate with the usual sound.
The board should now work with the XMOS XDE or command line tools.
If this procedure isn’t followed, and a program is developed and run with the XDE, it will be reported as running but nothing will happen on the hardware.
Another problem is that I can’t get the built-in program to work properly. It echoes characters typed in to RealTerm, but they are often corrupted, and it doesn’t respond to the space bar.
There appears to be a design fault that prevents comms to the PC via the XTAG-2 - the same pins are used for the on-board FTDI chip.
Here is a simple program that illustrates the use of two threads to flash the red and green LEDs alternately:
#include <xs1.h>
#include <platform.h>
#define LED_PERIOD 20000000
out port redLED = XS1_PORT_1E;
out port greenLED = XS1_PORT_1F;
void flash_red(out port redLED)
{
timer tmr;
unsigned t;
unsigned OnOff = 1;
tmr :> t;
while (1)
{
redLED <: OnOff;
t += LED_PERIOD;
tmr when timerafter(t) :> void;
OnOff = !OnOff;
}
}
void flash_green(out port greenLED)
{
timer tmr;
unsigned t;
unsigned OnOff = 1;
tmr :> t;
while (1)
{
greenLED <: !OnOff;
t += LED_PERIOD;
tmr when timerafter(t) :> void;
OnOff = !OnOff;
}
}
int main()
{
par
{
flash_red(redLED);
flash_green(greenLED);
}
return 0;
}
Leon