Thursday, May 07, 2015

XMOS Startkit

The XMOS Startkit is a development board for the (or one variant of the) XMOS multicore processor. It has two tiles, each with 8 32-bit cores giving a total of 500 MIPS. It has some very nice features such as the ability to set output ports at a specific and very precise time, and similarly to timestamp its input. The Startkit has the CPU, some LEDs and touch sensors and lots of connectors. There's a nice development studio which runs on the major platforms and connects to the board over USB. Amazingly, these board cost on $15 from Digikey in the US and can be bought for something similar in the UK. I got hold of one recently, with a plan to continue some of the DAC work I reported a few weeks back. However, as a first step I connected up a simple LED and made it flash with a variant of a program from the XMOS tutorials. It's wired up like this:

  • 0V from the J6 connector on the board to the cathode (short leg) of a small red LED.
  • Pin 1 of connector J7 to a 1k resistor.
  • The other end of the resistor to the anode (long led) of the LED.
A lower resistor would make the LED brighter, but I didn't want to risk drawing too much current. The pin operates at 3.3V.

Pin 1 of J7 is labelled D13, and it is connector to port 1F of the processor. The 1 here means this is a 1 bit port; there are wider ones as well. The code then looks like this:

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

port p = XS1_PORT_1A;
port p = XS1_PORT_1F;  // first pin on the connector

#define DELAY 200

int main() {
  while (1) {
     p <: 0;
     delay_milliseconds(DELAY);
     p <: 1;
     delay_milliseconds(DELAY);
  }
  return 0;
}
This is, of course, not super interesting. The main point I wanted to check is whether I could drive a LED directly.

No comments: