Reply
Posts: 3
Registered: ‎02-21-2016

Tiny Basic for EFM8BB1/SLSTK2020A

As a first project with the SLSTK2020A dev kit i received, I wondered if it could run Tiny Basic. Well, yes it can, although with 256 bytes of xram, you're not going to do too much.

I hacked it together, so don't expect a highly polished port. It's been over 16 years since I've done 8051 asm. Such an irregular architecture but there seems to be always an instruction to do what you want. A great cpu for bashing bits.

I added a couple of keywords - SAVE which saves the ram program into flash which can be retrieved with the PROM command and ADC(x) which reads an adc channel as a 0 bit value. Currently P0,2,3,6,7 are the only ports that are analog enabled. X can be a value between 0 and 31 which maps directly to the mux value. Thus 16 is the temp sensor, 17 is the 1V8 reg etc.

Have fun! See what can be done with so little.

This is derived from the Palo Alto Tiny Basic from 1980,so it should be as open source as you can get. My mods are free with no restrictions and no warranties etc.

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,077
Registered: ‎04-27-2004

Re: Tiny Basic for EFM8BB1/SLSTK2020A


This is derived from the Palo Alto Tiny Basic from 1980,so it should be as open source as you can get. My mods are free with no restrictions and no warranties etc.

This is a quite cool idea, but I think needs more than the project file alone Robot Happy ?

Have you compared it with something like Basic Stamp ?

With a boot-loader now in UB1, that could be a good target, as too would be the EFM8LB1.

Posts: 3
Registered: ‎02-21-2016

Re: Tiny Basic for EFM8BB1/SLSTK2020A

I did hope that 'export' would export the whole project. I'll attach the asm file later.

Comparison with basic stamp? The basic stamp is a bit different in concept. It used a front end program on your pc to compile/tokenise your basic code. Tiny basic needs no other program to prepare the basic code - it interprets the basic code on the fly. You've only got 200 characters worth of program, so you can't do much. It can execute the code from flash, so you can have larger programs but apart from the SAVE function, there's no other means of easily getting the basic code into flash.
Also, basic stamp had some useful functions like pulseOut and pulseIn. These can be implemented as there's enough flash in a 8k part to add a lot of useful things.
Highlighted
Posts: 3
Registered: ‎02-21-2016

Re: Tiny Basic for EFM8BB1/SLSTK2020A

Attached is the assembler file for the Tiny Basic interpreter. Only one file required. Add this to the src folder in the project. It uses only around 4k of flash. If there an easy means of exporting the whole project, then please tell me how.