Two pieces of software are factory-programmed into the Mizar32's flash memory:
- The tiny (8KB) USB DFU bootloader
- The Alcor6L system
The DFU bootloaderEdit
When the Mizar32 powers on or when its Reset button is pressed, the DFU bootloader is the first program that it runs. This checks if the user button is pressed and, if it is, allows you to update the rest of the firmware from your PC.
If it isn't, it runs:
The Alcor6L systemEdit
Alcor6L is a software system for natively programming microcontrollers (interactively and incrementally) using any of the following languages:
- Lua (using eLua)
- C (using PicoC)
- LISP (using PicoLisp and TinyScheme)
- BASIC (using MY-BASIC)
The Alcor6L system on your Mizar32 reads commands in any of the above languages from the SD card or from the console.
Alcor6L is a fork of the eLua project. It implements:
- Lua 5.1 as per the Lua 5.1 Reference Manual
- Integer variables and arithmetic instead of the usual double precision floating point for Lua
- Code to run the Lua compiler on the Mizar32
- Support for
- FAT filesystem on MMC/SD card
- console on the RS232 serial port or on USB serial port
viclone (running natively on Mizar32) for editing text files
- Standard Lua modules:
coroutine, io, package, string, table
- Integer version of the
abs, ceil, floor, huge, max, min, pow, random, randomseed, sqrt.
- Hardware driver modules:
adc, i2c, pio, pwm, spi, tmr, uart
- Extension modules:
bit, cpu, elua, pack, pd, term
- TCP/IP Networking uIP module:
- Extension modules for the Mizar32 to drive the LCD character display and the Real Time Clock.
If you have the Mizar32 A or B models with 256KB or 512KB of flash, you can change the firmware to use floating point instead of integer variables. If you have a 128KB flash Mizar32 C and you need to load a bigger eLua image than will fit you can still do it by loading the image from SDCard to SDRAM and executing it in SDRAM (with a speed penalty) using the emBLOD second-stage bootloader.
- The PicoLisp documentation.
- The Lua 5.1 Reference Manual.
- There is a free online book teaching Lua 5.0 which has a second edition for Lua 5.1 available on paper.
- Pieces of Lua code to achieve some common effects can be found at snippets.luacode.org and more resources at lua-users.org.
- To write the fastest Lua code, consult the wiki of speed optimization tips.