Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

A free crossplatform BASIC interpereter. Great for utilities

Status
Not open for further replies.
It's called Small BASIC and has versions for PalmOS, VTOS, Franklin's, Linux, Win32 and DOS.
It's free and I use it for little utility programs; I find it very handy and hope that some of you forum users might find it useful also.

http://smallbasic.sourceforge.net/

Here's a quick program I cobbled together to calculate a freerunning Timer0 (PIC) for refreshing LED displays and a realtime clock.

Code:
'Calculates a freerunning timer0 refresh clock

xtal = 3686400 'the PICs main crystal
digits = 4 'the number of digits you want to refresh
minrate = 40 'minimum refresh rate per digit

clock = xtal /4 /256 /digits 'max refresh speed of timer0 clock for x digits

for i=8 to 0 step -1
  if (clock /2^i) >= minrate then exit
next i

if i=-1 then print "Oscilator too slow for refresh" :end

print "With the TIMER0 prescaler set for 1/";2^i
print "TIMER0 will overflow ";clock /2^i*digits;" times a second"
print "A ";digits;" digit display will refresh at ";clock /2^i;" hz per digit."

This demostrates why I like using 3.6864 MHz in my projects (it's also perfect for serial communications)
 
Thanks, Bill. I have been using GWBASIC in DOS for about 40+ years and am ready for something that runs in windows. I downloaded the XP version but it did not run. The 32 bit version runs fine, however, so I will try that out.

Russ
 
Thanks Russ, it was the BASIC programs on your web site that got me to post this.

I download this version for XP worked fine for me.

sbasic_fltk_0_9_7.exe

I've also fixed an error in the original program timer0.bas
 

Attachments

  • timer0.zip
    620 bytes · Views: 86
Mike said:
Is the serial port supported on a WinXP machine?

It appears to be in the latest version.
 

Attachments

  • com_727.jpg
    com_727.jpg
    64.4 KB · Views: 431
I ask because I get an "unsupported" error message when running the example 'chat' program on the open "com1:" AS #1 line in the program...

Regards, Mike
 
Still haven't figured out if access to the serial port works on WinXP machine... If I'm missing something that's obvious to one of you guys could you point me in the right direction please?

Thanks guys... Regards, Mike
 
Are you wanting a DOS basic compiler for the Windows platform?

Powerbasic.com, they have a trial (PBDOS I think it is) that will do small projects. Best I have seen, and the PBCC (32 bit and both are no GUI), but they charge for the 32 bit compiler.

Basic for the palm. I like aldweb.com (izibasic) is the best I have found.

Cross platform is cool, but I have not found anything yet that is close.

Big problem is the GUI interface. I will have a look at it though.

Are we in the Electronic Chat forum? This might fit the Microcontroller forum better :) Well, there is no OS forum, but it is closer.
 
Here's a list of all the free BASIC programs, SmallBASIC is among them.
https://www.thefreecountry.com/compilers/basic.shtml

COM communications seemed to always be a sore point for visual BASIC, It was near useless in VB3 and sort of fixed (but you had to load a module) in VB4. I've not used VB5 or 6 so I can't comment on them.

I used to use Turbo BASIC (still have it) it became Power BASIC. The reason I began to use SmallBASIC was to share simple programs in forums & on the web. Unlike compiled programs you could run them on any OS.

Perhaps one of the other free BASICs have COM support, I'd be interested in this also.

PS Mike. This odd program compiles, not sure what it does in SmallBASIC (no baud settings etc...)

Code:
open "COM1" as #1
print #1,"Hello"
close #1

Just spotted Just BASIC, appears to support RS232 objects.
https://www.justbasic.com/index.html


*** Update ***


Just BASIC seems fine; installs in XP easily. The exit command is different (bad programming practice anyway)

Code:
'SmallBASIC

for i = 1 to 10
 if i = 5 then exit
next i

' Just BASIC exit command requres the loop type suffix

for i = 1 to 10
 if i = 5 then exit for
next i

Other small differences.. (so far)
  • variables Are Case Sensitive
    no round(x,{y}) command
    working PRINT USING command :D

And you get RS232 communications
OPEN "COMn:baud,parity,data stop{,options}" for random as #handle
 
Hi Bill,

Downloaded Just BASIC v1.01 and it looks very promising... I've got it talking to an RS232 parasitically powered 12F675 board through COM1 at 9600 baud... Yippee...

Thank you very much...

Kind regards, Mike
 
Hope you all don't mind me bringing up an old thread...

Just wanted to say thanks for the tip on the Just BASIC interpreter... I think it's gonna work out just fine, though it's a pain-in-the-butt trying to learn it without any type of written documentation (Help File and Forum only)...

Kind regards, Mike

**broken link removed**
 

Attachments

  • JB problems.JPG
    JB problems.JPG
    49.1 KB · Views: 147
  • SPBRG Prog Screen 1.JPG
    SPBRG Prog Screen 1.JPG
    51.5 KB · Views: 137
  • SPBRG Prog Screen 2.JPG
    SPBRG Prog Screen 2.JPG
    52.7 KB · Views: 139
  • SPBRG Prog Screen 3.JPG
    SPBRG Prog Screen 3.JPG
    63.4 KB · Views: 113
  • Button Console.JPG
    Button Console.JPG
    15.5 KB · Views: 109
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top