XMOS Bit Scheme has won the "Project Of The Month" award on XCore.com!
The XMOS BIT Scheme code is now available on XCore Exchange (under the GPL3 license)!
I've recently finished my thesis titled "Implementing Concurrency Abstractions for Programming Multi-Core Embedded Systems in Scheme" in which I've ported Bit Scheme to the XMOS platform. During the project, I switched from the XMOSlisp, mentioned before to Bit Scheme which contains much functionality.
In the following movie you can see a demo application written in Scheme running on an XK-1a development board. This board performs a red-green LED and communicates with another board via XBee. You can find a bit more information about this demo in the presentation below.
I've also uploaded the slides of my defense online in order to show the basic usage of the XMOS Bit Scheme interpreter.
The XMOSlisp code is now available on xcore.com
http://xcore.com/projects/xmoslisp
Since the last blogpost, a simple garbagecollector has been added too.
Intro
Recently I've made progress on having an interpreted language running on the XMOS chip. I've found a small (but incomplete) lisp interpreter which fits in and runs with the limited memory of the chip. By using an interpreted language, programs can be run on the XMOS chip without the need for compilation. Unfortunately it doesn't contain a garbage collector (at this moment), meaning that an inevitable crash awaits a lot of the programs.
Examples
Primitives for ports and timers are added to allow various IO operations.
For example turning some leds on, on the development board:
This function returns the value set (in this case 15), allowing to chain multiple outputs:
Input is also supported using the following methods:
- simple read: (pin button)
- pin equal: (peq button 12)
- pin not equal: (pne button 15)
There is also support for timers. These evaluate to an integer value similar to the way they are used in XC. That way delays can easily be created by doing:
Using these timers the following demo was made. It is a function which is called recursively generating a small animation using the LEDs on the development board. The initial value (being 1) is multiplied by two on every function call, effectively shifting to the next led. The "mod 15", keeps everything in range.
Due to the lack of a garbage collector and the use of recursion, it will run out of memory after about 10-15 seconds.
Parallellism
At this moment there is no way to use the multithreading in the XMOS chip using the lisp interpreter.