OPTION

Compatible with:
DOS Maximite CMM MM150 MM170 MM+ MMX Picromite ArmiteL4 Armite F4 ArmiteH7 CMM2

Syntax:
OPTION parameter

Description:

OPTION ANGLE RADIANS | DEGREES CMM2 This command switches trig functions between degrees and radians. 
Acts on SIN, COS, TAN, ATN, ATAN2, MATH ATAN3, ACOS, ASIN 
This is a temporary option that is cleared to default (radians) when programs end, after an error, or after Ctrl-C so should be set at the top of any program that requires to use angles in degrees.
OPTION AUTORUN OFF | ON Permanent Instructs MMBasic to automatically run the program in program flash memory on power up or restart (eg, by the WATCHDOG timer). 
This is turned off by the NEW command but other commands that might change program memory (EDIT, etc) do not change this setting. 
Entering the break key (default CTRL-C) at the console will interrupt the running program and return to the command prompt. 
If the CMM2 is set to run programs from RAM (OPTION RAM) then the firmware will look for the file AUTORUN.BAS on reset or power up and execute it if found.
OPTION BASE 0 | 1   Set the lowest value for array subscripts to either 0 or 1. 
This must be used before any arrays are declared and is reset to the default of 0 on power up.
OPTION BAUDRATE nbr Permanent Set the baud rate for the serial console to 'nbr'. 
On the CMM2, this can be any value between 1200 (the minimum) and 1000000 (1MHz). For other devices, check the available baudrates in the manual.
This change is made immediately and will be remembered when the power is cycled. Using this command it is possible to set the console to an unworkable baud rate and in this case the baudrate should be reset using a USB keyboard and VGA monitor. 
If that is not available then resetting the firmware will reset the baudrate to the default of 115200 for the CMM2 or 38400 for other devices.
OPTION BREAK nn Permanent Set the value of the break key to the ASCII value 'nn'. This key is used to interrupt a running program. 
The value of the break key is set to CTRL-C key at power up but it can be changed to any keyboard key using this command (for example, OPTION BREAK 4 will set the break key to the CTRL-D key). 
Setting this option to zero will disable the break function entirely.
OPTION CASE UPPER | LOWER | TITLE Micromites
Permanent
Change the case used for listing command and function names when using the LIST command. 
The default is TITLE but the old standard of MMBasic can be restored using OPTION CASE UPPER.
OPTION CLOCKTRIM ±n Micromites Trim the frequency of the internal oscillator on the 28 and 44-pin Micromites. 
This oscillator is used as the basis for all timing (eg, date, time, pause, PWM frequency, serial baudrate, etc). 
'n' is the trim value which can range from -31 to +31 (this equates to an adjustment range of about -12.5% to +12.5%). 
On power up the trim value is zero. Note that this will also affect the console baudrate and an excessive trim value could make it impossible to communicate with the Micromite.
OPTION COLOURCODE ON | OFF | REVERSE Permanent Turn on or off colour coding for the editor's output. Keywords will be in cyan, comments in yellow, etc. 
The default is ON. OPTION COLOURCODE REVERSE is the same as OPTION COLORCODE OFF except that the text will be in reverse video black on white. On the CMM2, this will apply to the file manager and editor. The keyword COLORCODE (USA spelling) can also be used. On the serial console colour coding requires a terminal emulator that can interpret the appropriate escape codes.
OPTION CONSOLE SCREEN
OPTION CONSOLE SERIAL
OPTION CONSOLE BOTH
OPTION CONSOLE SAVE
CMM2 OPTION CONSOLE SCREEN will disable the serial console for both input and output and direct all output to the VGA monitor. 
This will allow the VGA output to update much faster. 
With this option enabled the serial port used for the console can be opened as COM3. 
OPTION CONSOLE SERIAL will disable the console output to the VGA screen and send all output to the serial console. 
This is useful for debugging graphics applications as diagnostic PRINT statements will not corrupt the screen display. 
OPTION CONSOLE BOTH will enable both the serial and VGA screen for console input/output. This is the default on power up unless OPTION CONSOLE SAVE (see below) is used.
OPTION CONSOLE SAVEwill save the current console mode (see above) as the default stored mode. 
If you are using the CMM2 as a stand alone computer it is recommended that you execute OPTION CONSOLE SCREEN, then OPTION CONSOLE SAVE to permanently disable the serial console and thereby eliminate serial I/O overhead.
OPTION CONSOLE ECHO
OPTION CONSOLE NOECHO
OPTION CONSOLE INVERT
OPTION CONSOLE NOINVERT
OPTION CONSOLE AUTO
All except CMM2
Permanent
Used to set options for the console serial port. 
NOECHO will turn off the echoing of characters received at the console. 
ECHO will re enable the echo. The default is ECHO at bootup and the option is reset to ECHO whenever the program returns to the command prompt. This option is useful when the console is used as a third general purpose serial port. 
INVERT will invert the data polarity on both the console transmit and receive lines. This allows the console to be used with RS232 signals without a converter (see the chapter "Low Cost RS-232 Interface" in Appendix A). It also allows the use of a PICAXE style programming cable.
NOINVERT will restore the console to its normal operation and is the default. 
AUTO will automatically invert the data polarity on the console depending on the signal level at power up (a low input means that the console will be inverted). This will automatically switch between TTL serial and RS232 serial input. 
Note that there is a 200ms startup delay when AUTO is used. This option will be remembered even when the power is removed.
OPTION CONSOLE OFF | ON Micromite Plus
Permanent
Disable or enable the serial console. When the console is disabled the serial port can be opened as COM4:. 
This command can only be run from the command line and will cause a restart so if the command was issued via the USB console the connection will be lost and will need to be re-established. The new value will remembered, even when the power is cycled or a new program loaded. 
Note that the other OPTION CONSOLE commands supported by the standard Micromite (OPTION CONSOLE INVERT, etc) are also recognised.
OPTION CONTROLS nn Micromite Plus Set the maximum number of controls that can be created by a program to 'nn'. 
This can be any number from 1 to 1000. The default is 100. A larger number will use more RAM (each control entry uses about 50 bytes of RAM). This command can only be run from the command line and the new value will remembered, even when the power is cycled or a new program loaded.
OPTION CRLF mode CMM2 Defines what the USB keyboard will send when the Enter key is pressed. 'mode' can be one of CR, LF or CRLF. The default is CRLF.
This does not affect the serial console.
OPTION DEFAULT FLOAT | INTEGER | STRING | NONE   Used to set the default type for a variable which is not explicitly defined. If OPTION DEFAULT NONE is used then all variables must have their type explicitly defined. 
When a program is run the default is set to FLOAT for compatibility with previous versions of MMBasic.
OPTION DEFAULT MODE n CMM2 Specifies the video mode for the command prompt, the editor and the filemanager and is the default mode when a program is run. n can be:
1 = 800x600 (default)
8 = 640x480
9 = 1024x768
10 = 848x480 (widescreen)
11 = 1280 x 720 (widescreen)
12 = 960 x 540 (widescreen)
This setting is remembered even after a firmware upgrade.
OPTION DISPLAY lines [,chars] Micromites
Permanent
Set the characteristics of the display terminal used for the console. 
Both the LIST and EDIT commands need to know this information to correctly format the text for display. 'lines' is the number of lines on the display and 'chars' is the width of the display in characters. 
The default is 24 lines x 80 chars and when changed this option will be remembered even when the power is removed.
OPTION EDIT FONT SMALL | NORMAL | MEDIUM | LARGE | VERY LARGE CMM2
Permanent
Sets the font to be used in the editor and file manager. The default is NORMAL which is a 8x12 pixel font.
OPTION EXPLICIT   Placing this command at the start of a program will require that every variable be explicitly declared using the DIM, LOCAL or STATIC commands before it can be used in the program. 
This option is disabled by default when a program is run. If it is used it must be specified before any variables are used.
OPTION F11 string$
OPTION F12 string$
CMM2
Permanent
Define the string that will be generated when the F11 function key is pressed at the command prompt.
Example:
OPTION F11 “RUN “+chr$(34)+”myprog” +chr$(34)+chr$(13)+chr$(10).
The maximum string length is 23 characters.
OPTION FLASH [n] CMM2
Permanent
Specifies that programs are to be run from FLASH memory and will therefore be preserved when the CMM2 is powered off or reset.
The optional parameter ‘n’ specifies the starting point in 128Kbyte pages of memory. ‘n’ defaults to 0.
For 0<=n<=4 the maximum program size is 512KBytes
for n=5 the maximum program size is 384KBytes
for n=6 the maximum program size is 256KBytes
for n=7 the maximum program size is 128KBytes
Using the OPTION FLASH command can increase flash lifespan by a factor of 8 although it is unlikely ever to be needed for most users.
See also OPTION RAM.
OPTION KEYBOARD nn
OPTION KEYBOARD DISABLE
Micromite Plus
Permanent
Enable an attached PS2 keyboard and set its language type.
‘nn is a two character code defining the keyboard layout. The choices are US for the standard keyboard layout in the USA, Australia and New Zealand , UK (United Kingdom), FR (French), GR (German), BE (Belgium), IT (Italian) or ES (Spanish). 
OPTION KEYBOARD DISABLE will disable the keyboard and return the I/O pins to normal use.
See the section "PS2 Keyboard" for details of connecting the keyboard.
This command can only be run from the command line and the new value will remembered, even when the power is cycled or a new program loaded.
OPTION KEYBOARD REPEAT firstchar, nextchar CMM2
Permanent
Define the repeat characteristics of the USB keyboard when a key is held down.
'firstchar' is the time in milliseconds before a new character repeats. Default is 600mSec, the valid range is 100 to 2000 mSec
'nextchars' is the time in milliseconds before subsequent character repeats. Default is 150mSec, the valid range is 25 to 2000 mSec
OPTION LCDPANEL controller,, orientation, D/C pin, reset pin [,CS pin]
OPTION LCDPANEL DISABLE
Micromites Configures the Micromite Plus to work with an attached LCD panel.
Non-Plus micromites can use ILI9341 or ILI9341_I only.
'controller' can be:
ILI9163 SPI based 1.44" panels using the ILI9163 controller
ST7735 SPI based 1.8" panels using the ST7735 controller
ILI9341 SPI based 2.2", 2.4" and 2.8" panels using the ILI9341 controller
SSD1963_4 4.3" panels using the SSD1963 controller
SSD1963_5 5" panels using the SSD1963controller
SSD1963_5A alternative version of the 5" panel
SSD1963_7 7" panels using the SSD1963controller
SSD1963_7A alternative version of the 7" panel
SSD1963_8 8" panels using the SSD1963controller

'orientation' can be LANDSCAPE, PORTRAIT, RLANDSCAPE or RPORTRAIT. These can be abbreviated to L, P, RL or RP. The R prefix
indicates the reverse or "upside down" orientation.
ILI9341, ST7735 and ILI9163 based panels:
'C/D pin' and 'reset pin' are the Micromite I/O pins to be used for these functions. Any free pin can be used. 'CS pin' can also be any I/O pin but is optional. If a touch controller is not used this parameter can be left off the command and the CS pin on the LCD display wired permanently to ground. If the touch controller is used this pin must then be specified and connected to a Micromite I/O pin.
NOTE: The CPU speed must be 20MHz or greater.
For SSD1963 based panels:
'LCD-A pin' can also be any I/O pin but is optional. This can be used to control the brightness of the backlight if the internal SSD1963 controller is not used. This command only needs to be run once as the parameters are stored in non volatile memory. When the Micromite is restarted the display will be automatically initialise ready for use. If the LCD panel is no longer required the command OPTION LCDPANEL DISABLE can be used to disable the LCD panel feature and return the I/O pins for general use.

OPTION LEGACY ON | OFF CMM2 This will turn on or off compatibility mode with the original Colour Maximite. 
Commands such as LINE, CIRCLE and PIXEL work as they originally did and all drawing commands will accept colours in the range of 0 to 7. Notes: 
Keywords such as RED, BLUE, etc are not implemented so they should be defined as constants if needed.
The VGA display mode is not changed with this option so it should be specifically set to MODE 4 for emulating the 480x432 resolution of the original Colour Maximite or MODE 5 for emulating the 240x216 resolution. The colour depth must be set to 8-bits.
OPTION LIST   This will list the settings of any options that have been changed from their default setting and are the type that is saved in flash. 
This command is useful when configuring options that reserve I/O pins (ie, OPTION LCDPANEL or OPTION TOUCH) and you need to know what pins are in use.
OPTION MILLISECONDS ON | OFF CMM2 Specifies that the TIME$ function will, or will not, include milliseconds as a decimal fraction of seconds in its output. The default is OFF.
This option will affect code that expects Time$ to be formatted in a particular way.
OPTION MOUSE channel [,sensitivity]
OPTION MOUSE OFF
CMM2 In order to use a mouse in the filemanager and editor you need to tell the firmware to expect a mouse to be available: 
OPTION MOUSE channel [,sensitivity]
This says that a mouse is connected to the specified channel (use channel 0 for a PS2 mouse) and the filemanager and editor will then expect and use the mouse. To disable the mouse in the editor and filemanager use: OPTION MOUSE OFF
OPTION PIN nbr Permanent Set 'nbr' as the PIN (Personal Identification Number) for access to the console prompt. 
'nbr' can be any non zero number of up to eight digits. 
Whenever a running program tries to exit to the command prompt for whatever reason MMBasic will request this number before the prompt is presented. This is a security feature as without access to the command prompt an intruder cannot list or change the program in memory or modify the operation of MMBasic in any way. 
To disable this feature enter zero for the PIN number (ie, OPTION PIN 0). A permanent lock can be applied by using 99999999 for the PIN number. If a permanent lock is applied or the PIN number is lost the only way to recover is to reset MMBasic (as described in the section Resetting MMBasic).
OPTION PROFILING ON | OFF CMM2
Permanent
This is a permanent option but it defaults to OFF whenever new firmware is loaded. With profiling on you will see a performance impact of about 5% caused by the profiling data collection which happens at the MMBasic statement level. In addition you will see a reduction in available variable RAM of 512KB. Note that profiling and OPTION RAM are mutually incompatible.
With profiling enabled you can run your programs as usual and you should see no change in behaviour other than as mentioned above. You can see the way the program has run using the commands LIST PROFILE [CSV]
OPTION RAM CMM2
Permanent
OPTION RAM causes the program to be loaded into RAM to run rather than flash memory. This makes loading somewhat faster and
avoids impacting the flash write life. Program performance is similar to running from flash (less than 1% slower).
Programs are lost with power, reset, or option change. 
Variable storage is reduced by 512Kb.
See also OPTION FLASH.
OPTION RESET Permanent Reset all saved options to their default values.
OPTION RTC Data-pin, Clock-pin
OPTION RTC DISABLE
Micromite Plus
Permanent
Configures the Micromite Plus for access to a Real Time Clock (RTC).
'Data-pin' is the I/O pin number used for the I2C data line and Clock-pin is the same for the I2C clock. If they are the same as the standard I2C interface then that interface will be used. If they are different a private I2C interface will be created to communicate with the RTC (this frees up the main I2C interface for other tasks).
When this command is used the settings will be saved in non volatile memory and automatically applied at startup or reset. Also on startup MMBasic will automatically query the RTC for the current time and date and set the internal
clock (similar to the RTC GETTIME command).
The general commands for accessing the RTC (RTC SETTIME, RTC GETREG, etc) can still be used and will access the RTC connected to the I/O pins specified in this command.
The command OPTION RTC DISABLE can be used to disable this feature and return the I/O pins for general use.
OPTION RTC CALIBRATE ±n CMM2
Armites
Permanent
Used to calibrate the battery backed Real Time Clock that keeps time in the Colour Maximite 2.
'n' is a number between -511 and + 512. A change of ±1 should equate to about 0.0824 seconds per day. Negative numbers will slow the
clock down, positive will speed it up (different from the Micromite). This setting is remembered even after a firmware upgrade.
OPTION SAVE Micromite
Permanent
Used to save configuration options that are embedded in a program.
OPTION SD TIMING NORMAL | FAST CMM2
Permanent
The fast option will speed up the timing for SD card access. This results in read/write speeds being about 20% faster where cards can accommodate the higher speed access. 
The default is normal. This setting is remembered even after a firmware upgrade.
OPTION SDCARD CS-pin [, CD-pin [,WP pin]]
OPTION SDCARD DISABLE
Micromite Plus
Permanent
Configures the Micromite Plus to access an attached SD card. 'CS-pin' is the I/O pin number that will be used as chip select (pin 1 on the SD card connector). 
'CD-pin' is optional and is the I/O pin number that will be used to connect to the card detect pin on the SD card connector. 
The Micromite will provide a weak pullup on this pin which is switched to ground when a card is inserted. If this signal is not provided the Micromite Plus will need to be restarted if the SD card was changed. 
'WP-pin' is optional and is the I/O pin number that will be used to connect to the write protect pin on the SD card connector. 
The Micromite will provide a weak pullup on this pin which is switched to ground when a write protected card is inserted. 
Some SD card connectors reverse the polarity of the 'CD-pin' or 'WP-pin' signal - ie, they are open (and therefore the signal is high) when the card is inserted or write protected. In this case the pin numbers used for 'CD-pin' and 'WP-pin' can be a negative number. This will tell MMBasic to invert the polarity of these signals. 
This command only needs to be run once. When the Micromite is restarted MMBasic will automatically initialise the SD card interface. 
If the SD card is no longer required the command OPTION SDCARD DISABLE can be used which will disable the SD card and return the I/O pins for general use.
OPTION SEARCH PATH pathname$ CMM2
Permanent
This defines a path which will be searched when you use the existing RUN command or the short form RUN command (*) if the file does not exist in the current directory
OPTION SERIAL PULLUP ENABLE | DISABLE CMM2
Permanent
Enable or disable pullup resistors on the receive line of all serial ports including the serial console. 
The default is disabled.
OPTION STATUS ON | OFF CMM2
Permanent
Enable or disable the status line at the bottom of the VGA screen. 
The status line shows the date/time and the "current program filename" used by the commands RUN, LIST and EDIT when a file name is not specified. Default is ON.
OPTION SLEEP n CMM2 n is the number of minutes (0-255) before the monitor is turned off when at the command line. 
Set to 0 to disable. Any keypress will wake the monitor
Also see PAGE DISPLAY -1
OPTION TAB 2 | 3 | 4 | 8 Permanent Set the spacing for the tab key. Default is 2. '3' is only available on the CMM2
OPTION TOUCH T_CS pin, T_IRQ pin
OPTION TOUCH DISABLE
Micromites Configures MMBasic for the touch sensitive feature of an attached LCD panel. 
'T_CS pin' and 'T_IRQ pin' are the Micromite I/O pins to be used for chip select and touch interrupt respectively (any free pins can be used).
OPTION USBKEYBOARD nn [,noLED] CMM2
Permanent
Set the language type for the attached USB keyboard. ‘nn is a two character code defining the keyboard layout. 
The choices are US for the standard keyboard layout in the USA, Australia and New Zealand and UK for the United Kingdom, DE for Germany, FR for France and ES for Spain. 
The optional noLED parameter can be set to 1 to block sending the command to the keyboard that lights the LEDs relating to Caps Lock etc. This may be needed on some keyboards which do not process this command properly and may lock up. It defaults to 0 if not specified (i.e. the LED commands are sent). 
This command can only be run from the command line and will cause a reboot of the CMM2. This setting is remembered even after a firmware upgrade.
OPTION VCC voltage CMM2 Specifies the voltage (Vcc) supplied to the STM32 chip. 
When using the analog inputs to measure voltage the STM32 chip uses its supply voltage (Vcc) as its reference. This voltage can be accurately measured using a DMM and set using this command for more accurate measurement. 
The parameter is not saved and should be initialised either on the command line or in a program. The default if not set is 3.3.
OPTION Y_AXIS DOWN | UP CMM2 This command can only be used in a program and inverts the y axis for drawing commands. 
Ie, with UP set 0,0 is at the bottom left as in a typical graphing application. This is a temporary option that is cleared to default (DOWN) when programs end, after an error, or after Ctrl-C.

 

Last edited: 25 February, 2021