MikroBASIC for AVR- anyone using it?

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Anyone used/have commment on this excellent-looking BASIC compiler for AVR? Even has pointers. Supports floats and longs and structures. Looks like C with BASIC dialect. May not have a trial version.

http://www.mikroe.com/pdf/mikrob...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I haven't used BASIC since my TRS-80 days. But, if I were to try BASIC on an AVR, I'd be tempted to try BASCOM-AVR ( http://www.mcselec.com/index.php... ) due to some positive comments, like from Alberto Ricci Bitti AVR 2006 Design Contest Grand Prize winning entry:

Quote:
The most peculiar aspect of this design is that the firmware is written in BASIC. I’m a strong advocate of using C for embedded systems, and I use routinely the excellent GCC compiler for AVR development on PC and Linux platforms. But at the time I was waiting for the samples of the camera to arrive, I was asked to select a BASIC compiler and IDE for an educational board my company was developing.
BASCOM-AVR from MCS electronics is a stable, popular product with a rock-solid user base, and a syntax similar to Visual Basic. The IDE installs with lots of examples, and you don’t need anything else to make your applications. Actually, the IDE integrates all sorts of accessories including a simulator, a chip programmer and (nice touch) a serial terminal.
While browsing the online help, my attention was caught by the AVR-DOS library supplied with the package. The help includes a schematic for wiring an SD or MMC card to the SPI, and a 3-line-long code snippet for writing a text file:

open “README.TXT” for output as #1
print #1, “HALLO FILE!”
close #1

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm referring to modern structured BASIC, not ye ole BASIC with line numbers and GOTOs.

I really like ZBasic on the AVR. Great powerful BASIC; very close to VB6. As is, apparently, MikroBASIC.

BASCOM for AVRs (and 8051's) is more like the BASIC of olden times. It is very limited, lacks structures like C, lacks support for simple expressions like A = B + C + D. Local variables' names can conflict with globals of the same name, and on and on. Way too crude.

I've written tons of C (GCC and CV) and structured BASIC for PCs and micros. Given a good language/compiler/IDE like ZBasic (though you have to use their VM), I can get a one-of embedded program, non-trivial, written much faster than in C. For sure, if you have nitty-gritty sub-millisecond timing, you perhaps cannot use BASIC unless that time-critical code is optimized in a library written in ASM. But for rapid-app development, my preference is a good structured BASIC.

The BASIC compiler in question in this thread has not been written about in the forums, to my knowledge, hence the inquiry. Even has pointers.

EDIT: The do have a limited (2K) demo download. I'll give it a try!

[I have no affiliation or interest in this company]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the info, Steve. You certainly have more knowledge about varied BASIC implementations that I do.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi There,

I agree with Kevin, Bascom AVR has to be a good choice since it supports 64 bit floating point along with a full set of transcandential maths functions.
I am using Bascom 8051 which isn't as good as Bascom AVR nevertheless, it does everything I ask of it with little to no limitations. However, I am currently looking to cross upgrade to Bascom AVR simply because the AVR chips are so darn cheap and easy to get hold of plus AVRFREAKS is one heck of a friendly, easygoing cosmopolitan forum. :)

Cheers for now
Darren

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Darren, not to highjack Steve's thread so I'll be brief: what appeared most interesting to me about Bascom was the integrated SD/MMC, FAT support.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kevinrosenberg wrote:
Darren, not to highjack Steve's thread so I'll be brief: what appeared most interesting to me about Bascom was the integrated SD/MMC, FAT support.

Hi Kevin,

Yeah!, not to mention the GLCD support too.The 128x64 from Futurlec is just $20.00. I'm currently having a go at designing a pH meter, I think I can develop a mighty fine pH meter with one of those GLCD's. :D

Cheers for now
Darren

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow, good price on the GLCD. Thanks for the tip!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Steve, I do not agree with what you write about BascomAVR.
So here is my opinion:
It's not like old school Basic, has structures as in C, variables can be local or global, line-numbers are optional, it uses labels, supports single and double precision variables and has a vaste collection of libraries that support lots of hardware.
Indeed it lacks support for simple expressions like A = B + C + D, but that's not really hard to overcome, is it ?
For a more detailed overview, have a look here: http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=29&category_id=5&option=com_phpshop&Itemid=1

I consider structured programming something I am responsible for. Not the compiler. Metaphore: The hammer is not responsible for ticking the nail on the head. The carpenter is.

Is BascomAVR the best Basic compiler on earth? I don't know, but it's good. Very good.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Plons wrote:

Is BascomAVR the best Basic compiler on earth? I don't know, but it's good. Very good.

Nard

Hi Nard,

For what my input is worth, I agree with every word you say about Bascom AVR. In fact, I think it is so good that in time it will become a strong contender against c. Already some top companies are recognising it as a powerful alternative language to c.
The rating system on AVRFREAKS give it 5 stars.

Cheers
Darren

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Darren, I share your enthousiasm :) , but I don't think BascomAVR will ever be a serious contender for C. It doesn't need to either. It has IMO it's own place in the toolbox we call compilers, and it's OK like that. It deserves more appreciation than it gets right now. That's for sure. I never feel limited by BascomAVR in what I want the AVR to do. The only limitation is ...... me !

Did I already mention it's neat IDE ? And it's fantastic support for all kind of programmers. And the comprehendable IDE for Fuse- and Lockbit setting?

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Steve, I skimmed through the PDF link you supplied on MikroBASIC. While I'm not likely going to use BASIC, part of the appeal of BASIC is having a read-to-use, already-debugged library for interfacing to various devices.

Looking at MikroBASIC, it has a much more extensive library that I would have guessed. So, if I were to use Basic in the future, I'd also look very carefully at MikroBASIC as well as the BascomAVR that I've already heard good things about.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like they have improved thier optimizing ability quite a bit from the last time I looked at that package. A couple of small tests actually produced smaller code than GCC did. While the tests were not extensive enough to really make a fair comparison, it did show that it is capable.

Most languages that put BASIC in the name are going to have a hard time with serious recognition just because of the ego factor. They really need to find another name. Then they can just market it with a slogan like " The power of C and the ease of BASIC " :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CirMicro wrote:
They really need to find another name.

Put the word "Visual" at the start perhaps?

(anyone else here old enough to remember "Gee Whiz BASIC"?)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
(anyone else here old enough to remember "Gee Whiz BASIC"?)

Yup...along with BASICA!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And my first computer was a Commodore PET
With a microsoft BASIC before the PC.
My PET was the old version that did NOT write Microsoft on wait 6502.

Jens

I have later used some basic for some PLC's and it works fine (much better than ladder!!!).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
(anyone else here old enough to remember "Gee Whiz BASIC"?)
gwbasic -- now that was already whizzy. My first computer booted in a second directly into 4k BASIC with the "READY>" prompt.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CirMicro wrote:

Most languages that put BASIC in the name are going to have a hard time with serious recognition just because of the ego factor. They really need to find another name. Then they can just market it with a slogan like " The power of C and the ease of BASIC " :-)

Hi All,

Hell, I just don't believe it, here I am thinking exactly the same thing but thinking I was the only one thinking it. Yes, basic compiler language has an 8 bit (1980's) sound to it and yet it couldn't be further from the truth, modern day basic compilers have all the attributes and flexibility c has, except it is much more readable and easier to understand and use. The other day, I was checking out a compiler language called modula 2(MC68k), having read some modula 2 syntax(code), I'd swear it was Bascom AVR basic.
Anybody for modula 2?

Cheers
Darren

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

LOL, I remember BASICA...

And don't forget BBC Basic too ! Still have a Model B and a Master in my playroom...

Cheers
Robin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What was BBC Basic? I started with 4k Microsoft BASIC on a TRS-80 model I.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

More info here: http://www.bbcbasic.co.uk/bbcbasic.html

As seen on the Acorn Computers produced BBC model A & B micro's, the Electron and the Master computers from the 1980's....

You could just open square brackets and start typing in 6502 assembler. Lovely :P

Cheers
Robin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the info, Robin. Unfortunatly, that link is down at the moment, but now I understand. The assembly support is very cool. For myself, I have moved from TRS-80 (Microsoft 4k and 16k) BASIC's to IBM's Microsoft basic in 1982. Neither had support for inline assembly.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I designed a comptuer that contained BBC BASIC in fact. I also wrote part of the Sinclair Spectrum BASIC ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very cool, Clawon. There's a Sinclair at Paul Allen's permanent exhibit , "Startup", here. So, at least a few of your bytes live a few miles from me.