Microcontroller firmware that uses a simple, yet powerful scripting language to control the timing of input and output events with high temporal resolution. Written specifically for neuroscience research.

Uploading firmware to your controller

stateScript is currently supported on the SpikeGadgets hardware and on the MBED LPC1768. Support for other hardware is planned.

To compile (or contribute) for MBED LPC1768, go here and branch the project. You can also download the .bin file in the downloads section of this repository and simply copy it to your MBED's flash to get going.

stateScript comes pre-loaded on the SpikeGadgets Environmental Control Unit (ECU).

Graphical Interface

A graphical interface to interact with the firmware and edit scripts is part of the Trodes Project. Trodes can be downloaded for windows here. Double-click on 'stateScript' to start the GUI. Here is a screenshot of the program when it has just opened:


Screen Shot 2015-07-01 at 4.55.44 PM.png

Once the program has launched, you will need to connect to the hardware. More to come...


%Example 1
%Example of a timed blink

%define some global variables
int allowblink = 1
int blinkdelay = 1000

% when digital port 1 goes from low to high...
callback portin[1] up
    if (allowblink == 1) do  % if statement
        portout[1] = 1 % set output port 1 to high
        do in blinkdelay % this block will executed in blinkdelay ms
            portout[1] = 0 % set output port 1 to low
    else do  % else block
        disp('No blinking allowed.')
end; % use a semicolon to tell the compiler to compile everything up to this point