Micromite Plus User manual

Micromite Plus
Manual
MMBasic Ver 5.4
For updates to this manual and more details on MMBasic
go to http://geoffg.net/micromite.html
or http://mmbasic.com
This manual is distributed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Australia
license (CC BY-NC-SA 3.0)

Micromite Plus Manual Page 2
The Micromite Plus is part of the Micromite family. . The firmware runs on 64 and 100-pin PIC32
microcontrollers and implements all the features of the standard Micromite as described in the Micromite User
Manual. It also has many additional features and they are described in this document.
The focus of this manual is to describe just the features that are unique to the Micromite Plus. For general
Micromite programming you should refer to the Micromite User Manual in addition to this manual.
Contents
Introduction............................................................................................................................. 3
Suitable Microcontrollers........................................................................................................ 6
Micromite Plus Connections................................................................................................... 7
Programming the Firmware.................................................................................................... 9
SPI Based LCD Displays...................................................................................................... 10
SSD1963 Based LCD Displays............................................................................................ 13
Touch Support...................................................................................................................... 17
SD Card Support.................................................................................................................. 19
Sound Output....................................................................................................................... 24
Basic Drawing Features ....................................................................................................... 26
Advanced Graphics.............................................................................................................. 29
Advanced Graphics Programming Techniques.................................................................... 34
Console Input/Output............................................................................................................ 38
Miscellaneous Features........................................................................................................ 40
Examples.............................................................................................................................. 41
Read Only Variables (extra for the Micromite Plus Only) ..................................................... 45
Commands (extra for the Micromite Plus Only).................................................................... 46
Functions (extra for the Micromite Plus Only)....................................................................... 57

Micromite Plus Manual Page 3
Introduction
This section provides an introduction for users who are familiar with the Micromite and need a summary of the
extra features in the Micromite Plus.
The Micromite Plus is an extension of the standard Micromite; all features of the standard Micromite are also
supported in the Micromite Plus. This includes features of the BASIC language, input/output, communications,
etc. Some commands have changed slightly (for example the CPU command) but for the main part Micromite
programs will run unchanged on the Micromite Plus.
The following summarises the new features in the Micromite Plus as compared to the standard Micromite:
MX470 Processor
The Micromite Plus is based on the Microchip PIC32MX470 32 bit microcontroller. This chip is available in
64 and 100-pin surface mount packages and is two to three times faster than the MX170 chip used in the
standard Micromite. In BASIC the space available for both programs and variables is doubled to approx 100
KB flash and 100KB RAM.
The Micromite Plus uses a crystal for timekeeping. This allows the Micromite Plus to support USB
communications and also ensures that its internal clocks are much more accurate.
I/O Pins
The 64-pin Micromite Plus has up to 45 free I/O pins and the 100-pin chip 77. Of these 28 pins (on either chip)
can be analog inputs.
The Micromite Plus has two SPI ports and up to four serial COM ports. All serial COM ports are high speed
(over 1,000,000 baud). The provision of two SPI ports means that one can be used for SPI LCD's, touch and
SD card interfaces leaving the other entirely free for use in a BASIC program. If the SPI is not used for these
features then both SPI interfaces can be used in BASIC programs.
USB
The Micromite Plus has a built in USB 2.0 interface which will work at all CPU frequencies at 20MHz or more.
The USB is integrated in the chip and no other hardware or components are required. MMBasic uses the USB
CDC protocol which allows the USB interface to be used as the console with a host computer running a
terminal emulator such as Tera Term.
The USB console operates in parallel with the serial console, anything received from either of the inputs is
placed in the input queue for the interpreter or the program to read and anything outputted by the program or
interpreter will be sent to either devices.
The USB feature is optional, if nothing is connected to the USB interface MMBasic will ignore it.
SD Card
The Micromite Plus includes full support for SD cards. This includes opening files for reading, writing or
random access and loading and saving programs. The firmware will work with cards up to 64GB formatted in
FAT16 or FAT32 and the files created can also be read and written on personal computers running Windows,
Linux or the Mac operating system.
Up to 10 files can be open simultaneously. Using the OPEN command files can be opened and read from using
INPUT, LINE INPUT, or INPUT$() or written to using PRINT or WRITE with. A program can be saved using
the SAVE command and reloaded or run using LOAD. Programs and files stored on the card can be listed with
the FILES command and deleted using the KILL command. The current working directory can be changed
using CHDIR and a new directory be created with MKDIR.
The LOAD IMAGE command can be used to load a bitmap image from the SD card and display it on an
attached LCD display panel. This can be used to draw a logo or add a background on the display.
The SD card feature is entirely optional and MMBasic will operate normally if it is not used.
LCD Display Panels
Micromite Plus supports two additional LCD panels that use SPI controllers (the ST7735 and ILI9163) and also
parallel LCD displays that use the SSD1963 controller.
SSD1963 based LCD panels are available in sizes from 4.3 inch to 8 inch for prices that range from US$30 to
US$60 on eBay. They use a parallel interface so the Micromite Plus can transfer data much faster than via SPI
resulting in a very quick screen update. These displays are also much larger, have more pixels and are brighter.
MMBasic will drive them using 24-bit true colour for a full colour rendition (16 million colours).

Micromite Plus Manual Page 4
All LCD panels that use the SSD1963 controller have a SD card socket and touch sensitive screen, both of which
are fully supported by MMBasic on the Micromite Plus.
The LCD display panel feature is entirely optional and if not configured MMBasic will operate normally.
Additional LCD Panel Features
The Micromite Plus includes six fonts that are built in and provides for up to ten additional fonts that can be
embedded in the program. It also provides a set of read only variables to return the coordinates of the next print
position on the screen.
An optional PWM (Pulse Width Modulated) output is available for controlling the brightness of the LCD
backlight. In addition the Micromite Plus will work with SSD1963 based LCD panels that are configured to
use their controller to control the backlight.
Touch Input
The Micromite Plus extends the standard Micromite touch sensitive features with two new capabilities:
Functions to detect if the touch is down or up, to return reference of the control currently being touched
(see "Advanced Graphics" below) and also the last position or control touched.
The ability to drive a connected Piezo buzzer to produce a click when a screen control is touched.
Advanced Graphics
The Micromite Plus incorporates a suite of advanced graphic controls that respond to touch, these include on
screen switches, buttons, indicator lights, keyboard, etc. MMBasic will draw the control and animate it (ie, a
switch will depress when touched). All that the BASIC program needs to do is invoke a single line command
to specify the basic details of the control.
Using these advanced graphic controls it is easy to create a sophisticated control panel that includes WISWIG
screen elements that are familiar to uses of modern computers (eg, check boxes, radio buttons, etc). A
Micromite Plus using these controls could be used to create a professional control panel for anything from
industrial machinery to a simple reticulation controller.
With some LCD displays the Micromite Plus supports transparent text (ie, the background image shows
through the gaps in the text) and the BLIT command. The latter allows the background image to be saved and
then restored allowing moving objects to be displayed over a background image.
Console Input/Output
You can attach a PS2 keyboard to the Micromite Plus and, if you are using a SSD1963 based LCD panel,
display the output of the interpreter in the LCD. This turns the Micromite Plus into a completely self contained
computer with its own keyboard, display and SD card for storage. Using the built in colour coded editor
programs can be entered, edited and run without requiring another computer.
The keyboard interface supports the standard USA keyboard layout or special United Kingdom, French,
German, Belgium, Italian or Spanish layouts.
Sound Output
Using the Micromite Plus you can play stereo WAV files stored on the SD card. You can also generate precise
sine waves with selectable frequencies from 1Hz to 20KHz.
Miscellaneous
Other features of the Micromite Plus include:
The ability to disable the serial console if it is not required. This allows the two I/O pins previously used
by the console to be used as general I/O pins or as a fourth serial port (COM4:).
The CPU command can vary the processor speed from 5MHz to 120MHz. The CPU command can also
put the processor to sleep.
The ability to specify the I/O pins used for connecting to a real time clock. When this option is specified
MMBasic will automatically get the correct time on power up.

Micromite Plus Manual Page 5
Micromite Family Summary
Micromite Micromite Plus
28-pin
Dual In Line
44-pin
SMD 64-pin
SMD 100-pin
SMD
Maximum CPU Speed 48MHz 48MHz 120MHz 120MHz
Maximum BASIC Program Size 59KB 59KB 100KB 100KB
RAM Memory Size (used for variables, buffers, etc) 52KB 52KB 108KB 108KB
Clock Speed (MHz) 5 to 48 5 to 48 5 to 120 5 to 120
Serial Console for Programming and Control
USB Console (serial emulator over USB 2.0)
PS2 Keyboard and LCD Display Console
SD Card Interface (FAT16 or FAT32 up to 64GB)
Total Number of I/O pins 19 33 45 77
Number of Analog Inputs 10 13 28 28
Number of Serial I/O ports 2 2 3 or 4 3 or 4
Number of SPI Channels 1 1 2 2
Number of I2C Channels 1 1 1 + RTC 1 + RTC
Maximum Number of 1-Wire I/O pins 19 33 45 77
Number of PWM or Servo Channels 5 5 5 5
Supports 2.2", 2.4" and 2.8" SPI LCD Displays
Supports eleven LCD Displays from1.4" to 8"
Supports Resistive Touch Panels
Power Requirements 3.3V 30mA
3.3V 30mA
3.3V 80mA
3.3V 80mA

Micromite Plus Manual Page 6
Suitable Microcontrollers
The microcontroller used in the Micromite Plus is available in two different frequency specifications (100MHz
and 120MHz). The Micromite Plus will start up at 100MHz and if you have a 120MHz chip you can use the
CPU command to step up to 120MHz. See http://microchip.com for the data sheets.
The recommended chips are:
PIC32MX470F512H-I/PT 64-pin TQFP package – maximum speed 100MHz
PIC32MX470F512H-120/PT 64-pin TQFP package – maximum speed 120MHz
PIC32MX470F512L-I/PF 100-pin TQFP package – maximum speed 100MHz
PIC32MX470F512L-120/PF 100-pin TQFP package – maximum speed 120MHz
All these chips are in a TQFP surface mount package with a lead pitch of 0.5mm. They are reasonably easy to
solder and can be mounted on a carrier board (for example futurlec.com part code 64PINTQFP) or the
Explore64 which is a breadboard compatible PCB or the Explore100 which is designed to mate with a 5"
display (see http://geoffg.net/micromite.html for examples).
Typical Circuit
Note that the pin numbers refer to the 64-pin chip. For the 100-pin chip refer to the table in the next section.
Note that the only required components are:
The capacitor on pin 56 (Vcap). This must be a tantalum (47µF) or multilayer ceramic (10µF) type.
The 20MHz crystal and its two 27pF load capacitors.
The 10KΩ pullup resistor on pin 7 (MCLR).

Micromite Plus Manual Page 7
Micromite Plus Connections
The tick column ANA means ANALOG, DIG means digital I/O and 5V means a 5V tolerant pin. Pins marked
SSD1963 xxx are required for a SSD1963 based display - see the "Micromite Advanced Features" manual for
more details. Otherwise the notation is similar as described for the 28-pin version.
64-pin Micromite Plus A
N
A
D
I
G
5
V
5
V
D
I
G
A
N
A
DIGITAL INPUT ONLY
33
32 PWM 2B
USB +5V 34
31
POWER (+2.3 to +3.6V) 35
30
USB D- 36
29 COM1: ENABLE
USB D+ 37
28 SSD1963 RESET
POWER (+2.3 to +3.6V) 38
27 SSD1963 RS (data/command)
20MHz CRYSTAL) 39
26 POWER (+2.3 to +3.6V)
20MHz CRYSTAL) 40
25 GROUND
GROUND 41
24 SSD1963 WR
PWM 1B 42
23 COUNT
I2C DATA
43
22
I2C CLOCK 44
21
SPI 1 IN (MISO) 45
20 ANALOG GROUND
46
19 ANALOG POWER (+2.3 to +3.6V)
SPI 2 IN (MISO) 47
18
PWM 1A 48
17 COM3: Rx
COUNT 49
16 COM3: Tx
SPI 1 CLOCK 50
15 COM1: Tx
COUNT | WAKEUP | IR 51
14
COUNT 52
13 COM2: Rx
PWM 2A 53
12
KEYBOARD CLOCK 54
11 COM2: Tx
KEYBOARD DATA
55
10 POWER (+2.3 to +3.6V)
47µF TANT CAPACITOR (+) 56
9 GROUND
POWER (+2.3 to +3.6V) 57
8 SPI 1 OUT (MOSI)
COM4: Tx | CONSOLE Tx (OUT) 58
7 RESET Normally 10KΩ to V+
COM1: Rx
59
6 CONSOLE Rx (IN) | COM4: Rx
SSD1963 D0 60
5 SPI 2 OUT (MOSI) |
SSD1963 D1 61
4 SPI 2 CLOCK
SSD1963 D2 62
3 SSD1963 D7
PWM 1C | SSD1963 D3 63
2 SSD1963 D6
SSD1963 D4 64
1 SSD1963 D5

Micromite Plus Manual Page 8
100-pin Micromite Plus A
N
A
D
I
G
5
V 5
V D
I
G
A
N
A
DIGITAL INPUT ONLY
51
F3
F5
50
52
F2
F4
49
53
F8
D15
48
USB +5V
54
D14
47
POWER (+2.3 to +3.6V)
55
46
POWER (+2.3 to +
3.6V)
USB D
-
56
45
GROUND
USB D+
57
B15
44
58
A2
B14
43
COM1: ENABLE
59
A3
B13
42
SSD1963 RESET
60
A4
B12
41
61
A5
F12
40
POWER (+2.3 to +3.6V)
62
F13
39
20MHz CRYSTAL
)
63
A1
38
20MHz CRYSTAL
)
64
37
POWER (+2.3 to +3.6V)
GROUND
65
36
GROUND
I
2
C CLOCK
66
A14
B11
35
I
2
C DATA
67
A15
B10
34
COUNT
PWM 1B
68
D8
33
69
D9
B8
32
SPI 1 CLOCK
70
D10
3
1
ANALOG
GROUND
SPI 1 IN (MISO)
71
D11
30
ANALOG
POWER (+2.3 to +3.6V)
SPI 1 OUT (MOSI)
72
D0
A10
29
73
C13
A9
28
PWM 1A
74
C14
B7
27
GROUND
75
B6
26
COM3: Rx
COUNT
76
D1
B0
25
COM3
: Tx
77
D2
B1
24
COM1: Tx
COUNT | WAKEUP | IR
78
D3
B2
23
PWM 1C
79
D12
B3
22
COM2: Rx
80
D13
B4
21
COUNT
81
D4
B5
20
COM2: Tx
PWM 2A
82
D5
E9
19
SSD1963
WR
KEYBOARD CLOCK
83
D
6
E8
18
SSD1963 RS (data/command)
KEYBOARD DATA
84
D7
A0
17
47µF TANT CAPACITOR (+)
85
16
POWER (+2.3 to +3.6V)
POWER (+2.3 to +3.6V)
86
15
GROUND
COM4: Tx |
CONSOLE Tx (OUT)
87
F0
G9
14
COM1: Rx
88
F1
13
RESET
Normally
10K
Ω to V+
COM4: Rx | CONSOLE Rx (IN
)
89
G1
G8
12
SPI 2 OUT (MOSI)
90
G0
G7
11
SPI 2 IN (MISO)
91
A6
G6
10
SPI 2 CLOCK
92
A7
C4
9
PWM 2B
SSD1963 D0
93
E0
8
SSD1963 D1
9
4
E1
C2
7
95
G14
C1
6
96
G12
E7
5
SSD1963 D7
97
G13
E6
4
SSD1963 D6
SSD1963 D2
98
E2
E5
3
SSD1963 D5
SSD1963 D3
99
E3
2
POWER (+2.3 to +3.6V)
SSD1963 D4
100
E4
G15
1

Micromite Plus Manual Page 9
Programming the Firmware
Programming the 64 and 100-pin Micromite Plus is similar to programming the 28-pin standard Micromite
described in the Micromite User Manual.
Refer to the following table for the pin connections to a PICkit 3 programmer:
PICkit 3
Pins Description 64-pin Micromite Plus
Pin Numbers 100-pin Micromite Plus
Pin Numbers
47µF Tantalum Capacitor to GND 56 85
1 - MCLR Master Reset (active low) 7 13
2 - Vcc Power Supply (3.3V) 10, 19, 26, 35, 38, and 57 2, 16, 30, 37, 46, 55, 62
and 86
3 - GND Ground 9, 20, 25 and 41 15, 31, 36, 45, 65 and 75
4- PGD Programming Data 16 25
5 - PGC Programming Clock 15 24
6 - NC Not used
Notes:
A pullup resistor of 10K is required between the MCLR pin and Vcc.
A crystal is not required to program these chips and will be ignored if it is present.
The microcontroller being programmed can be powered by the PICkit 3 but it is recommended that a
separate power supply be used. When the PICkit 3 supplies the power pin 2 (Vcc) on the PICkit 3 will
become an output supplying the power to the chip being programmed.

Micromite Plus Manual Page 10
SPI Based LCD Displays
The Micromite Plus includes support for three types of colour LCD display panels using a SPI interface. These
are the:
Standard 2.2”, 2.4" and 2.8” 240x320 pixel display with an ILI9341 controller as described in the
Micromite User Manual.
A 1.8" 128x160 pixel display with a ST7735 controller
A 1.44" 128x128 pixel display using the ILI9163 controller.
On eBay you can find suitable displays by searching for the controller name (ILI9341, ST7735 or ILI9163).
ILI9341 Based Displays
The ILI9341 based displays are illustrated on the right.
They use an SPI interface and have the following basic
specifications:
A 2.2, 2.4 or 2.8 inch display
Resolution of 240 x 320 pixels and a colour depth of
262K/65K
A ILI9341 controller with a SPI serial interface
ST7735 Based Displays
The ST7735 based displays also use a SPI interface and are smaller than the
ILI9341 based displays. ST7735 displays have the following basic
specifications:
A 1.8 inch display
Resolution of 128 x 160 pixels and a colour depth of 262K/65K
A ST7735 controller with a SPI serial interface
These do not come with a touch controller.
A typical ST7735 based display is illustrated on the right. On eBay
you can find suitable displays by searching for the controller name
(ST7735).
ILI9163 Based Displays
ILI9163 based displays have a 1.44 inch display with 128x128 pixels. They
have an SPI interface and use the same connections as ST7735 based displays.
ILI9163 based displays use an SPI interface and have the following basic
specifications:
A 1.44 inch display
Resolution of 128 x 128 pixels
A ILI9163 controller with a SPI serial interface
A typical ILI9163 based display is illustrated on the right. On eBay you can
find suitable displays by searching for the controller name (ILI9163).
Be warned, apparently some displays with a red PCB have a fault and will not
work with the Micromite Plus. So, you should choose a display with a black
PCB (as illustrated) as these have been tested and work correctly

Micromite Plus Manual Page 11
Connecting SPI Based LCD Panels
The SPI based display controllers share the second SPI channel (SPI2) interface on the Micromite Plus with the
touch controller (if present) and the SD Card interface if implemented. If any of these features are enabled SPI2
will also be unavailable to BASIC programs (which can use the first SPI channel instead).
The following table lists the connections required between the ILI9341, ST7735 and ILI9163 based LCD display
board and the Micromite Plus:
ILI9341
Display
ST7735 or
ILI9163
Display Description Micromite Plus
64-pin
version
Micromite Plus
100-pin
version
T_IRQ Touch Interrupt Configurable (see Touch Support)
T_DO Touch Data Out (MISO) Pin 47 Pin 11
T_DIN Touch Data In (MOSI) Pin 5 Pin 12
T_CS Touch Chip Select Configurable (see Touch Support)
T_CLK Touch SPI Clock Pin 4 Pin 10
SDO (MISO) Display Data Out (MISO) Pin 47 Pin 11
LED LED Power supply for the backlight (see below)
SCK SCK Display SPI Clock Pin 4 Pin 10
SDI (MOSI) SDA Display Data In (MOSI) Pin 5 Pin 12
D/C A0 Display Data/Command Control Configurable
RESET RESET Display Reset (when pulled low) Configurable
CS CS Display Chip Select Optional - Configurable
GND GND Ground
VCC VCC 5V supply (the controller draws less than 10mA)
Where a Micromite Plus connection is listed as "configurable" the specific pin should be specified with the
OPTION LCDPANEL or OPTION TOUCH commands (see below).
The backlight power (the LED connection) should be supplied from the main 5V supply via a current limiting
resistor. A typical value for this resistor on the ILI9341 based LCD display is 18Ω for a current of about 63mA
and on the ST7735 or ILI9163 display is 39Ω for a current of about 30mA. The value of this resistor can be
varied to reduce the power consumption or to provide a brighter display.
Important: Care must be taken with display panels that share the SPI port between a number of devices (display
controller, touch, etc). In this case all the Chip Select signals must be configured in MMBasic or disabled by a
permanent connection to 3.3V. If this is not done any unconnected Chip Select pins will float causing the wrong
controller to respond to commands on the SPI bus.
Configuring an SPI Based LCD Panel
To use the display MMBasic must be configured using the OPTION LCDPANEL command which must be
entered at the command prompt (not in a program).
The syntax is:
OPTION LCDPANEL controller, orientation, D/C pin, reset pin [,CS pin]
Where:
'controller' can be either ILI9341, ST7735 or ILI9163.
'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.
'C/D pin' and 'reset pin' are the Micromite I/O pins to be used for these functions. Any free pin can be used.

Micromite Plus Manual Page 12
'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.
To test the display you can enter the command GUI TEST LCDPANEL. You should see an animated display of
colour circles being rapidly drawn on top of each other. Press the space bar on the console’s keyboard to stop the
test.
Important: The above test may not work if the display has a touch controller and the touch controller has not been
configured (ie, the touch Chip Select pin is floating). In this case configure the touch controller (see below) and
then retry GUI TEST LCDPANEL.
To verify the configuration you can use the command OPTION LIST to list all options that have been set
including the configuration of the LCD panel.
Examples
For the 64-pin Micromite Plus the following allocations are recommended:
Pin 44 for the display Chip Select
Pin 43 for the display Data/Command control
Pin 42 for the display reset control
Pin 45 for the touch Chip Select
Pin 46 for the touch IRQ input
Pin 52 is the SD card Chip Select
The corresponding configuration commands are:
OPTION LCDPANEL ILI9341, L, 44, 43, 42
OPTION TOUCH 45, 46
OPTION SDCARD 52
These match the pin allocations on the TFT Backpack+ PCB board offered by CircuitGizmos. See:
http://circuitgizmos.com/gizmo-store/#!/TFT-Backpack+-PCB-Peter-Mather/p/65473479

Micromite Plus Manual Page 13
SSD1963 Based LCD Displays
In addition to the SPI based controllers the Micromite Plus also supports colour LCD displays using the SSD1963
controller. These use a parallel interface, are available in sizes from 4.3" to 8" and have better specifications than
the smaller displays. Typically they cost about US$30 for the 4.3" version to US$50 for the 7" version. All these
displays have an SD card socket which is fully supported by MMBasic on the Micromite Plus.
On eBay you can find suitable displays by searching for the controller name (SSD1963).
Because the SSD1963 controller uses a parallel interface the Micromite Plus can transfer data much faster than an
SPI interface resulting in a very quick screen update. These displays are also much larger, have more pixels and
are brighter. MMBasic drives them using 24-bit true colour for a full colour rendition (16 million colours).
The characteristics of these displays are:
A 4.3, 5, 7 or 8 inch display
Resolution of 480 x 272 pixels (4.3" version) or 800 x 480 pixels (5”, 7" or 8" versions).
A SSD1963 display controller with a parallel interface (8080 format).
A touch controller (SPI interface).
A full sized SD card socket.
There are a number of different designs
using the SSD1963 controller but
fortunately most Chinese suppliers have
standardised on a single connector as
illustrated below. It is strongly
recommended that any display purchased
has a matching connector – this provides
some confidence that the manufacturer
has followed the standard that the
Micromite Plus is designed to use.

Micromite Plus Manual Page 14
Connecting an SSD1963 Based LCD Panel
The SSD1963 controller uses a parallel interface while the touch controller and SD card use an SPI interface. The
touch and SD card features are optional but if they are used they will use the second SPI port (SPI2).
The following table lists the connections required between the display board and the Micromite Plus to support
the SSD1963 interface and the LCD display. The touch controller and SD card interfaces are listed further below.
SSD1963
Display Description 64-pin
Micromite+ 100-pin
Micromite+
DB0 Parallel Data Bus bit 0 Pin 60 Pin 93
DB1 Parallel Data Bus bit 1 Pin 61 Pin 94
DB2 Parallel Data Bus bit 2 Pin 62 Pin 98
DB3 Parallel Data Bus bit 3 Pin 63 Pin 99
DB4 Parallel Data Bus bit 4 Pin 64 Pin 100
DB5 Parallel Data Bus bit 5 Pin 1 Pin 3
DB6 Parallel Data Bus bit 6 Pin 2 Pin 4
DB7 Parallel Data Bus bit 7 Pin 3 Pin 5
CS Chip Select (active low) Ground (ie, always selected)
WR Write (active low) Pin 24 Pin 19
RD Read (active low) Configurable
RS Command/Data Pin 27 Pin 18
RESET Reset the SSD1963 Pin 28 Pin 42
LED_A Backlight control for an unmodified display panel Configurable
5V 5V power for the backlight on some displays (most displays use the 3.3V supply for this).
3.3V Power supply.
GND Ground
The following table lists the connections required to support the touch controller interface:
SSD1963
Display Description 64-pin
Micromite+ 100-pin
Micromite+
T_CS Touch Chip Select Configurable
T_IRQ Touch Interrupt Configurable
T_DIN Touch Data In (MOSI) Pin 5 Pin 12
T_CLK Touch SPI Clock Pin 4 Pin 10
T_DO Touch Data Out (MISO) Pin 47 Pin 11
The following table lists the connections required to support the SD card connector:
SSD1963
Display Description 64-pin
Micromite+ 100-pin
Micromite+
SD_CS SD Card Chip Select Configurable
SD_DIN SD Card Data In (MOSI) Pin 5 Pin 12
SD_CLK SD Card SPI Clock Pin 4 Pin 10
SD_DO SD Card Data Out (MISO) Pin 47 Pin 11

Micromite Plus Manual Page 15
Where a Micromite connection is listed as "configurable" the specific pin should be specified in the appropriate
OPTION command (see below).
Most SSD1963 based LCD panels have three pairs of
solder pads on the PCB which are grouped under the
heading "Backlight Control" as illustrated on the right.
Normally the pair marked "LED-A" are shorted together
with a zero ohm resistor and this allows control of the
backlight's brightness with a PWM (pulse width
modulated) signal on the LED-A pin of the display
panel's main connector.
The Micromite Plus fully supports this form of control
and if you do not want to be bothered with the details
you can specify the I/O pin used to drive the LED-A pin
in the OPTION LCDPANEL command (below).
However, it is better to use the SSD1963 controller to generate this signal as it frees up one I/O pin and it allows
the brightness to be controlled with a finer degree of resolution (1% instead of 5% steps). To use the SSD1963 for
brightness control the zero ohm resistor should be removed from the pair marked "LED-A" and used to short the
nearby pair of solder pads marked "1963-PWM". The Micromite Plus can then control the brightness via the
SSD1963 controller.
In either case the BACKLIGHT command will work the same and can be used to dynamically change the
display's brightness.
Generally 7 inch and larger displays have a separate pin on the connector (marked 5V) for powering the backlight
from a 5V supply. If this pin is not provided the backlight power will be drawn from the 3.3V pin. Note that the
power drawn by the backlight can be considerable. For example, a 7 inch display will typically draw 330mA
from the 5V pin.
Care must be taken with display panels that share the SPI port between a number of devices (SD card, touch, etc).
In this case all the Chip Select signals must configured in MMBasic or disabled by a permanent connection to
3.3V. If this is not done the pin will float causing the wrong controller to respond to commands on the SPI bus.
On the Micromite Plus the second SPI channel (SPI2) is used to communicate with the touch controller and the
SD Card interface. If any of these features are enabled SPI2 will be unavailable to BASIC programs (which can
use the first SPI channel instead).
Configuring an SSD1963 Based LCD Panel
To use the display MMBasic must be configured using the OPTION LCDPANEL command which must be
entered at the command prompt (not in a program).
The syntax is:
OPTION LCDPANEL controller, orientation [,LCD-A pin] [,RD pin]
Where:
'controller' can be either:
SSD1963_4 For a 4.3 inch display
SSD1963_5 For a 5 inch display
SSD1963_5A For an alternative version of the 5 inch display if SSD1963_5 does not work
SSD1963_7 For a 7 inch display
SSD1963_7A For an alternative version of the 7 inch display if SSD1963_7 does not work.
SSD1963_8 For an 8 inch display.
'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.
'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 (see the notes above).
'RD pin' can also be any I/O pin and is connected to the RD (read) pin of the LCD display panel. This is optional
and if specified will allow the use of transparent text and the BLIT command (transparent text is displayed when
the background colour is specified as -1).

Micromite Plus Manual Page 16
This command only needs to be run once. From then on MMBasic will automatically initialise the display on
startup or reset. In some circumstances it may be necessary to interrupt power to the LCD panel while the
Micromite is running (eg, to save battery power) and in that case the GUI RESET LCDPANEL command can
be used to reinitialise the display.
If the LCD panel is no longer required the command OPTION LCDPANEL DISABLE can be used which will
return the I/O pins for general use.
To verify the configuration you can use the command OPTION LIST to list all options that have been set
including the configuration of the LCD panel.
To test the display you can enter the command GUI TEST LCDPANEL. You should see an animated display of
colour circles being rapidly drawn on top of each other. Press the space bar on the console’s keyboard to stop the
test.
100-Pin Example
The Explore 100 board with the 100-pin Micromite Plus uses the following pin allocations:
Pin 48 is the SSD1966 LED_A control
Pin 6 is the SSD1963 RD pin
Pin 1 is the touch Chip Select
Pin 40 is the touch IRQ input
Pin 39 is the touch click output (see the next chapter)
Pin 47 is the SD card Chip Select
The corresponding configuration commands are:
OPTION LCDPANEL SSD1963_5, LANDSCAPE, 48, 6
OPTION TOUCH 1, 40, 39
OPTION SDCARD 47
Because the RD pin is specified for the SSD1963 display programs will be able to display transparent text and use
the BLIT command.
64-Pin Example
For the Explore 64 board (64-pin Micromite Plus) the following allocations are recommended:
Pin 12 for the SSD1966 LED_A control
Pin 51 for the touch Chip Select
Pin 33 for the touch IRQ input
Pin 50 for the touch click output (see the next chapter)
Pin 52 is the SD card Chip Select
The corresponding configuration commands are:
OPTION LCDPANEL SSD1963_5, LANDSCAPE, 12
OPTION TOUCH 51, 33, 50
OPTION SDCARD 52
These match the pin allocations on the TFT Backpack+ PCB board offered byCircuitGizmos. See:
http://circuitgizmos.com/gizmo-store/#!/TFT-Backpack+-PCB-Peter-Mather/p/65473479
Because the RD pin is not specified programs will not be able to use transparent text and the BLIT command.

Micromite Plus Manual Page 17
Touch Support
The Micromite User Manual describes how to setup and calibrate a resistive touch sensitive panel. This section
concentrates on the additional features offered by the Micromite Plus.
Configuring Touch
To configure the Micromite Plus for a touch panel the OPTION TOUCH command is used:
OPTION TOUCH T_CS pin, T_IRQ pin [, click pin]
Where:
'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).
'click pin' is exclusive to the Micromite Plus and specifies an I/O pin that will be driven briefly high when a
screen control is touched. This can be used to drive a small Piezo buzzer which will produce a click sound
providing an audible feedback when a GUI element on the screen is activated (see the section "Graphical User
Interface Commands").
A typical buzzer that can be used is Altronics Part Number S6108 or S6104
Note that most I/O pins on the Micromite Plus are capable of driving 15mA (pins 50, 44 and 6 on the 64-pin
chip can drive 30mA). However many buzzers require more that this so a transistor might be necessary to
buffer the Micromite Plus output and drive the buzzer.
This command only needs to be run once as the parameters are stored in non volatile memory.
Calibrating the Touch Screen
Calibrating the touch screen is done using the GUI CALIBRATE command. When run this command will
present a series of four targets on the screen that must be touched.
This process is fully described in the Micromite User Manual.
Touch Functions
To detect if and where the screen is touched you can use the following functions in a BASIC program.
Note that the first two functions are common across all versions of the Micromite, the remainder are unique to
the Micromite Plus.
TOUCH(X)
Returns the X coordinate of the currently touched location or -1 if the screen is not being touched.
TOUCH(Y)
Returns the Y coordinate of the currently touched location or -1 if the screen is not being touched.
TOUCH(DOWN)
Returns true if the screen is currently being touched (this is much faster than TOUCH(X or Y)).
TOUCH(UP)
Returns true if the screen is currently NOT being touched (also faster than TOUCH(X or Y))
TOUCH(LASTX)
Returns the X coordinate of the last location that was touched.
TOUCH(LASTY)
Returns the Y coordinate of the last location that was touched.
TOUCH(REF)
Returns the reference number of the control that is currently being touched or zero if no control is being
touched. See the section Advanced Graphics for more details.
TOUCH(LASTREF)
Returns the reference number of the control that was last touched.

Micromite Plus Manual Page 18
The GUI BEEP Command
The Piezo buzzer specified in the OPTION TOUCH command can also be driven by a BASIC program using
the command:
GUI BEEP msec
Where 'msec' is the number of milliseconds that the beeper should be driven. A time of 3ms produces a click
while 100ms produces a short beep.
Touch Interrupts
On the Micromite Plus the GUI INTERRUPT command is used to setup a touch interrupt. The syntax is:
GUI INTERRUPT down [, up]
Where 'down' is the subroutine to call when a touch down has been detected. And optionally 'up' is the
subroutine to call when the touch has been lifted from the screen ('up' and 'down' can point to the same
subroutine if required).
As an example, the following program will print out the X and Y coordinates of any touch on the screen:
GUI INTERRUPT MyInt
DO : LOOP
SUB MyInt
PRINT TOUCH(X) TOUCH(Y)
END SUB
Specifying the number zero (single digit) as the argument will cancel both up and down interrupts. ie:
GUI INTERRUPT 0

Micromite Plus Manual Page 19
SD Card Support
The Micromite Plus has full support for SD cards. This includes opening files for reading, writing or random
access and loading and saving programs.
The firmware will work with cards up to 64GB formatted in FAT16 or FAT32 and the files created can also be
read/written on personal computers running Windows, Linux or the Mac operating system.
The basic circuit diagram for connecting the SD card connector to the 64-pin Micromite Plus is illustrated
below. Note that the pin number used for Card Enable is selected when configuring the interface.
Care must be taken with display panels that share the SPI port between a number of devices (SD card, touch, etc).
In this case all the Chip Select signals must configured in MMBasic or alternatively disabled by a permanent
connection to 3.3V. If this is not done any floating Chip Select signal lines will cause the wrong controller to
respond to commands on the SPI bus.
Configuring the SD Card
To use the SD card MMBasic must be configured using the OPTION SDCARD command which must be entered
at the command prompt (not in a program).
The syntax is:
OPTION SDCARD CS-pin [, CD-pin [,WP pin]]
Where:
'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 normally pulled high but, when a card
is inserted, it will be connected to ground and the signal line pulled low. On some connectors this signal is not
provided and in that case the Micromite Plus would 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 normally pulled high but, when a card
is write protected, it will be connected to ground and the signal line pulled low.
The state of the 'CD-pin' and 'WP-pin' can also be read using the PIN() function which is useful for checking the
status of an SD card before opening it..
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.
To verify the configuration you can use the command OPTION LIST to list all options that have been set
including the configuration of the SD Card.
Specific Examples
On the Explore 64 module (http://www.rictech.nz/pages/5/Products) the SD Card Chip Select (CS) signal is on
pin 12 and the Card Detect (CD) signal is on pin 14. So, to enable the SD Card on this module the command is:
OPTION SDCARD 12, 14

Micromite Plus Manual Page 20
On the CGMICROBOARD2 module (www.circuitgizmos.com/products/cgmicroboard2/cgmicroboard2.shtml)
the SD Card Chip Select (CS) signal is on pin 49 and pin 30 is used for Card Detect). So, to enable the SD
Card on this module the command is: OPTION SDCARD 49, 30
The SnadPIC 100-pin PIC32 Module is useful if you are experimenting with the 100-pin Micromite Plus:
http://www.microcontroller-board.com/snadpic-board-32/14-snadpic-pic32mx470f512l-development-
board.html#/crystal_oscillator-20mhz/crystal_rtcc-no_without_crystal_r
This is the company's standard PIC32 experimental board modified to suit the Micromite Plus firmware (it has
a 20MHz crystal and does not include a RTC crystal). If you are purchasing this board make sure that you
specify these two details and the words "For Micromite" in the comments field.
On this module the SD Card Chip Select (CS) signal is on pin 14 and the Card Detect (CD) signal is on pin 18.
So, to enable the SD Card on this module the command is: OPTION SDCARD 14, 18
Note that on the 100-pin Micromite Plus pin 18 is used for driving a SSD1963 based LCD panel and will
conflict with its allocation as Card Detect. In this case the zero ohm resistor J3 on the underside of the
SnadPIC board must be removed so that SD Card Detect is no longer on pin 18. Another pin may be selected
via the CD pin on the top of the board.
MMBasic Support
MMBasic on the Micromite Plus supports the standard BASIC commands for working with storage systems.
Note that:
Long file/directory names are supported in addition to the old 8.3 format.
The maximum file/path length is 127 characters.
Upper/lowercase characters and spaces are allowed although the file system is not case sensitive.
Directory paths are allowed in file/directory strings. (ie, OPEN "\dir1\dir2\file.txt" FOR …).
Either forward or back slashes can be used in paths. Eg \dir\file.txt is the same as /dir/file.txt.
The current Micromite time is used for file create and last access times.
Up to ten files can be simultaneously open.
The CPU speed must be 30MHz or higher.
In the following commands/functions the # in #fnbr is optional and may be omitted.
OPEN fname$ FOR mode AS #fnbr
Opens a file for reading or writing. 'fname$' is the file name in 8.3 format. 'mode' can be INPUT,
OUTPUT, APPEND or RANDOM. ‘#fnbr’ is the file number (1 to 10).
PRINT #fnbr, expression [[,; ]expression] … etc
Outputs text to the file opened as #fnbr.
INPUT #fnbr, list of variables
Read a list of comma separated data into the variables specified from the file previously opened as #fnbr.
LINE INPUT #fnbr, variable$
Read a complete line into the string variable specified from the file previously opened as #fnbr.
CLOSE #fnbr [,#fnbr] …
Close the file(s) previously opened with the file number ‘#fnbr’.
Programs can be loaded from or saved to the SD card using two commands.
LOAD fname$ [, R]
Load a BASIC program from the SD Card. The optional suffix ",R" will cause the program to be run after
it has been loaded.
SAVE fname$
Save the current program to the SD card.
Images can be loaded from or saved to the SD card using two commands.
LOAD IMAGE fname$
Load a BMP file and display it on the LCD screen.
Table of contents
Other Micromite Microcontroller manuals
Popular Microcontroller manuals by other brands

Analog Devices
Analog Devices ADuCM360 Getting started guide

Motorola
Motorola G24 Guide Developer's guide

Cypress Semiconductor
Cypress Semiconductor enCoRe CY7C601xx manual

Holtek
Holtek HT827A0 manual

NXP Semiconductors
NXP Semiconductors MC68HC16Z1 user manual

Texas Instruments
Texas Instruments Serial Programming Adapter MSP430 user guide

Cypress
Cypress UNIVERSAL CAPSENS CY3280-BBM quick start guide

Philips
Philips P89LPC920 user manual

Silicon Radar
Silicon Radar SiRad Simple user guide

Microsemi
Microsemi AcuEdge Development Kit for Amazon AVS... Quick start card

Axiom
Axiom DEMO9S08SE8 user guide

Texas Instruments
Texas Instruments MSP430F6765 manual