Fuzbol
From Simreal
|
Information
Fuzbol™ is a "small" language dedicated to hardware control. It features specialized fuzzy-logic data types and operators. It currently exists only for the Atmel AT90S8515 processor.
While working on Project:Boris I developed a need for a hardware controller. I explored this need via several microcontrollers -- the PIC, the HC11, the Atmel 8515 -- and felt that the Atmel 8515 was the best fit for this project.
I liked the Atmel AVR's ability to download programs to the MCU flash while it was in-circuit, and it has a good instruction set and a decent set of peripherals and memory interfaces. Since this time, a number of MCUs have appeared with good Flash in-circuit programming support -- but I am still comitted to the Atmel systems, though I've been known to occasionally covet the debugging capabilities of the HC11.
Anyway, at the time of my language need, there was a shortage of inexpensive (or free) high-level development languages for the AVR chips. Most of the established MCUs have many free development tools, and there are now some available for the Atmel chips. But at the time of this project, there was only the (quite capable) Atmel assembler and a few expensive C compilers.
Fuzbol™ was designed to fill this void in high-level development languages for the Atmel. But this still begs the question -- why create a new language, and not write a simplified version of Basic or C, like everyone else? After all, existing languages leverage off of people's experience.
I feel that Basic and C are good languages, and I use variations of both of them in my daily work. However, they are not necessarily suited for use in MCU hardware. Fuzbol™ is an attempt to craft a simple language, reminescent of C in structure and syntax, that is specifically targeted for MCU hardware control.
Fuzbol™ has primitive data types and operations that implement fuzzy-logic control of that hardware, it understands interrupts, and provides easy control over the MCU components.
Fuzbol™ has had to make some trade-offs, of course. I've chosen to make the interpreter as fast as possible -- each instruction fetch and execute has only 6 cycles of overhead -- but this is at the expense of token size (each token is 2-bytes wide, and is in fact the address of an internal procedure) and interrupt flexibility (interrupts are disabled until the main procedure "start()" has ended).
Fuzbol™ can execute simple programs on an un-adorned 8515 MCU, the programs which fit in 512 bytes of RAM are small -- even trivial. Fuzbol™ makes use of the 8515's ability to use external RAM, and this is the best place to store Fuzbol(TM) codes.
Though it adds to hardware complexity, Fuzbol™ assumes a full memory bus to the external RAM. Other embedded languages use a serial Flash chip which trades simplicity for speed.
Downloads
Fuzbol™ is being offered as Free Software under the terms and conditions of the GNU General Public License.
Any suggestions, ideas, translations, or improvements to the Fuzbol™ code system will be gladly accepted by SRS, LLC; all such work, if incorporated in the SRS official Fuzbol™ system, will be appropriately credited and deeply appreciated.
If you are interested in customized versions of Fuzbol™ for your application, contact SRS.
Reads Fuzbol™ source code and sends the compiled codes to the Fuzbol™ interpreter by way of the SRS In-Circuit Programmer. The Fuzbol™ Compiler also has the ability to install the Fuzbol™ Interpreter into the target system's Flash memory. Includes: Windows'95 executable plus source code under MSVC++ v.6.0 project, and Lex/Yacc scripts under Pargen_v.0.61.
Resides in the Flash memory of the AT90S8515 MCU, and executes Fuzbol™ codes out of internal or external RAM. Includes: Atmel HEX file in [Intellec-8] format, plus source code for AVR_Assembler_v.1.21.
While most Windows '95 and '98 systems should have this DLL, some do not. Use at your own risk.
Resides in the In-Circuit Programmer hardware, and provides an interface from the PC to the target MCU for programming Flash memory and both internal and external RAM. Derived from Atmel's serial programmer. Includes: Atmel HEX file in Intellec-8 format, plus source code for AVR_Assembler_v.1.21.
Postscript circuit design for the Atmel Fuzbol™ In-Circuit programmer.
Postscript circuit design for an example of basic Fuzbol™ Hardware.
Documentation
There is minimal Fuzbol™ documentation. Further references are planned, and Fuzbol(TM) is featured in our book "Applied Robotics"
Download the Fuzbol™ command reference, which contains a ZIPped RTF file of all fuzbol commands
Notes and Future Work
The first problem, is that we haven't had time to update and improve Fuzbol!
FP Data Conversion There seem to be some problems around converting data from real to byte... though I haven't pinpointed them yet. You are safest if you don't jump between data types all that often, and real to integer is better than real to byte.
Interrupt Handler You can define two handlers for the same interrupt, and the system doesn't give an error. Only one handler, however, will be used.
Undeclared Method If you attempt to define an object method, but you haven't defined it in the object (or, there is a typo in your name or parameters), then the Fuzbol compiler will crash. This is the most likely crash bug, so if the system goes down, scan around for methods without prototypes.
Boolean Tests Most of the boolean tests work, though implied TRUE/FALSE checks are a bit flakey. For example, this code fails to work: "val as integer; if (!val) {...}" as does "val as integer; if (val) {...}". Instead, use this form: "val as integer; if (val == 0) {...}".
Memory Arrays Added 6 July 1999 (but not necessarily working).
Memory Leaks I think?
Elseif Elseif chains fail in the second elseif. Fixed 18 July 1999
MFC42.DLLThis DLL is required by the executable. If you have problems with this, contact SRS.
Locked Files With some compiler errors, the compiler doesn't release the Fuzbol source file, so you can edit it! In this case, close the compiler and restart it.
Shift Operator A shift of zero will actually shift 256 times, returning zero. Fixed for version 1.5
Wish List
- Speed up the programmer.
- Add operators +=, -=, ++, --, and other shortcuts
- Add arrays of constants.
- Add additional serial commands, such as "in".
