This is only a preview of the February 2021 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
Make it with Micromite
Phil Boyce – hands on with the mighty PIC-powered, BASIC microcontroller
Part 25: MMBASIC, Micromite and Maximite varieties
F
or those of you who have
followed this series over the last two
years, I hope that somewhere along
the journey you have been encouraged to
get involved and try some of the topics
presented. If so, you should be able to
see just how easy it is to implement an
idea, and program a microcontroller to
do something intelligent and/or useful.
From the feedback we get, many of you
have built the Micromite Keyring Computer
(MKC), and lots of you have told us that
you have been inspired enough to include
a Micromite in your own projects. This
was always the main intention of writing
these articles, so it is fantastic to hear about
the variety of Micromite-based projects
that you have created. However, we have
noticed that we are being asked on a more
frequent basis whether there is something
more powerful than the standard MKC, but
still as easy to use.
This is a good sign, as it implies that you
have really grasped how to use the MKC to
its maximum capabilities. The good news
is that ‘yes’, there are other Micromites
available that are more powerful than the
MKC, and this month we will discuss them.
Note that these alternative Micromites may
require a different version of MMBASIC to
be able to provide the additional features
they have to offer. We’ll highlight the main
differences between the various versions
of MMBASIC.
Finally, we will explore some of the
many different Micromite and Maximite
modules that are currently available.
For those of you that are relatively new
to this series, let’s start with a quick recap.
So why use a Micromite?
The fundamental purpose of this series
has been to demonstrate how software can
be used to control hardware. To be more
specific, how simple it can be (with the right
tools) to use a low-cost microcontroller at
the heart of an electronics project.
52
Unfortunately, many people are put
off using microcontrollers due to the
complexities of setting up a computerbased development environment, and
then having to learn how to use the
development tool (that’s before you
even start to write any code). Next comes
learning to use the required programming
language; ‘compiling’ the code in the right
format; uploading the relevant file(s) to
the microcontroller; and then – finally –
seeing the result of the running code. As
you can see, this whole process involves
many steps, so there is no debate that there
is a learning curve to master. Overall, it
is often regarded as a ‘big chore’ to go
through all these required steps. The
unfortunate result is that a lot of people
are probably put off before they begin, and
hence they miss out on the huge benefits
that a microcontroller can bring to literally
any electronics project.
We saw at the very beginning of this series
that MMBASIC is a solution which avoids
having to work through all the above steps.
Instead, MMBASIC makes it a simple task
(for anyone) to be able to control external
hardware with just a few lines of program
code. To use MMBASIC, it is loaded as
firmware (code) into a Microchip PIC chip,
the end result is called a ‘Micromite’ (or a
‘Maximite’ – more on this later).
MMBASIC is the creation of Geoff
Graham (geoffg.net) and what he has
created in MMBASIC should be regarded
as a real game-changer for those wanting
a quick, pain-free route to including a
microcontroller in a project.
With the Micromite, there is no
development environment to learn, no
complex coding language, and no need to
compile or upload code. Instead, you just
need a computer (or Raspberry Pi) onto
which a standard terminal application is
loaded (eg, TeraTerm, PuTTY or Terminal).
You also need a single USB lead. By using a
remarkably simple programming language
(MMBASIC), you can immediately start
to control external hardware connected
to the Micromite.
For anyone that may be thinking BASIC
is an ‘old language that died years ago’, or
even, ‘why use a Micromite at all?’, then
consider the following. A benchmark
I use with beginners is to show them
how to physically connect a red LED
to the Micromite, and then how to use
software to turn the LED on and off. Next,
I show them how to make the LED flash
by introducing a couple more commands.
After that, they add two more LEDs (yellow
and green) by themselves. On paper, I
show them the sequence of UK traffic
lights and leave it to them to write code to
simulate the traffic-light sequence on the
three coloured LEDs. The youngest person
I have taught this to was five years old,
and the oldest 104. Now the impressive
part. Bearing in mind they had near zero
knowledge of either coding or electronics
at the start of the exercise, the above is
always completed within 15 minutes –
something I have never seen achieved on
any other development platform.
In summary, MMBSAIC allows you to
be creative and achieve impressive results
very quickly, rather than requiring you to
be an experienced system-trained user
with a good understanding of a complex
coding language (which typically means a
thorough knowledge of command syntax).
For this reason alone, I consider MMBASIC
to be a creative tool that can be used by
anyone, rather than a system tool that is
used by a system-minded person. That
said, do not underestimate MMBASIC’s
power and capability – it has been used in
some very impressive solutions (a possible
topic for a future article).
Questions? Please email Phil at:
contactus<at>micromite.org
Practical Electronics | February | 2021
Micromite vs Maximite
We are often asked what the difference is
between a Micromite and a Maximite, and
the simple answer is: a Maximite is like a
standalone computer, whereas a Micromite
is an embedded controller chip.
To expand on this, a Maximite is a
standalone device to which you connect
a keyboard and a VGA monitor, and then
insert an SD card, to create a standalone
computer. When switched on, it can
instantly be used to experiment with the
many MMBASIC commands, or used to
directly control external hardware, or
even used to play a good old-fashioned
retro game (that is displayed on the VGA
monitor). A Maximite can be thought of
as a very powerful 1980s home computer.
A Micromite on the other hand is a single
chip (IC) that you embed into an electronics
project (hence, ‘embedded controller’).
They are typically used when all you need
is an intelligent controller to interact with
some connected electronics, all under the
direction of the program code.
Maximites and Micromites are both
fully capable of controlling hardware
under software control, and each has its
own version of MMBASIC. This makes it
easy to migrate code from one to the other.
However, the features and connectivity
that each offer do vary considerably, and
that is why they have different versions
of MMBASIC.
Something to consider, and also something
we often advise newcomers to do, is to start
with a Maximite and use it to explore what
MMBASIC is capable of. It can then be used
to write some program code to prototype a
new design. If all you need to do is control
some external hardware, it is then a simple
matter to migrate the Maximite code into a
Micromite, and then embed the Micromite
in a PCB or some stripboard, resulting in a
nice compact solution.
In fact, you can eliminate the Maximite
and work directly with a Micromite to test
and explore a prototype design; however,
this requires the use of a computer or
laptop. This is exactly what we have
done throughout this series, although my
personal preference is to use the Maximite
first as they don’t hinder with an operating
system that suddenly decides that it is time
for an update (or locks up due to something
else happening within the computer). Also,
sometimes a computer’s operating system
(OS) decides it can’t recognise the USB port
to which your Micromite is connected.
OK, these are minor things in general, but
when you do a lot of development work,
these ‘little things’ do become noticeable.
Ultimately, if all you are doing is
controlling some electronics, you will
eventually need to have your program code
on a Micromite, and the Maximite route
is just my preferred method for getting to
that position.
MMBASIC variants
We have just highlighted that there are
two versions of MMBASIC, one for the
Maximite, and another for the Micromite;
each catering for the significant differences
in functionality between the two devices.
However, when it comes to the Micromite,
there are actually three different versions
of MMBASIC, referred to as: Standard,
Plus, and eXtreme, which offer more
features and functionality, respectively.
Thus, eXtreme is the most powerful
version for the Micromite, followed by
Plus, and then Standard, which is the
most basic. Note that they are all backward
compatible, so the eXtreme version has
everything that the Plus version has along
with additional features and functionality.
Likewise, the Plus version has everything
that the Standard version has, along with
more features.
Before we highlight the main differences
between each Micromite MMBASIC
version, it’s worth pointing out that
each one is designed to run on a specific
Microchip PIC microcontroller. Because
the versions of MMBASIC have different
features, this translates into the Standard
version running on PIC chips that have
fewer pins than the Plus version, and in
general, the eXtreme version runs on PIC
chips with the most pins. The specific PIC
chips the various MMBASICs run on will
be referenced below.
D ev ice
Standard M icromite ( M M )
P ackag e
2 8 - pin D I P
4 4 - pin S M D
6 4 - pin S M D
1 0 0 - pin S M D
6 4 - pin S M D
1 0 0 - pin S M D
1 4 4 - pin S M D
Speed ( M H z)
4 8
4 8
1 2 0
1 2 0
2 5 2
2 5 2
2 5 2
M ax BA SI C prog ram size ( K B)
5 9
5 9
1 0 0
1 0 0
5 4 0
5 4 0
5 4 0
M ax CP U
R A M
memory size ( K B)
Clock speed ( M H z)
Numb er of I / O
pins
M icromite P lus ( M M + )
M icromite eX treme ( M M X )
5 2
5 2
1 0 8
1 0 8
4 6 0
4 6 0
4 6 0
5 to 4 8
5 to 4 8
5 to 1 2 0
5 to 1 2 0
2 0 0 to 2 5 2
2 0 0 to 2 5 2
2 0 0 to 2 5 2
1 9
3 3
4 5
7 7
4 6
7 5
1 1 5
Numb er of analog ue inputs
1 0
1 3
2 8
2 8
2 4
4 0
4 8
Numb er of serial I / O
2
2
3 or 4
3 or 4
3 or 4
3 or 4
3 or 4
ports
Numb er of SP I channels
1
Numb er of I 2C channels
1
Numb er of 1-Wire I / O
1 9
5
P
P WM
pins
or serv o channels
Serial console
1
2
2
3
3
3
1 + R T C
1 + R T C
1 + R T C
2 + R T C
2 + R T C
3 3
4 5
7 7
4 6
7 5
1 1 5
5
5
5
6
6
6
P
1
P
P
P
P
P
U SB console
P
P
P
P
P
P S2 keyb oard and LCD console
P
P
P
SD
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
card interf ace
Supports I LI 9 341 LCD
Supports 10 LCD
displays
P
P
panels
Supports VG A displays
Sound output ( WA V/ tones)
P
P
Supports P S2 mouse input
F loating -point precision
S ingle
S ingle
S ingle
S ingle
D ouble
D ouble
D ouble
Current req uirements at 3.3V
3 0 m A
3 0 m A
8 0 m A
8 0 m A
1 6 0 m A
1 6 0 m A
1 6 0 m A
Table 1: Comparison of the key parameters of the Standard Micromite, Micromite Plus and Micromite eXtreme
Practical Electronics | February | 2021
53
Finally, there are also versions of
MMBASIC designed to run on STM32
processors, and also a version that runs
on Raspberry Pi(s). However, because the
Pi continually updates its firmware, it is
difficult to keep MMBASIC compatible
with the latest versions of the Pi OS.
For the purposes of this article, we will
just focus on Micromite MMBASIC for
the PIC chips.
What follows are simple summaries of
the differences; for more specific details,
please see the summary shown in Table 1.
This version runs on either a 64-pin
PIC (PIC32MX470H) or a 100-pin one
This version runs on 64-pin, 100-pin, and
144-pin versions of the PIC32MZ PIC chips.
These run at speeds of up to 250MHz (fivetimes faster than Standard MMBASIC),
have up to ten-times more memory, and
also have many more I/O pins available
(up to 115 on the 144-pin PIC).
The MZ PIC has built-in hardware
floating-point capability, resulting in much
faster double-precision calculations. A
hardware random-number generator is also
implemented that generates ‘true’ random
numbers. More I2C, SPI, and UART ports
make it easier to add multiple hardware
modules that use these interfaces.
Interfacing to displays can use 16 bits
(rather than 8, as with MMBASIC Plus)
making them faster still to refresh the screen
image. Sprite functionality, complete with
collision detection is possible, along with
screen scrolling. A VGA output is also
available as an alternative to a TFT display
(on the 100-pin and 144-pin variants), and
this provides a resolution of 640×480 pixels
in eight colours.
Sound playback is improved with
the ability to play FLAC audio files and
output them via I2S for playback via an
external DAC module (giving superior
sound quality).
It is possible to add a USB or PS2
keyboard; plus, a PS2 mouse can be
connected that can mimic a mouse
pointer (useful when used with a
non-touchscreen).
A high-speed frequency counter input
is implemented which can operate up to
10MHz. There are also several commands
that interface directly to more advanced
hardware; for example, a VGA CMOS
camera module with 640×480-pixel
resolution (the OV7670 module); commands
to easily extract data return from GPS
modules; and commands that make it easy
to calculate angles (pitch, roll, and yaw)
from accelerometers and magnetometers.
JSON parsing is implemented, making it
relatively easy to extract useful data from
Fig.1. Micromite Keyring Computer (MKC):
MM. A DIY kit based on the 28pin DIP
Micromite. £12.50 (from micromite.org)
Fig.2. Explore 28 Module (E28): MM. An
SMD version of the MKC and Development
Module, all on one compact PCB. £17.50
Fig.3. BackPack v1 (BPv1): MM. A 2.8-inch
touchscreen plugs directly into this module
– as used in several PE projects. £19.95
Fig.4. BackPack v2 (BPv2): MM. As v1,
but also supplied with an onboard USBto-serial module (MicroBridge). £24.95
Fig.5. Pi-croMite (MM-PHat): MM. An
E28 that fits inside a RPi-Zero case. RPi
PHat modules plug into the 40-way GPIO
connector. £28.95
Fig.6. NanoMite: MM. A tiny module with
the footprint of an 8-pin DIP. Perfect for
compact applications with minimal I/O pin
requirements. £14.00
Standard MMBASIC
This is the version of MMBASIC that is
used in the MKC. It is the base version
of the MMBASIC firmware and will run
on either a 28-pin PIC32MX170F256B
PIC, or a 44-pin PIC32MX170F256D PIC.
This version of MMBASIC provides a
powerful set of commands and is perfect
for small-to-medium projects. It can drive
TFT touchscreens up to 3.5-inch in size
(via a serial SPI interface) and implements
a simple set of commands to write text
and draw basic graphics on the display.
Interfacing to other hardware is via I2C,
SPI, UART and one-wire protocols (see
Table 1 for the number of interfaces). The
28-pin Micromite has 19 I/O pins, while
the 44-pin Micromite has 33. It runs at a
maximum speed of 48MHz. Note that the
28-pin PIC is the only Micromite available as
a through-hole DIP package (as used in the
MKC). It’s ideal for users that wish to avoid
soldering SMDs (surface-mount devices).
MMBASIC Plus
54
(PIC32MX470L). In addition to all the
features of the Standard version, extra I/O
pins are available (45 on the 64-pin PIC,
and 77 on the 100-pin PIC). It also operates
at a faster speed of up to 120MHz. There
is provision for adding an SD card to store
program code files (.BAS), data files (.CSV),
image files (.BMP) and sound files (.WAV).
It can drive larger touchscreens (up to
9-inch) with an SSD1963 parallel interface.
These operate much faster than the serially
driven displays of the Standard MMBASIC.
Thanks to this faster communication to the
display, MMBASIC Plus has additional
powerful graphical commands: more font
sizes, higher resolution (800×480 pixels),
true 24-bit colour, and the ability to load
bitmap files stored on the SD card. Improved
touch-control functionality includes builtin touch keyboards, animated touch buttons
and advanced touch-interrupts.
Improved functionality for sound control
makes it possible to generate very precise
sinewaves, as well as playing WAV sound
files that are stored on the SD card.
A PS2 keyboard can also be added,
making it possible to use an MMBASIC
Plus setup as a standalone computer when
used with a larger display. MMBASIC
Plus is perfect for building solutions that
require a touch-control user interface, or
data logging (to SD card).
MMBASIC eXtreme
Practical Electronics | February | 2021
appropriate websites (this requires extra
hardware; eg, an ESP Wi-Fi module).
In summary, MMBASIC eXtreme is
perfect for building a powerful selfcontained standalone computer based
on a touch TFT panel, or for when you
require a large number of I/O pins, or many
hardware interface ports.
modules effectively presents each relevant
PIC pin to two rows of header pins – they
are ideal for users who don’t want to solder
SMDs, or simply want a quick and easy
way to begin exploring MMBASIC.
Below is a gallery of the 14 varieties of
Micromite and Maximite hardware.
I hope I’ve provided a useful overview
of the various versions of MMBASIC,
Micromite and Maximite. Together, they
offer solutions for virtually any project,
from flashing an LED and controlling an
attached electronic module, to building a
control panel with an advanced graphical
user interface, or creating a powerful easyto-use standalone computer.
The various versions of MMBASIC make
it an extremely versatile platform. This
means the Micromite/Maximite can be
used very effectively to enable simple (and
when necessary, advanced) software control
of a wide range of hardware. However,
MMBASIC is just the firmware, and the PIC
chip is just the microcontroller, onto which
MMBASIC is installed – on their own, they
are not useable. To make them ‘useable’, a
Micromite only needs a few (less than ten)
support components for it to become very
powerful. Typically, a voltage regulator plus
two smoothing capacitors are required,
and also a good quality 10µF tantalum or
ceramic capacitor on the PIC’s vCap pin.
A pull-up resistor is needed on the PIC’s
reset pin, and on PICs that have more than
44 pins, a crystal (or oscillator module)
along with associated oscillator capacitors
provide the PIC with a ‘heartbeat’. Beyond
this, everything else is really just a matter
of the required connections between the
relevant PIC pins to assorted styles of
connectors (USB, PS2, VGA, audio, SD
socket, header pins/sockets). You may
also need the occasional resistor, capacitor,
diode, or LED, and all this is what leads
us to the multitude of different Micromite
(and Maximite) modules that are available.
It’s worth noting that some Micromite
modules are referred to as a BackPack,
and others are called Explore modules. In
general, a BackPack is designed to directly
accept a touchscreen, and an Explore
module (with the exception of the E100)
is for plugging directly into a breadboard,
or into a custom PCB, without the need
to worry about the power circuit and the
required support components. The Explore
Fig.7. Explore 44 Module: MM. Useful if
you need a few more I/O pins than the
28-pin Micromite supplies. £23.95
Fig.8. Explore 64 Module (E64): MM+.
Includes an onboard uSD socket – perfect
for data-logging projects. £29.95
Fig.9. Explore 100 Module (E100): MM+.
This module has the footprint of a 5-inch
TFT display. Perfect for building a touchscreen control panel. £75.00
Fig.10. Extreme 64 (MMX64): MMX. The
entry module for the powerful MMBASIC
eXtreme. £75.00
Fig.11. Extreme 100 (MMX100): MMX.
Onboard GPS and gyroscope/compass
headers make this a useful development
platform. £80.00
Fig.12. Extreme 144 (MMX144): MMX.
Onboard VGA makes it suitable for a
standalone computer with VGA output.
£85.00
Micromite modules
Next month
We’ve seen the different versions of
MMBASIC that are available. Next month,
we’ll show you a fun project that uses
some of the extra features available in
MMBASIC Plus and MMBASIC eXtreme
to help inspire you with your own designs.
Until then, have fun!
Fig.13. (left) Colour Maximite 1 (CMM):
The original PIC-based Colour Maximite
computer, as featured in PE (November
2019 – February 2020). £68:95
Fig.14. (right) The new Colour Maximite
2 (CMM2): An extremely powerful update
to the CMM; based on a blisteringly fast
STM32 processor. £85.00.
Soon to be featured as a PE project.
Practical Electronics | February | 2021
55
|