Silicon ChipA new Micromite: the sensational Explore-28 - September 2019 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: 128 Pages: our largest issue ever!
  4. Feature: History of Cyber Espionage and Cyber Weapons, Part 1 by Dr David Maddison
  5. Project: Build your own Gamer’s Seat with Four DoF by Gianni Pallotti
  6. Feature: ElectroneX 2019 – Melbourne, September 11 & 12 by Australasian Exihibitions & Events (AEE)
  7. Project: A new Micromite: the sensational Explore-28 by Geoff Graham
  8. Feature: Restoring a Macintosh Classic II by Bruce Rayne
  9. Project: Six-way Stereo Audio Input Selector with remote control by John Clarke
  10. Serviceman's Log: Giving an old companion its voice back by Dave Thompson
  11. Feature: Cypress “system on a chip” part 2 by Dennis Smith
  12. Product Showcase
  13. Project: Ultrabrite LED Bicycle Light by Daniel Doyle
  14. Vintage Radio: Kriesler Farm Radio model 31-2 by Associate Professor Graham Parslow
  15. PartShop
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: Fluidics and Microfluidics, August 2019; Dual 12V Battery Isolator, July 2019; RF Signal Generator, June & July 2019; Bridge-mode Audio Amplifier Adaptor, May 2019
  19. Outer Back Cover: Hare & Forbes MachineryHouse

This is only a preview of the September 2019 issue of Silicon Chip.

You can view 58 of the 128 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • History of Cyber Espionage and Cyber Weapons, Part 1 (September 2019)
  • History of Cyber Espionage and Cyber Weapons, Part 1 (September 2019)
  • History of Cyber Espionage and Cyber Weapons, Part 2 (October 2019)
  • History of Cyber Espionage and Cyber Weapons, Part 2 (October 2019)
Items relevant to "Build your own Gamer’s Seat with Four DoF":
  • 4DoF Simulation Seat motor controller PCB [11109191] (AUD $7.50)
  • High-current H-bridge motor controller PCB [11109192] (AUD $2.50)
  • PIC32MX170F256D-50I/PT programmed for the 4DoF Simulation Seat [1110919A.HEX] (Programmed Microcontroller, AUD $15.00)
  • MMBasic source code for the 4DoF Simulation Seat (Software, Free)
  • 4DoF Simulation Seat motor controller and H-bridge PCB patterns [11109191-2] (Free)
Items relevant to "A new Micromite: the sensational Explore-28":
  • Micromite Explore 28 PCB [07108191] (AUD $5.00)
  • PIC32MX170F256B-50I/SO and PIC16F1455-I/SL programmed for the Micromite Explore 28 or Explore 40 (Programmed Microcontroller, AUD $25.00)
  • Micromite Explore-28 complete kit (Component, AUD $35.00)
  • Software for the Microbridge (Free)
  • Firmware (HEX) file and documents for the Micromite Mk.2 and Micromite Plus (Software, Free)
  • Micromite Explore 28 PCB pattern (downloads) [07108191] (Free)
Items relevant to "Six-way Stereo Audio Input Selector with remote control":
  • Six-way Stereo Audio Input Selector main PCB [01110191] (AUD $7.50)
  • Six-way Stereo Audio Input Selector pushbutton PCB [01110192] (AUD $5.00)
  • PIC16F88-I/P programmed for the standalone Six Input Audio Selector [0111019A.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88-I/P programmed for the Low-Noise Stereo Preamp with Six Input Selector [0111111M.HEX] (Programmed Microcontroller, AUD $15.00)
  • Firmware (ASM and HEX) files for the Six-way Stereo Audio Input Selector [0111019A.HEX/0111111M.HEX] (Software, Free)
  • Six-way Stereo Audio Input Selector PCB patterns [01110191-2] (Free)
Articles in this series:
  • Intro to programming: Cypress' System on a Chip (SoC) (October 2018)
  • Intro to programming: Cypress' System on a Chip (SoC) (October 2018)
  • Cypress “system on a chip” part 2 (September 2019)
  • Cypress “system on a chip” part 2 (September 2019)
Items relevant to "Ultrabrite LED Bicycle Light":
  • Ultrabrite LED Bicycle Light PCB [16109191] (AUD $2.50)
  • PIC10F202-E/OT programmed for the Ultrabrite LED Bicycle Light [1610919A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the Ultrabrite LED Bicycle Light [1610919A.HEX] (Software, Free)
  • Ultrabrite LED Bicycle Light PCB pattern (PDF download) [16109191] (Free)

Purchase a printed copy of this issue for $10.00.

The Micromite Explore-28 The 28-pin Micromite has been used in many of our projects, and with good reason. It is a low-cost, powerful microcontroller which allows you to create advanced devices with minimal effort. Now the Explore-28 will make your life even easier. It’s a small plug-in module with the same powerful PIC plus a USB socket for comms and programming, giving you everything you need to get started with the Micromite in one handy package. By Geoff Graham# T he Micromite is a high-performance 32-bit microcontroller which can be programmed in a friendly BASIC programming language. It has a lot of built-in capabilities including a variety of communications protocols (I2C, SPI, serial etc), the ability to easily interface to many devices (LCD screens, GPS modules, temperature sensors etc). And it’s really easy to learn how to use it, too. To get started with the Micromite, you just need a programmed chip, which you can then plug into a breadboard. This is not hard to do, but there is a bit of fiddling about to be done before you can start programming the chip. Many readers would prefer a pre-assembled module that can be immediately put to use. That is the essence of the Explore-28. You can plug it into a USB port on your laptop and in a few minutes, have a simple program up and running. For readers who have followed the Micromite story, the Explore-28 combines the 28-pin Micromite Mk2 (January 2015; www.siliconchip.com. au/Article/8243) with the Microbridge interface (May 2017; siliconchip.com. au/Article/10648). 52 Silicon Chip Another way to think about it is that it is a bit like the Micromite LCD Backpack V2 (May 2017; siliconchip. com.au/Article/10652) but without the LCD, and in a much smaller package. The whole module is only a little bit larger than a 28-pin DIL IC package but it packs a lot of hardware, including: • A 28-pin Micromite pre-programmed with the latest MMBasic interpreter. • A USB-to-serial interface, which allows you to plug the Explore-28 into your computer and immediately start programming. • A PIC32 programmer, so that you can update the BASIC interpreter whenever a new version is released. • A power supply with a # http://geoffg.net Australia’s electronics magazine 4-16V input range and the ability to supply up to 150mA at 3.3V (plus 5V, when powered from USB) for external circuitry. This means that if you purchase a pre-assembled Explore-28 module, you can immediately start experimenting with it. You do not need to source the microcontroller, program the firmware, setup a breadboard, etc. It is a fully assembled and ready to go package. It is interesting to compare the Explore-28 to the Commodore 64 from 1982, which also came with a built-in BASIC interpreter and was the most popular computer in the 80s. Many millions were sold worldwide, for around US $600 each. The Explore-28 is fifty times faster, with much more memory and costs about US $20. While they clearly have different end uses, this still illustrates how far modern semiconductor technology has progressed. The Explore-28 printed circuit board and concept was developed by two Micromite enthusiasts in New Zealand: Graeme Rixon and Robert Rozee. It can be purchased as a kit of parts from SILICON CHIP, or as a completely assembled module from Graeme’s website siliconchip.com.au – see the last page of this article for details. Graeme Rixon also offers a full construction pack, which you can download from his website. This includes the PCB Gerber files, parts list, firmware etc. So, you can get your own PCBs made and build your Explore-28 modules from scratch if you wish Connections Explore-28 Features • Complete microcontroller module with USB interface and power supply • Programmed in BASIC, with 60KB program space and 50KB RAM for variables • 19 I/O pins with 10 capable of being used as analog inputs • Supports communications protocols including async serial, I2C, SPI and Dallas OneWire • Support for special devices such as temperature sensors, keypads, IR remote controls etc • Full support for touch-sensitive LCD panels up to 3.6in (9.2cm) diagonal • The Explore-28 has the same • ‘form factor’ as the Arduino Nano, • which means that breakout boards • designed for the Nano will suit the Explore-28. But the two are quite different in a programming sense; the Micromite is vastly more powerful and is programmed in BASIC, not C/C++. The pin-out of the Explore-28 is shown in Fig.1. Essentially, it mimics the pins on the 28-pin DIP version of the Micromite, except pin 20 which is not present. The module also includes two extra pins at the bottom, labelled +5V, which can be used to feed power in or out. When the Explore-28 is plugged into a USB port, it will power itself from the USB 5V supply, and that voltage appears on the +5V pins. This is useful if you want to power some other devices from 5V. You can also power the Explore-28 by connecting an external power source to either of the 5V pins. The input can range from 4V to 16V, so for example, you could power the Ex- Embedded controller features such as sleep, control over clock speed and watchdog timer Built-in PIC32 programmer for updating the firmware Runs from 4-16V <at> 50mA Compact size: 40mm long, 19mm wide and 8mm tall (without header pins) plore-28 from a 12V battery. But note that if you are using an external power source, you cannot plug the Explore-28 into your computer’s USB port at the same time. The two power supplies will conflict and possibly damage your USB port or computer. Secondly, if you are powering the Explore-28 from a car battery, you will need to include extra circuitry to protect it from the excessive voltage spikes that can be found in an automotive electrical system. The Micromite chip itself requires a 3.3V supply, and this is provided by the onboard regulator. This voltage is made available on pin 13 so that you can power external components that require 3.3V. Up to 150mA can be drawn from this pin; however, you will need to make sure that this does not cause the regulator to overheat and shut down Fig.1: the Explore-28 has 19 I/O pins with 10 that can be used as analog inputs. Other connections include a 3.3V output, ground and two pins which can be a 5V output or external power input (4-16V). ANA means analog I/O capable, DIG means digital. The other notations refer to the special capabilities of each pin – see the “Micromite User Manual” for a full description. siliconchip.com.au Australia’s electronics magazine (particularly with high input voltages). USB/serial interface The Explore-28 includes a PIC16F1455 microcontroller, which is programmed to act as both a USBto-serial interface and as a PIC32 programmer (for updating the Micromite firmware). This is called the “Microbridge” and when it is acting as a USB-to-serial interface, it creates a virtual serial port on your computer. This acts like a normal serial port, but it works over USB. As mentioned above, we introduced the Microbridge in the May 2017 issue of SILICON CHIP, and it is used in the later versions of the Micromite LCD Backpack (V2 [May 2017; siliconchip.com. au/Article/10652] and V3 [August 2019; siliconchip.com.au/Article/11764]). The Microbridge connects your computer to the Micromite’s serial console. This is the main programming interface to the Micromite and you can use it to set options, enter programs, run them, get feedback from running programs and also receive data. If you’re running Windows, it will automatically create a virtual serial interface when the Explore-28 is plugged into a USB socket on your computer. This appears as a COM port, usually with a high number such as COM5 or COM21. On Windows 7 and earlier versions, a device driver may be required (see siliconchip.com.au/link/aalb), but Windows 8 and 10 already have the driver built in. You can check the COM number that Windows allocated to the Explore-28 by going into Device Manager and looking for a new device listed under Serial Ports, as illustrated in Fig.2. The Linux kernel and MacOS operSeptember 2019  53 An introduction to the Mighty Micromite The Micromite was designed and develped in Australia and is now popular around the world. We have covered the Micromite in many previous articles but in case you haven’t seen those, here is a quick rundown. The Micromite is based on the Microchip PIC32, which is a high-performance 32-bit microcontroller. While this chip as supplied is powerful, it is not that easy to write programs for it (the manuals run to over a thousand pages!) and the standard programming languages used on it are assembler, C or C++. These languages and the programming software are complex and require experience to use properly. For the average hobbyist, the Micromite firmware makes programming much easier. It’s loaded into the flash memory of the PIC32 and turns the chip into a Micromite. The Micromite firmware insulates you from the complexities of the underlying silicon, while still allowing you to use its features. To program the Micromite, you use the BASIC programming language, which is designed to be easy for beginners and allows you to get started almost immediately. The BASIC language The following is an elementary introduction to Micromite programming. We published a comprehensive four-part article series on programming the Micromite in the February, March, May and June 2017 issue (siliconchip. com.au/Series/311). So refer to those articles for more detailed instruction. The Micromite version of BASIC is called MMBasic (short for MicroMite BASIC) which is loosely based on the Microsoft BASIC interpreter that was popular years ago. That it is “interpreted” means that the firmware reads through your program line-by-line, executing each command as it finds them. BASIC (an acronym which stands for Beginner’s All-purpose Symbolic Instruction Code) was initially developed by Dartmouth College in the USA for teaching programming and therefore emphasises ease-of-use. BASIC is also a powerful language, and it became popular in the 80s and 90s with the introduction of small computers such as the Commodore 64, Apple II etc. These days, it is still used in some large commercial data systems (usually running Pick Basic). BASIC program execution starts at the top of the program and continues until it runs off the bottom or hits an END command. Generally, there is one command per line, although you can have more if you wish, each separated by the colon (:) character. A command can be something like PRINT which will output some text to the console, PIN() which will set the state of an output pin, or SERVO which will control a servo motor. Decisions within the program are made using the IF…THEN command. So, for example, your program can include something like: IF t > 30 THEN PRINT “too high” Your program can also run commands in loops. For example: FOR nbr = 1 to 10 PRINT nbr NEXT nbr This will display the numbers from one to ten. To help newcomers to the Micromite and BASIC programming, we have a tutorial titled “Getting Started with the Micromite”. This begins with the basics then takes you through advanced programming, input/output, communications protocols, and much more. It is recommended reading for anyone starting with the Micromite and can be downloaded for free from the SILICON CHIP Shop. Micromite input/output The Micromite is intended to be a controller that can be embedded in something like a burglar alarm, reticulation controller etc. In this type of 54 54  S Silicon Chip role, its ability to use the I/O pins to control external devices is critical. An I/O pin refers to the physical pin on the Micromite chip. On the Explore-28, these are routed to pin headers on the edge of the module, with the same numbering. So, when you refer to a pin number in your program, that is both the physical pin on the chip and the pin header number. In MMBasic, you configure an I/O pin on the chip using the SETPIN command and this defines the pin as a digital input, digital output, analog input etc. For example, if pin 2 on the chip has been defined as an analog input, the function PIN(2) will read the voltage on pin number 2. You could use it like this: PRINT PIN(2) and you would have a simple voltmeter. To read the state of a pin configured as a digital input, you use the same function, but in that case, it will return zero for a low voltage and one for voltage high. You can set the output level of a pin configured as a digital output by assigning a value to PIN(). For example, this will set the output on pin 24 to a logic high (3.3V): PIN(24) = 1 There are many other things that you can do with the Micromite’s I/O pins, including measuring frequency, timing, generating square waves and more. Special device support A great feature of the Micromite is that it has built-in support for many external devices like temperature and humidity sensors, keypads, real-time clocks and servos. For example, using the IR command, you can receive commands from an infrared remote control. This is easy to do, and it adds flair (and utility) to your project when you can control it by pressing a button on a remote control. As another example, you can connect a low-cost ultrasonic distance sensor to the Micromite and with one function, read the distance to an object in centimetres. Measuring temperature and humidity is just as easy; MMBasic will query the sensor for you and return the temperature in degrees Celsius and humidity in %RH. Perhaps the most outstanding feature of the Micromite is its ability to control a touch-sensitive LCD panel. The Micromite can display text and graphics and respond to touch inputs on the panel’s face. We have used this feature in many projects such as the DAB+/FM/AM Tuner (January-March 2019; siliconchip.com.au/Series/330) and the LabQuality GPS Frequency Reference (October & November 2018; siliconchip. com.au/Series/326). Communications protocols There are many modules and chips that you can buy to measure anything from air quality to acceleration. These all send their data via some communication protocol, usually serial, and the Micromite supports the four main protocols that are in use: • Asynchronous serial, which is used by computers, lab equipment and GPS modules. • I2C, which is used by gas sensors, real-time clocks and many other chips. • SPI, which is used by accelerometers, memory chips, electronic compasses etc. • Dallas One-Wire, which is mostly used for temperature sensors. GPS modules are particularly valuable. These days, they are amazingly cheap ($15-35) and they will give you your precise location, altitude, speed, heading and the exact time. Using the Micromite’s serial interface, it is easy to retrieve this information and they open up a world of exciting projects that can be built.v Australia’s Australia’s electronics electronics magazine magazine siliconchip.com.au Fig.2: when the Explore-28 is plugged into a Windows computer, it is allocated a virtual serial port number by the operating system. You can check what COM number was allocated by going into Device Manager and looking for a new device listed under Serial Ports (COM5 in this example). done by pressing ALT-B, and this has the same effect as if the power to the Micromite was cycled. Programming example Fig.3: when you have connected to the virtual serial port created by the Explore-28, you will see the MMBasic command prompt (“>”), as shown here. At this point, you can try out commands, set options, enter programs and run them. ating systems usually do not need any special configuration and, as an example, under Linux Mint, the Explore-28 normally appears as /dev/ttyACM0. Accessing the Micromite console When you plug the Explore-28 into your computer, the LED marked “PWR” (LED1) will illuminate, to show that it is powered. To access the Micromite’s console, you need to run a terminal emulator on your computer. This takes the key presses that you make and sends them down the serial interface to the Micromite, while also displaying any responses from the Micromite. For Windows, you have several choices. We recommend Tera Term (http://tera-term.en.lo4d.com/), but there are many other terminal emulators to choose from, with some specially written for the Micromite (see the panel titled “Micromite resources”). The Micromite’s console defaults to a speed of 38,400 baud, so all you need to do is configure your terminal emulator for the correct COM port number and this baud rate. Then, when you press Enter, you should see the Micromite command prompt (a greater than symbol: “>”), as shown in Fig.3. At this point, you have full control of the Micromite for entering commands, setting options etc. You can experiment by typing “PRINT 1/7” and pressing Enter. The Micromite will return the result of dividing 1 by 7, then display the command prompt again. This is called ‘command mode’ and siliconchip.com.au it allows you to try out most BASIC commands at the command prompt. It is handy for testing commands while you are learning the language. Note that when you type something on the console or the Micromite sends some data to your PC, the LED marked “MODE” (LED2) will briefly flash to indicate that data is being sent over the virtual serial port. The tactile pushbutton near the LEDs (switch S1) is used to put the Microbridge into its programming mode (more about that later). A handy feature of the Microbridge is that you can reset the chip by sending a break signal over the virtual serial interface. In Tera Term, this is We mentioned how easy it is to get started with the Explore-28, so here is a short tutorial to illustrate that point. For a beginner, the best method of entering a program into the Micromite is to use the Micromite’s built-in fullscreen editor. This is fully documented in the Micromite User Manual, but to get started, all you need to know is that the arrow keys on your keyboard will move the cursor around the text and the backspace key will delete the character before the cursor. At the command prompt, type “EDIT” followed by the Enter key. This will take you into the Micromite’s editor. Then, enter this short program: SETPIN 15, DOUT DO PIN(15) = 1 PAUSE 500 PIN(15) = 0 PAUSE 500 LOOP To save this program, press the F1 key or CTRL-Q (which does the same thing). This will return you to the command prompt. Then, to run the program, type “RUN” and press enter. This program toggles the voltage on pin 15 of the Explore-28 from zero to 3.3V and then back again every second, and continues doing it forever. You can test this by probing pin 15 with a voltmeter, and you should see the voltage jumping up and down at 1Hz. While the program is running, you will not see the command prompt in the terminal emulator. This is because the Micromite is now busy, but you can regain control by pressing CTRL-C. This is the break key and it will interrupt any running program and return control to the command prompt, so that you can edit the program or enter other commands. Circuit description The Explore-28 is just a little larger than the original 28-pin Micromite in a standard dual inline plastic (DIP) package. But it has many more features including a USB-to-serial interface, onboard PIC32 programmer and a 3.3V regulator. Australia’s electronics magazine The circuit of the Explore-28 is shown in Fig.4. As you can see, it isn’t terribly complex. It consists of three main components: IC1, the 28pin PIC32 microcontroller (the Micromite); IC2, the PIC16F1455 (Microbridge) which provides the USB interface; and a voltage regulator to provide September 2019  55 the 3.3V supply (REG1). The PIC32 used for the Micromite (IC1) is in a 28-pin surface-mounting package, with most of its pins going directly to the header pins on the edge of the board (CON1-CON3). The 10µF capacitor on pin 20 is critical and must be a high-quality multilayer ceramic type. It is used to stabilise the chip’s internal 1.8V regulator, and if it is missing or the wrong type is used, the Micromite will not work. The only Micromite pins which do not go directly to a corresponding pin on CON1-CON3 are: pin 11, the serial data out line, which goes via a 1.5kΩ resistor in order to protect IC1 if an external device attempts to drive it above +3.3V or below 0V (eg, a raw RS-232 signal); and pin 20 (VCAP), as this micro pin is already connected to the required capacitor. Several of the micro’s pins also connect to the Microbridge (IC2), to allow the Microbridge to reprogram the chip and for its USB/serial function. As mentioned earlier, the Microbridge chip has two functions; it acts as a USB-to-Serial bridge and as a PIC32 programmer. On power-up, it starts in the USBto-serial bridge mode, with the MODE LED (LED2) off, except for flickering when there is serial activity. Serial data is transmitted from pin 6, which connects to the receive data pin (pin 12) on IC1. Similarly, the Micromite’s transmit pin (pin 11) connects to receive (pin 5) on the Microbridge chip. A second 1.5kΩ resistor between the TX pin of IC2 (pin 6) and the RX pin of IC1 (in 12) protects IC2 in case external circuitry tries to send data to the Micromite while the Microbridge is active. A 10kΩ pull-up resistor from 3.3V to pin 11 of IC1 prevents glitches on the serial port when the Micromite is reset. Another 10kΩ pull-up resistor on pin 1 (MCLR) prevents spurious resets of the chip. The tactile switch on pin 4 of IC2 is used to place the Microbridge into its PIC32 programming mode. In this mode, the MODE LED (LED2) lights up, and the Microbridge chip uses pin 7 to reset the PIC32 and pins 2 and 3 to drive its programming interface. In normal operation, these pins are in a high-impedance state, so the corresponding I/O pins on the Micromite can be used for other purposes. The power supply is based on a lowdropout linear regulator (REG1; Microchip MCP1703) with a fixed output of 3.3V. This powers both the Microbridge chip (IC2) and the Micromite (IC1) and as mentioned, is also made available on pin 13 of CON1 for external circuitry to use. The MCP1703 can source up to 250mA, with about 50mA of that being used by the Microbridge and the Micromite. Besides this critical 10µF capacitor described above, there are two 100nF bypass capacitors for the 3.3V supplies of IC1 & IC2, plus 4.7µF input bypassing and output filtering ceramic capacitors for REG1. PIC32 programmer Fig.4: the circuit of the Explore-28 module is elegant in its simplicity. IC1 is the PIC32 which runs MMBasic, IC2 is the Microbridge which provides a USB serial port and the ability to reprogram IC1, and REG1 is a low-dropout regulator which provides both ICs with a 3.3V supply rail, derived from USB 5V or a source of 4-16V DC fed in via CON1 and/or CON2. 56 Silicon Chip Australia’s electronics magazine As mentioned above, the Microbridge chip can act as a PIC32 programmer for loading firmware updates into the Micromite (IC1). You essentially get this feature for free, which is handy, as previously you needed to purchase a separate PIC32 programmer to take advantage of new releases of the Micromite firmware. If you purchased the Explore-28 as a fully assembled module or a kit, both microcontrollers (the PIC32 and PIC16F1455) will be supplied pre-programmed, so this programming feature is only required if you want to update the firmware with a new release. The process of loading new firmware into siliconchip.com.au the Micromite is painless and only takes a minute or two. Start by switching the Microbridge into its programming mode and then, using free software on your laptop, you upload the new firmware via USB to the Microbridge, which in turn programs it into the flash memory of the Micromite. To enter into the programming mode, momentarily press the tactile switch on the Explore-28. The Microbridge chip will then immediately switch to its PIC32 programming mode, and the MODE LED will illuminate to confirm this. If you did not intend to enter this mode, you can revert to the USB-to-serial mode by simply cycling the power. The software you need to reprogram the Micromite is called pic32prog. The Windows version is available from the SILICON CHIP website, while the macOS and Linux versions are available from other sites. The Windows version does not need to be installed; you can copy the executable to a convenient location and start a command window in that folder. New versions of the Micromite firmware can be found at the author’s website, http://geoffg.net/micromite.html (scroll to the bottom of the page). The Micromite firmware download on the SILICON CHIP website is also updated periodically, but there may be a delay between a new release and it appearing on our website. Generally, the firmware is contained in a .zip file, along with the Micromite manuals, so you need to unzip its contents and locate the firmware file (it has a .hex extension). Then, copy this file to the same folder as the pic32prog program. Programming the firmware To program this file into the Micromite chip, run pic32prog with the following arguments: pic32prog -d ascii:comxx yyyy.hex Here, xx is the COM port number and yyyy.hex is the name of the firmware file. The COM port number is the same as that allocated by Windows when the Microbridge was in its USBto-serial converter mode. As an example, if your Microbridge was allocated the virtual serial port of COM23 and the file that you wanted to program was “Micromite_V5.05.09. hex”, the command would be: 58 Silicon Chip Fig.5: the typical output from pic32prog after it has programmed a new version of the MMBasic firmware into the Micromite using the Microbridge. The whole operation is straight forward and takes less than a minute. pic32prog -d ascii:com23 Micromite_V5.05.09.hex Before you do this, make sure that you have closed the terminal emulator that you were previously using to communicate with the Microbridge in its USB-to-serial mode. Not doing this is a common mistake and it will cause pic32prog to abort with an error message, because it cannot open the virtual serial port. When you press enter at the end of this command, pic32prog will upload the hex file to the Microbridge, program it into the PIC32, then read back the programmed data to verify that the programming operation was executed correctly. The whole operation will take less than a minute and sample output of the whole process is shown in Fig.5. After the programming operation, the MODE LED will switch off, the Microbridge will revert to operating as a USB-to-serial converter, and the Micromite will automatically restart with the new firmware. Updating the Micromite’s firmware will reset any options set and completely erase the BASIC program memory. So make sure that you make a copy of the program stored on the Micromite before starting the upgrade. Construction Because the Explore-28 is readily available as an assembled module, we expect that many readers will take Australia’s electronics magazine that option. However, if you decide to assemble your own module, you will find that it is not hard but you will need a steady hand and ideally, some experience soldering surface-mount components, even though the ones used in this project are not that small (at least, by SMD standards). We have covered soldering surface mounted components before and it is nothing to be feared. The secret is to use plenty of flux paste and keep only a small amount of solder on the soldering iron’s tip. The flux makes the solder flow smoothly around the joint while using only a minimal amount of solder means that you will avoid solder bridges and blobs. The PCB used for the Explore-28 is a four-layer board, coded 07108191 and measuring 39 x 18.5mm, and it has components mounted on both sides. The overlay diagrams, Figs.6(a) and (b), show where the components are mounted, along with top and bottom layer tracks. We haven’t shown the two inner layers because that would make the diagrams hard to read. The outer layer tracks shown are used for signal routing, while the two inner layers consist of a ground plane and a power (+3.3V) plane. These cover most of the board and only have holes where vias pass between the top and bottom layers. Other vias are used to connect these siliconchip.com.au CON2/3 (UNDER) 28 CON2 /3 (UNDER) 28 15 5V 15 5V K CON4 IC1 K 1 S1 1 CON1 (UNDER) 14 5V LED2 MODE ACTUAL SIZE 1.5kW 10kW 1.5kW 10W 1 100nF IC2 100nF 28 1 1.5kW 10mF CON2/3 siliconchip.com.au IC1 K S1 CON4 4.7mF 1 REG1 4.7mF 15 5V Fig.6: use these same-size photos and PCB overlay diagrams (top and bottom view) as a guide to assembling the Explore-28. Because the Micromite Explore-28 is so small, we’ve also prepared the twice-life-size diagrams at right to make life a little easier! As mentioned in the text, it’s easiest to populate the bottom side first (with IC2 & REG1) since these components are all similar heights, so the board should still sit relatively flat while you solder the remaining components on the top side. If you’re having trouble getting it to sit flat, try plugging a pair of 15-pin headers into a breadboard and then resting the PCB on top. planes to component pins. While Fig.6 shows where all the components need to be mounted, the silk screen printing on the board will also guide you during assembly. It’s best to solder the SMD components on the bottom side first (the side with IC2 and REG1), then add the components to the top side, and finish with the pin headers. Before soldering IC2, if you haven’t purchased a pre-programmed kit, you need to program it with the Microbridge firmware. This can be downloaded from the SILICON CHIP website or from: http:// geoffg.net/microbridge.html (scroll to the bottom of the page). You will also need a narrow SOIC programming socket to do this, so unless you have one, you’re better off acquiring a programmed chip. You do not need to program the PIC32 microcontroller used for the Micromite, as the Microbridge will do that for you when you have finished construction. Solder IC2 on the bottom side of the board first, taking care that its pin 1 dot is orientated towards the nearby empty square pads, as shown in Fig.6. If you accidentally bridge two pins with solder, clean up the bridge by applying a little flux paste and then some solder wick. Follow with REG1, which can only go in one way around. It’s best to apply a little flux paste to the large pad first, then solder the three smaller pins K 14 5V 10kW (b) CON1 1.5kW 1 LED1 PWR 1 (a) 14 CON1 (UNDER) 5V 2:1 SCALE FOR CLARITY (DOUBLE ACTUAL WIDTH & HEIGHT) 1 1.5k CON1 10k before finishing with the large tab. You may need to turn your iron up to get a good solder joint on the tab. Now add the seven resistors and five capacitors to the bottom side, being careful not get any of the different values mixed up. Flip the board over and then solder the USB socket. Make sure its five signal pins line up correctly with the pads (aided by the two plastic posts going into holes on the board), then solder those signal pins and ensure there are no bridges between them. If there are, apply some flux paste and clean them up using solder wick. Then solder the four large mounting tabs, to hold the socket firmly to the board. With that done, you can continue with soldering IC1; again, watch its orientation – pin 1 goes at the opposite end from the USB socket. Where to buy the Explore-28 • A full kit or major parts from the SILICON CHIP ONLINE SHOP (see siliconchip.com.au/shop) Full Kit: (Cat SC5121) $30.00* or 2 Prog. micros: (Cat SC5120) $20.00* 4-layer PCB only: (Cat SC5115) $7.50* *Inc. GST; P&P: $10.00 PER ORDER • If you’re looking for a pre-assembled module, go to Rictech Ltd (www.rictech.nz/micromite-products) or to https://micromite.org/ Also visit the Rictech website for a downloadable Construction Pack with PCB, firmware etc. Australia’s electronics magazine 1.5k IC2 100nF 10k 1 100nF 28 5V 4.7 F 1.5k 1 1.5k 10 14 10 F REG1 4.7 F CON2/3 15 5V Then fit LED1 & LED2, with their cathodes (generally indicated with a green stripe or dot) towards the “K” shown in Fig.6 (shown on the PCB itself as white squares). But note that while most LEDs have a green dot or stripe to indicate the cathode, we’ve seen LEDs where it indicates the anode. So to be extra safe (and avoid a lot of fiddling rotating of components later), it’s best to probe each end of the LEDs with a multimeter set on diode test mode. When they light up, the red probe is on the anode and the black probe on the cathode. Finish up by soldering pushbutton S1 in place, followed by the three headers, fitted to the underside of the board as shown. Testing To test the completed Explore-28, simply connect it to a USB port on your computer and program the latest firmware into the Micromite as described above (if your Micromite chip wasn’t already programmed). Then check that you can get the MMBasic command prompt via a terminal emulator. If you can, it means that everything is working perfectly. If you do not see the virtual serial port created by the Microbridge on your computer, the first thing to check is that the voltage regulator is producing 3.3V (measure between pins 13 & 8). If this is OK, then the Microbridge September 2019  59 Parts list – Micromite Explore-28 1 four-layer PCB coded 07108191, 39 x 18.5mm 1 15-pin male header, 2.54mm pitch (CON1) 1 6-pin and 8-pin male header, 2.54mm pitch (CON2,CON3) (optional) 1 mini type-B SMD USB socket (CON4) [Altronics P1308, element14 2300434] 1 mini SMD tactile pushbutton switch (S1) [element14 1629616] The Explore-28 is designed to plug into a standard (solderless) breadboard for easy prototyping. Using the preassembled module, you can plug it into a USB port on your laptop and in a few minutes, have a simple program running. chip is probably at fault, with the most likely causes being poor soldering or an incorrectly programmed chip. If you can connect via the USB-toSerial interface but you do not see the Micromite’s prompt, you should check that the Micromite was programmed correctly, that the capacitor on pin 20 is of the correct type and, of course, that your soldering is good. A handy check is the current drawn by the completed module. This is nor- mally about 36mA. You would need to connect an ammeter between a 4-16V DC supply and the bottom row of pins on the board to measure this. If it is closer to 15mA, the Micromite chip is not running correctly, while a current draw of less than 5mA points to a problem with the voltage regulator. So, there you have it. The Explore-28 is an easy to use microcontroller module that you can use as the Semiconductors 1 PIC32MX170F256B-50I/SO microcontroller programmed with MMBasic, SOIC-28 (IC1) 1 PIC16F1455-I/SL microcontroller programmed for Microbridge, SOIC14 (IC2) 1 MCP1703A-3302E/DB low-dropout 3.3V regulator, SOT-223 (REG1) 2 red SMD LEDs, 2012/0805-size (LED1,LED2) Capacitors (all SMD 2012/0805 ceramic) 1 10µF 6.3V X5R 2 4.7µF 16V X5R 2 100nF 50V X7R Resistors (all 1% SMD 2012/0805) 2 10kΩ (Code 103) 4 1.5kΩ (Code 152) 1 10Ω (Code 100) brains of your next project. It is a fun thing to play with and an excellent way of learning to program in the BASIC programming language. SC Micromite Resources Latest firmware versions, manuals and tutorials: .......................................................................................................http://geoffg.net “Getting Started with the Micromite” and “Micromite User Manual”:........................... http://geoffg.net/micromite.html#Downloads The Back Shed forum, where many knowledgeable users can help newcomers:.......www.thebackshed.com/forum/Microcontrollers Microbridge Resources Firmware for the Microbridge (PIC16F1455) in the Explore-28:................................ http://geoffg.net/microbridge.html#Downloads pic32prog, used to program new firmware into the Micromite (Windows):.............. http://geoffg.net/microbridge.html#Downloads P32P, a user-friendly GUI interface for pic32prog.exe (Windows):..... www.thebackshed.com/docregister/ViewDoc.asp?DocID=21 Terminal Emulators Tera Term, the standard terminal emulator used with the Micromite:.................................................... http://tera-term.en.lo4d.com/ GFXterm, a terminal emulator designed specifically for use with the Micromite. It works with the Micromite’s built-in editor and supports a set of graphics extensions:.................... www.thebackshed.com/docregister/ViewDoc.asp?DocID=22 MMEdit, a complete IDE (Integrated Development Environment) specifically designed for the Micromite. It includes advanced features such as colour coded text, formatting, download and run and more:................ www.c-com.com.au/MMedit.htm 60 Silicon Chip Australia’s electronics magazine siliconchip.com.au