Jump to content

Mizar32/Software

From Wikibooks, open books for an open world

Mizar32 software

[edit | edit source]

Two pieces of software are factory-programmed into the Mizar32's flash memory:

  • The tiny (8KB) USB DFU bootloader
  • The Alcor6L system

The DFU bootloader

[edit | edit source]

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 system

[edit | edit source]

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
    • iv, a vi clone (running natively on Mizar32) for editing text files
  • Standard Lua modules: coroutine, io, package, string, table
  • Integer version of the math module with: 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: net
  • 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.

Further reading

[edit | edit source]