The Micromite is a Microchip PIC32MX150/250 series microcontroller programmed with the free MMBasic firmware. This US$3.64 chip is available in an easy to use 28 pin dual in line package which can be readily soldered and plugged into an IC socket.
MMBasic is a Microsoft BASIC compatible implementation of the BASIC language with floating point and string variables, arrays, long variable names, a built in program editor and many other features.
Using MMBasic you can use communications protocols such as I2C or SPI to get data from a variety of sensors. You can measure voltages, detect digital inputs and drive output pins to turn on lights, relays, etc.
Special features include an IR remote control receiver and the ability to easily use LCD displays, keypads, temperature sensors, distance sensors and more.
All from inside this cheap 28 or 44 pin chip.
The 28-pin Micromite was introduced in the May and June 2014 issues of Silicon Chip magazine. The 44-pin version was described in the August 2014 issue. You can use it as the intelligence inside any project that requires a medium speed microcontroller but without the hassle of programming in a complex language.
To illustrate how easy it is to use the Micromite, part 1 of the Silicon Chip article (May 2014) described a GPS controlled digital clock based on the Micromite. The rear of the clock is shown here and, as you can see, it uses just a few components. It is always accurate to a fraction of a second and never needs setting. A more detailed description of the clock can be found here.
Back issues of the article can be purchased from Silicon Chip or electronic access can be purchased for about the cost of the printed issue.
- A fast 32 bit CPU with 128K of flash and 32K RAM running a powerful BASIC interpreter. 20KB of non volatile flash memory is reserved for the program. 22KB of RAM is available for BASIC variables, arrays, buffers, etc. This is sufficient for quite large BASIC programs up to 1000 lines or more.
- The Microsoft compatible BASIC interpreter is full featured with floating point and string variables, long variable names, arrays of floats or strings with multiple dimensions, extensive string handling and user defined subroutines and functions. Typically it will execute a program at 23,000 lines per second.
- Nineteen input/output pins are available on the 28 pin chip. These can be independently configured as digital input or output, analog input, frequency or period measurement and counting. Ten of the pins can be used to measure voltages and another seven can be used to interface with 5V systems. MMBasic can also be installed on the 44 pin version of the chip providing 33 input/output pins.
- Programming and control is done via a serial console (TTL voltage levels) at 38400 baud (configurable). Once the program has been written and debugged the Micromite can be instructed to automatically run the program on power up with no user intervention. Special software is not needed to develop programs.
- A full screen editor is built into the Micromite. This only requires a VT100 terminal emulator and can edit a full 20KB program in one session. It includes advanced features such as search and copy, cut and paste to and from a clipboard.
- Easy transfer of programs from another computer (Windows, Mac or Linux) using the XModem protocol or by streaming the program over the serial console input.
- Input/Output functions in MMBasic will generate pulses (both positive and negative going) that will run in the background while the program is running. Other functions include timing (with 1 mS resolution), BASIC interrupts generated on any change on an input pin and an internal real time clock.
- A comprehensive range of communications protocols are implemented including I2C, asynchronous serial, RS232, IEEE 485, SPI and 1-Wire. These can be used to communicate with many sensors (temperature, humidity, acceleration, etc) as well as for sending data to test equipment.
- Built in commands to directly interface special devices such as infrared remote controls, the DS18B20 temperature sensor, LCD display modules, battery backed clock, distance sensors, numeric keypads and more.
- Up to five PWM or SERVO outputs can be used to create various sounds, control servos or generate computer controlled voltages for driving equipment that uses an analogue input (eg, motor controllers).
- Special embedded controller features in MMBasic allow the clock speed to be varied to balance power consumption and speed. The CPU can also be put to sleep with a standby current of just 80µA. While in sleep the program state and all variables are preserved. A watchdog feature will monitor the running program and can be used to restart the processor if the program fails with an error or is stuck in a loop.
- The running program can be protected by a PIN number which will prevent an intruder from listing or modifying the program or changing any features of MMBasic.
- Power requirements are 2.3 to 3.6 volts at 5 to 25mA.
Remember, all of the above features are internal to the Micromite. The only extra component required is a 47µF capacitor.
There are two versions of the Micromite:
- A 28-pin version based on the Microchip
microcontroller is an easy to use 28 pin dual inline package (DIP) that can be plugged into a breadboard or an IC socket.
It has 19 I/O pins for interacting with the external world and is shown on the right, plugged into a breadboard.
- A 44-pin version based on the Microchip PIC32MX150F128D microcontroller. It has all the features of the 28-pin version plus 33 I/O pins which are under the control of your BASIC program. This is a surface mount chip but there are many ways to use this including soldering it onto a header board or by using the Micromite Module. See, "Where Can I Get It" below.
The best way to get started is to download the Micromite User Manual or the firmware from the download section below. The manual runs to over 65 pages and includes all that you need to know about programming and using the Micromite.
The cost is zero, so why not give it a go?
Where Can I Get It?
The Micromite User Manual lists the exact part numbers of the chips that you can use for both the 28 and 44 pin versions of the Micromite.
The 28-pin version is available from a variety of sources:
- CircuitGizmos offer the 28-pin version pre-programmed with MMBasic for US$5.99.
- The Silicon Chip online store sell the 28-pin chip pre-programmed for A$15 (including the 47µF capacitor)..
- Micromite.org sell the 28-pin chip pre-programmed for £5.00. They also have developer's boards for the 28-pin chip and other Micromite items.
- Mick on the Back Shed forum has developed a nice experimenter's board for the 28-pin chip (see this link) which he can supply as a blank board or with a pre-programmed Micromite chip.
- Microchip Direct sell the blank microcontroller for US$3.64 (for a single chip). Other suppliers such as Element 14, RS Components, etc also sell the blank chips. You will need a programmer such as the PICKit 3 to load the MMBasic firmware into the chip - this is available from Microchip or cheap clones can be found on eBay.
The 44-pin version of the Micromite can also be purchased from a number of sources:
- Micromite.org sell an excellent adapter board (the Micromite Module) that includes the pre-programmed 44-pin chip, a USB-to-serial bridge and voltage regulator as illustrated on the right.
You can purchase the board in a variety of forms including the blank board and a fully assembled and tested version. This is definitely the best way to go if you need the full 33 I/O pins that the 44-pin version offers.
- Microchip Direct sell the blank 44-pin microcontroller for US$3.72 as do the normal distributors (at a slightly higher price). In addition to a programmer such as the PICKit 3 you will also need an adapter board to bring the chip's pins out on easy to access header pins. A typical adapter is Part Code: 44PINTQFP from Futurlec which costs US$1.20.
Interesting Web Sites
A website that sells the 44-pin version of the Micromite, Micromite chips and all sorts of support parts:
The Back Shed forum is a great place to hang out and disscuss the Micromite and microcontrollers:
A new version (Ver 4.5C) of MMBasic for the Micromite is available from the download area at the bottom of this page. This version fixes a few bugs, one of which could, in rare cases, cause the Micromite to partially erase its firmware. For details check the Change Log in the firmware download.
To load the new version you will need a programmer such as the PICKit 3. If you do not have a programmer you can continue to use the old version as there has been no new functionality added and the bug referred to above only occurs in rare cases with certain low cost USB-serial adapters.
To save you from having to check this web page for firmware updates I can also send you an email. To enable this please enter your email address in the box below and click on Submit. Your address will be held confidential and will only be used when an update is available.
The first thing that you should read is the Micromite Frequently Asked Questions (FAQ) list as this covers hints related to usage and programming. The list is rather short at this time but as more questions arise it will be expanded.
Also, you should check the list of current bugs found in the Micromite version of MMBasic as it lists any faults found in the current version and provides workarounds if applicable.
The Back Shed has an active forum where many knowledgeable users are happy to help newcomers to the Micromite and MMBasic: http://www.thebackshed.com/forum/forum_topics.asp?FID=16
Source Code to MMBasic
The complete source code for the Micromite version of MMBasic is available for personal use at the main MMBasic website at http://mmbasic.com
|Micromite User Manual||DOWNLOAD|
|Micromite Firmware V4.5C (includes a copy of the Micromite User Manual)||DOWNLOAD|
Previous versions of the Micromite firmware can be found in the archive.