misc >> MicroController Basic

by RickE » Mon, 27 Aug 2007 21:09:17 GMT

Here is a copy of the Altair Basic Manual;

http://www.swtpc.com/mholley/Altair/Altair_Basic.htm

I think this manual describes what microcontroller Basic should look
like. Various assembly source codes exist for different platforms.
Some are TinyBasic, ZXSpectrum Basic, etc. All are a serious mess.

Studying the code has become very helpful. A much simpler organization
is possible. The logic of microcontroller Basic should be simple.

First, the original code sets up buffers. Pascal and C call these
buffers records and structures, respectively. Since I understand
Pascal better, that is my model. The original code calls these buffers
"workspaces." If you have ever dug into ncurses character terminal
code you will recognize this standard technique. The original code is
far too stingy with memory.

Second, there are various modes the Basic interpreter enters. The
manual describes a command line and program line mode. I suggest we
recognize a third mode; a system mode. The system mode is for
instructions CLEAR, LIST, RUN, NEW, CONT, LOAD, SAVE, and interrupts.

Anyway, this is an effort to organize microcontroller Basic from the
ground up. I like the modern Z80 cpu tools out there. Other
microcontroller Basics, like 8052 basic are too minimal. I also like
the editor Nedit on Linux. Nedit has great text search tools.

I'm looking for thoughtful suggestions. My programming time is spaced
between weather related work, so it comes in chunks.

Thanks,
Rick.


misc >> MicroController Basic

by Eric » Tue, 28 Aug 2007 05:40:55 GMT



The AVR family is easy to use and there's excellent hobby support for
it. Zilog has a newer Z-80 called the Acclaim. It runs at 50 Mhz. But
Zilog devices aren't as popular as they once were. The company has
been in and out of bankruptcy several times, I think. The Rabbit
devices are extremely similar to Z-80's.

I'd say you need to start with your goals of how you want to use a
Microcontroller and go from there.

- hobby-friendly MCU extremely easy to use with free tools: AVR
(Atmel)
- lowest power dissipation, with a nice 16 bit architecture: msp430
(TI)
- a nice "PIC on steroids" (totally different 16 bit architecture):
PIC24 (Microchip)
- 32 bit horsepower: Arm7 (Atmel, NXP), Cortex M3(Luminary), or
AVR32(Atmel)

I have open source BASIC interpreters for most MCU families, and I
have some that are written in C which are easily ported. I don't have
a good open source BASIC compiler for Microcontrollers yet.

There are some good commercial options: check out zbasic to see one
cool example of an embedded Basic for the AVR. There's also one for
the Arm (ARMexpress).

There are also some good commercial compilers, such as MBasic.

Eric

misc >> MicroController Basic

by ed_davis2 » Tue, 28 Aug 2007 09:42:40 GMT


Is it possible to download the ones written in C?

If, where?

misc >> MicroController Basic

by RickE » Tue, 28 Aug 2007 12:59:04 GMT


Thank you for the helpful feedback. It has been a challenge to get
oriented. I don't know much about the AVR chips except that some, like
Philips chips, include a flash ROM. I've looked at (IIRC)
AVRfreaks.com, etc.

Even Zilog has too many types. I've focused on the Z180 since it seems
expandable with Z80 core. Rabbit is expensive and proprietary. There
is a nice Z80 assembler and monitor that works well on Linux.

There is a lot to be confused about when critical automation systems
are discussed. Clearly, there is need and opportunity for much more
transparent microcontroller systems. I think a standard Basic on a
standard CPU core, open source, is a good idea.

Thanks,
Rick

misc >> MicroController Basic

by Eric » Wed, 29 Aug 2007 05:34:17 GMT


I advise you to check around to see how popular this is in today's
world. If you want to go with Zilog I'd pick a newer part that will be
easier to obtain (acclaim and Zneo). But they probably don't come in a
DIP package, and that's where the AVR shines. There are some very nice
AVRs that still come in a DIP package. But you can buy little header
boards with surface mounted MCUs already soldered in for most chip
families.

I also loved the Z-80, but today I'd want something a little more
popular so I could get help with problems. I also like the higher
integration of newer devices and you'll get more on-chip peripherals
that way. Serial, I2C, and SPI are pretty much mandatory to interface
to a number of different devices. That would be hard to do with an
older Z180.

I promise I will stop beating a dead horse.

Eric

misc >> MicroController Basic

by Eric » Wed, 29 Aug 2007 05:55:59 GMT


Most of the interpreters for small devices are written in Asm but one
that's written in C is here:

http://sourceforge.net/projects/smallbasic

Despite it's name, Small Basic isn't really small and it wants high
end Arm devices or x86 chips.

BWBASIC is a good ANSI C Basic that can be cross-compiled to most
small devices, but it would be wise to pare it down first. I really
like the source code for this.

http://sourceforge.net/projects/bwbasic/

MBasic is small and easy to port (though not in ANSI-C it's still
pretty easy to work with):

http://www.dunfield.com/downloads.htm

Here's another one:

http://www.programmersheaven.com/download/16060/download.aspx

And here:

http://www.personal.leeds.ac.uk/ ~bgy1mm/MiniBasic/MiniBasicHome.html

Eric

misc >> MicroController Basic

by RickE » Wed, 29 Aug 2007 09:55:33 GMT


That is some excellent information and advice. This dead horse has a
lot to learn.

The Z180 has a DMA bus controller which makes it interesting. The Z180
DIP package has less memory capacity. But the AVR chips are popular
for a reason.

Thanks,
Rick.

misc >> MicroController Basic

by Eric » Thu, 30 Aug 2007 06:44:31 GMT


misc >> MicroController Basic

by RickE » Thu, 30 Aug 2007 09:35:46 GMT


Great !! Thanks. From the pictured design now remove the VGA support
and the CP/M simulation, and replace them with LCD terminal and Basic
Interpreter.

AVR has definitely challenged EPROM and interface electronics. Altera
is described in one of the Z180 application notes. Lots to learn.

As you mentioned earlier, modern packaging would help the pictured
prototype. Great fun, thanks.
Rick.

misc >> MicroController Basic

by RickE » Thu, 30 Aug 2007 19:14:13 GMT

I'm reading up on AVR RISC chips. Thanks for the lead.

On the AVRfreaks site there is even a new project for a Solar Energy
controller. There is another projects web site and lots of Atmel docs.
Lots to learn. I still like having a CPU and a Basic interpreter on
board.

Quite a time of opportunity for young innovators. A standard micro
computer can be built for less than 50 US dollars parts. Enormous
support community around the world. I'm glad to see it. Most of us are
tired of the "war is patriotic" and "climate change is a myth" crap.

Rick.