Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

SIMPL - A Tiny Language for MSP430

$
0
0

Hi All

 

Back in May 2013, I came across a piece of development work by Ward Cunningham (wiki inventor) for a tiny interpreted language "Txtzyme" that ran on Arduino - or virtually any other micro that was supported by a C compiler.

 

(The name Txtzyme comes from text and enzyme -  an enzyme being a biological catalyst - or a substance that causes (chemical) change to occur faster).

 

I was intrigued how under 100 lines of C code formed such a useful and extendable language - that I quickly had it running on an Arduino, and was making my own modifications and improvements.  I have since built on Ward's work and called my project SIMPL - Serial Interpreted Microcontroller Language.

 

(Link to Ward's original work is here  https://github.com/WardCunningham/Txtzyme )

 

Ward had created a "nano interpreter" in just a few lines of C code, which formed the heart of an interactive language for controlling hardware.

 

Through just a dozen commands it would allow port manipulation,  flashing LEDs,  musical tone generation, PWM, printing to screen and sensing analogue signals. The language communicated through a uart port to the PC.

 

Originally Txtzyme offered just these commands - see Ward Cunningham's Read Me:

a-f      Select an I/O port
h        help - a summary of commands
i         input
k        a loop counter - which decrements each time around the loop  see {}
m       millisecond delay
o       output
p       print the value of variable x followed by carriage return/line feed
s       sample an ADC channel
u       microsecond delay
x       a 16 bit integer variable
{}     code between these braces is repeated as a loop
_ _    characters between the underscores are printed to the terminal

 

Txtzyme was small, entensible and portable - it will run on almost any microcontroller.  The Txtzyme scripts were very small, human readable and easy to send from one device to another.

 

One early application was for the Arduino to be used as an I/O controller board attached to a Raspberry Pi.  The Pi would send a simple command via it's uart and the Arduino would perform an I/O function, sequence or whatever.

 

Some months later, I decided to try Txtzyme with the MSP430, as I had got a LaunchPad and Energia had just appeared on my radar. 

So I took the original Txtzyme Arduino  sketch, loaded into Energia - and behold it worked first time.  Txtzyme was a universal "lingua franca" that could be used on any micro.

 

If you want to try  arecent version of SIMPL that runs on a LaunchPad MSP430G2553 - here is the Github Gist

 

https://gist.github.com/anonymous/034dd41f108263d09803

 

Since then I have ported it to  AVR Cortex M3, M4,  and several soft-core processors running on FPGAs.

 

Currently my aim is to reduce the SIMPL Kernel to approximately 2kbytes - so that it can become a "Smart Bootloader"  - residing on the microcontroller in the bootloader area, and being immediately available as an interactive toolkit for exercising hardware and performing small applications.

 

I have written extensively about it in my blog  - starting here  from May 2013

 

http://sustburbia.blogspot.co.uk/2013/05/txtzyme-minimal-interpreter-and.html

 

I have also just this week started a wiki - so that all the new information can reside in 1 place.

 

https://simplex1.wiki.zoho.com/HomePage.html

 

 

Please get in touch if you would like to know more about SIMPL and my project aims.  

 

 

 

 

Ken 

 

London

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 2077

Trending Articles