STM32 BASIC Language Interpreter

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
Post Reply
User avatar
8bitgeek
Posts: 6
Joined: Sat May 05, 2012 12:04 pm

STM32 BASIC Language Interpreter

Post by 8bitgeek »

I am pleased to say that I have developed a BASIC language interpreter and command line, that's currently running nicely stand-alone on STM32F103R.

http://8bit.zapto.org/DaddyBASIC.html

It's written in C++, should be an easy port to get it ported to Chibios, I think that wil be the next step.

Version 1.1 interprets ASCII text. Version 1.2 compiles ASCII text into byte codes, and will execute either compiled or uncompiled (or mixed) program text. The compiler still needs some optimization, for insatnce numbers are still represented in ASCII form.

The function library is currently not terribly rich, and has some basic functions for accessing GPIO pins.

Although it seems to be running quite well, it is still very 'Alpha' with a total of < 4 hours run time on it!
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32 BASIC Language Interpreter

Post by Giovanni »

Hi,

Great job, it would be nice making it wrap some HAL functionalities for I/O. Making it run within a thread should not be a problem.

Giovanni
User avatar
8bitgeek
Posts: 6
Joined: Sat May 05, 2012 12:04 pm

Re: STM32 BASIC Language Interpreter

Post by 8bitgeek »

Giovanni wrote:Hi,

Great job, it would be nice making it wrap some HAL functionalities for I/O. Making it run within a thread should not be a problem.

Giovanni


Indeed, that's what I'm thinking, I'll run the BASIC interpreter in a thread, such that there can be more than one instance running, and I'll wrap some of the HAL functionality in function calls.

Will implement something like an interrupt/event handler as well :

100 ON <some event trigger> GOSUB 1000
150 let busy_work = busy_work + 1
200 goto 150
1000 print "got event"
1010 return

Something like that...

--Mike
User avatar
Tectu
Posts: 1225
Joined: Thu May 10, 2012 9:50 am

Re: STM32 BASIC Language Interpreter

Post by Tectu »

Well done and thanks for sharing! :)


~ Tectu
User avatar
8bitgeek
Posts: 6
Joined: Sat May 05, 2012 12:04 pm

Re: STM32 BASIC Language Interpreter

Post by 8bitgeek »

Tectu wrote:Well done and thanks for sharing! :)


~ Tectu


I just posted an update at http://8bit.zapto.org/Download%20DaddyBASIC

Mostly a number of bug fixes, some execution time improvements, and a couple usability refinements.

I think the heap is the main execution bottle neck now (I'm using a bitmap heap, it's nice for debugging memory allocation issues, but a little sluggish), I have a super fast heap I'll try at somepoint, but I think I'll work on the ChibiOS migration first while I have a pretty stable version to start with.

--Mike
Pablo2048
Posts: 1
Joined: Thu Feb 28, 2013 4:16 pm

Re: STM32 BASIC Language Interpreter

Post by Pablo2048 »

8bitgeek wrote:
I just posted an update at http://8bit.zapto.org/Download%20DaddyBASIC

Mostly a number of bug fixes, some execution time improvements, and a couple usability refinements.

I think the heap is the main execution bottle neck now (I'm using a bitmap heap, it's nice for debugging memory allocation issues, but a little sluggish), I have a super fast heap I'll try at somepoint, but I think I'll work on the ChibiOS migration first while I have a pretty stable version to start with.

--Mike

It seems like there is something wrong with Your pages...
Sincerely
Pablo2048
Post Reply