This is only a preview of the August 2016 issue of Silicon Chip. You can view 42 of the 104 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. Items relevant to "Touchscreen-Controlled Energy Meter, Pt.1":
Items relevant to "Compact 8-Digit Auto-Ranging Frequency Meter":
Items relevant to "Micromite Plus & The Explore 64 Module":
Purchase a printed copy of this issue for $10.00. |
By Geoff Graham
Micromite Plus
& the Explore 64
This module really packs a punch. Based on our new Micromite
Plus, it’s more than twice as powerful as the original Micromite,
with much faster performance, substantially more RAM,
greater program space (flash memory), more I/O pins, support
for a wide range of touchscreen displays (up to 8-inch!) and
additional functions including support for USB, SD cards and
a PS/2 keyboard. It can act as a sophisticated controller or as a
completely self-contained computer.
T
HE MICROMITE PLUS is based
on a PIC32 chip and is a revised
version of the 28-pin and 44-pin Micromites described in SILICON CHIP
Key Improvements From
Micromite Mk2
• 2.5 times the speed
• 92% more RAM
• 72% more program space
• More I/O pins
• Integrated USB
• Supports 10 different touchscreen
displays
Comprehensive
GUI library code
•
• Native SD card support
• MicroSD card socket
• Cheaper to build than 44-pin Micromite
62 Silicon Chip
over the past couple of years (see
Table 1). While the standard Micromite
was intended for ordinary controller jobs, the Micromite Plus is much
more advanced and can handle more
demanding applications (such as machine controllers).
To quantify some of the improvements, the Micromite Mk2 (described
in January this year) runs at 48MHz and
has 52KB RAM and of 58KB program
space, with between 19 and 33 I/O pins
available depending on the version
(28-pin or 44-pin). By comparison, the
Micromite Plus runs at 120MHz, boasts
100KB RAM, 100KB of program space
and in the version described here, has
a massive 47 I/O pins available, many
of them analog-capable.
The Micromite Plus can run very
large programs very fast; 2.5 times as
fast as the previous Micromite, in fact.
It can also drive LCD touchscreens
with a diagonal size of between 1.44
and 8 inches (~37-163mm), with a
sophisticated graphics library. That
library allows you to create animated
radio buttons, numeric keypads, pushbuttons and many more GUI elements
using just one line of BASIC code.
In addition, the Micromite Plus has
an SD card driver and a USB 2.0 interface, giving it the capability to work as
a self-contained computer.
This article touches on some of the
new Micromite Plus software features
and also describes the Explore 64 module, designed for breadboarding. In addition to hosting the PIC32 chip running the Micromite Plus software and
breaking out the I/Os, serial console
and power pins, it carries an onboard
USB socket, a microSD card socket, a
3.3V regulator, a reset button and an
optional supply supervisor.
In coming months, we will also
siliconchip.com.au
The Micromite Plus
is just a standard 64
or 100-pin Microchip
PIC32MX470 microcontroller programmed
with the MMBasic firmware. It
is this firmware that transforms
the micro into an easy to use
programmable controller that can
interface with multiple devices,
ranging from LCD panels to SD
cards and PS/2 keyboards. Photo
courtesy Microchip.
describe the Explore 100, a full Micromite Plus-based computer with
display, keyboard support and SD
card storage, with even more I/O pins
thrown into the bargain.
Touch-sensitive LCDs
The Micromite Plus includes support for 10 different types of LCD panel
and as previously stated, these range
from a 1.44-inch module to an 8-inch
panel. Note that imperial units are
commonly used for LCD panels and
the specified size is the diagonal measurement of the active screen area. For
example, a 5-inch panel is typically
around 11 x 7cm while an 8-inch panel
would be about 17 x 10.5cm.
The Micromite Plus supports displays that use both serial and parallel
interfaces. There are six supported
display sizes that use serial (SPI) interfaces, between 1.4 and 2.8 inches
diagonal, using ILI9341, ST7735 or
ILI9163 controller chips. The ILI9341
is the same chip that was used in
the Micromite LCD BackPack (introduced in February) but support for the
ST7735 and ILI9163 controllers is new
in the Micromite Plus.
Four different displays with parallel interfaces are also supported.
These range from 4.3 to 8 inches and
it is with these displays that the Micromite Plus really stands out. They
can display text and graphics in true
24-bit colour with a resolution of up
to 800 x 480 pixels. As a result, you
can display vivid photo-quality images
with 16 million colours.
The parallel interface between the
Micromite Plus and the display controller on the LCD panel means that
your BASIC program can update the
display very quickly, even though it is
addressing almost half a million pixels
in full 24-bit colour. This sort of performance is important when you are
displaying intricate graphic objects
siliconchip.com.au
Explore 64: Main Features
• A 32-bit CPU running at 120MHz with 512K of flash memory and 128K RAM.
• Built in BASIC interpreter is Microsoft compatible with 64-bit integer, floating
point and string variables, arrays and user defined subroutines and functions.
47
input/output (I/O) pins which can be independently configured as digital
•
inputs or outputs. 27 of these can be used as analog inputs.
• The Explore 64 can be plugged into a standard solderless breadboard, or into a
protoboard or a custom PCB via standard female headers.
• Supports touch-sensitive LCD panels ranging from 1.44 inches to 8 inches
diagonal. Supports LCDs with up to 16 million colours. Built-in graphics
commands include pixel, line, circle and box.
• Six built-in fonts plus many more fonts that can be embedded in a program.
• Advanced graphics commands include on-screen keyboards, buttons, switches,
checkboxes and radio buttons.
USB
2.0 interface which creates a serial-over-USB communications channel for
•
program editing and upload/download from a larger computer.
• SD card interface supports SD cards with up to 64GB capacity. Up to five files
can be opened simultaneously for read, write and random access.
• Provision for a PS/2 keyboard so that the Explore 64 can act as a fully selfcontained computer and development system.
All
• the standard features of the Micromite range, including a comprehensive
range of communications protocols, inbuilt commands to directly interface with
devices such as an IR remote control and temperature sensors, PWM or SERVO
outputs and special embedded controller features such as variable CPU speed,
sleep, watchdog timer and automatic start and run.
• Power supply: 5V <at> 80mA (not including LCD current drain, etc).
such as radio buttons, check boxes
and virtual keypads.
GUI commands
The Micromite Plus has all the
BASIC graphics commands supported by the standard Micromite (PIXEL,
LINE, BOX, CIRCLE, etc). But it also has a
range of Graphical User Interface (GUI)
commands that are both powerful and
easy to use.
For example, by using a GUI command, you can define a check-box
on the screen. When this is touched,
it will be checked with a cross and
when touched a second time it will
be unchecked. This checking and unchecking is handled in the background
(by the MMBasic interpreter) without
involving the main BASIC program.
Another example is the text box.
This is an on-screen box which, when
touched, will display a full alphanumeric keyboard, allowing text to be
entered and edited via the touch-sensitive screen.
These are just two examples of the
controls built into MMBasic and the
range is extensive. Included are radio
buttons, switches, pushbuttons, multicolour LEDs, numeric keypads and
spin boxes.
MMBasic handles all the drawing,
animation and interface requirements
for GUI elements. All that the BASIC
program needs to do is define the onscreen control (with a single command) and from then on, MMBasic
Table 1: Micromite Articles In SILICON CHIP
Title
Publication Date
The Micromite
May & June 2014
ASCII Video Terminal
July 2014
The 44-pin Micromite
August 2014
The Micromite Mk2
January 2015
Micromite LCD BackPack
February 2016
August 2016 63
MIPS 32-bit processor core which can
run at up to 120MHz and supports
512KB of flash memory and 128KB of
RAM. This might sound complex and
daunting but they are not expensive
and the complexity is hidden by the
MMBasic interpreter.
This month, we are presenting the
Explore 64 which uses the 64-pin version of the chip, while a future instalment will introduce the Explore 100
which uses the 100-pin chip and is
designed to mount on the back of a
5-inch LCD panel (although it can be
used stand-alone or with a different
display).
Explore 64
Fig1: this is an example of an on-screen control panel that can be created using
the Explore 64 and an LCD panel. Most objects on the screen are touch-sensitive
and will react when touched. Each is created with a single BASIC command
and from then on MMBasic will manage the display, including animating the
objects when a user touches them. We will describe these GUI controls in detail
in a later article.
does the rest. The BASIC program flow
is unaffected by this activity and can
later inspect the state of the control
using a single function.
Fig.1 shows an example of a complex pump control panel that is constructed from GUI commands. Each
object on the screen required just one
line of BASIC code to create it. The GUI
controls will be described in detail in
article in this series.
SD card & keyboard
The Micromite Plus includes support for SD cards with capacities up
to 64GB, formatted as either FAT16 or
FAT32. Programs can be loaded and
saved to the SD card and up to five
data files can be open at the same time
from within a BASIC program. These
files can be opened for reading, writing
or random access. The latter provides
quick access to any part of a file and is
useful for storing and recalling large
amounts of data.
Images held on the SD card can be
loaded under program control and
displayed on the attached LCD to add
screen logos or background images.
The files created on the SD card are
compatible with Windows, Linux or
Macintosh systems, so data can be easily transferred from the Micromite Plus
to a desktop computer for analysis.
Another important feature of the
Micromite Plus is the ability to attach a PS/2 keyboard. This allows
the Micromite Plus to be the heart of
64 Silicon Chip
a fully self-contained computer, with
programs composed and edited on the
LCD and saved to an SD card. This is
reminiscent of the TRS-80 and Commodore 64 computers of the 1970s and
the Maximite series of computers featured in SILICON CHIP in recent years.
MMBasic includes its own colourcoded program editor, so an external
computer is not required for the user
to compose, edit and run their own
programs on the Micromite Plus. If
you wish, you can also compose and
edit programs on a larger desktop or
laptop computer and transfer them to
the Micromite Plus using the USB interface or the serial console.
PIC32 microcontroller
The Micromite Plus firmware will
run on a number of Microchip PIC32
microcontrollers with either 64 or 100
pins (see Suitable Microcontrollers
panel). All come in surface-mount
TQFP packages but their pin pitch is a
relatively forgiving 0.5mm, so they can
be hand-soldered to a carrier board.
SILICON CHIP sells suitable carrier
boards, ie, www.siliconchip.com.au/
Shop/18/3227 and www.siliconchip.
com.au/Shop/18/3218
Note, however, that this type of
adaptor normally has pins along all
four edges and so it is not suitable for
plugging into a breadboard, while the
Explore 64 is.
The PIC32 microcontrollers listed
in the panel each have an optimised
The Explore 64 is a small PCB designed by SILICON CHIP reader Graeme Rixon of Dunedin, NZ. It can be
plugged into a solderless breadboard
for prototyping and for exploring the
capabilities of the Micromite Plus but
could also be used as a replaceable
module that’s plugged into a larger
system.
The PCB includes a 64-pin PIC32
(the Micromite Plus), a mini USB
connector, a microSD card socket and
the power supply parts. There are 47
I/O pins. Of these, 17 are 5V tolerant,
while 27 can be used as analog inputs.
So there’s plenty of capability to develop a complex project that requires
lots of I/O ports.
In order to make it small enough
to fit onto a breadboard, the PCB was
designed using surface-mount components. Despite this, it’s not difficult to
build. IC1 (the microcontroller) uses a
0.5mm spacing between its pins and
can be hand-soldered using a normal
temperature-controlled soldering iron.
In addition, the solder pads for the
passive components will accept either
1206, 0805 or 0603-size components,
so you can use whatever size suits your
soldering skills.
Circuit details
Fig.2 shows the circuit details of the
Explore 64. It’s designed to run from
a 5V supply and this can be fed in via
USB socket CON1, if jumper JP1 is fitted. Alternatively, if JP1 is removed,
the 5V supply can be fed in via the 5V
IN and GND pins on the board’s edge.
The 5V supply is reduced to 3.3V by
low-dropout linear regulator REG1, an
MCP1703A. The resulting +3.3V rail
is then used to power microcontroller
IC1 and is also made available on an
siliconchip.com.au
BOARD
RH EDGE
PWR PINS
REG1 MCP1703A-33E
10 µF
X5R
GND
+5V
GND
100nF
100nF
A
3x
100nF
10 µF
X5R
BOARD
LH EDGE
I/O PINS
PIN NUMBERS IN BLUE INDICATE
ANALOG-CAPABLE INPUTS
+3.3V
OUT
IN
33
IC1 PIN 33
λ LED1
32
K
+3.3V
CON4
JP1
CON1
MINI USB
TYPE B
+3.3V
30
+3.3V
29
28
100nF
10
26
38
57
35
Vdd
Vdd
Vdd
Vdd
VUSB 3V3
19
AVdd
34
VBUS
36
D–
37
D+
33
USBID/RF3/RPF3
1
2
3
X
4
SB1
PIN NUMBERS IN RED
INDICATE 5V TOLERANT INPUTS
BOARD
RH EDGE
I/O PINS
31
1k
10Ω
42
43
44
45
46
47
48
49
50
51
52
53
54
55
42
43
44
45
46
47
48
49
50
27
24
32
PMA8/RPF5/RF5/SCL2
31
PMA9/RPF4/RF4/SDA2
30
PMA0/RPB15/RB15/AN15
29
PMA1/RPB14/RB14/AN14
28
PMA10/TDI/RB13/AN13
27
PMA11/TCK/RB12/AN12
24
TDO/PMA12/RB11/AN11
23
TMS/RPB10/RB10/AN10
22
RD8/RPD8/RTCC
PMA7/RB9/AN9
21
RB8/RPB8/AN8
RD9/RPD9/SDA1
18
RD10/RPD10/SCL1
PGED2/RB7/AN7
17
RD11/RPD11/PMCS1
PGEC2/RB6/AN6
RD0/RPD0/INT0
14
PGEC3/RB2/AN2
RC13/RPC13/SOSC1
13
PGED3/RB3/AN3
12
RC14/RPC14/T1CK
RB4/AN4
AN24/RD1/RPD1
11
VBUSON/RB5/AN5
AN25/SCK1/RD2/RPD2
8
AN26/RPD3/RD3
PMA2/RPG9/RG9/AN19
6
RD4/RPD4
PMA3/RGP8/RG8/AN18
5
RD5/RPD5
PMA4/RPG7/RG7/AN17
4
RD6
RG6/SCK2/RPG6/AN16
3
RD7
RE7/PMD7/AN27
2
RE6/PMD6/AN23
IC1
1
RE5/PMD5/AN22
PIC3 2 MX470PIC32MX470-
23
22
21
18
17
16
IC1 PIN16
IC1 PIN15
15
14
13
12
11
8
IC1 PIN7 (MCLR)
7
6
5
4
F512H
51
3
52
2
53
1
54
DATA TO CARD
55
58
RF0/RPF0
59
RF1/RPF1
58
60
RE0/PMD0
61
RE1/PMD1
62
RE2/PMD2
63
RE3/PMD3
64
59
60
61
62
+3.3V
63
7
CON6
16
10k
15
20
9
Vss
Vss
Vcap
25
41
56
10 µF
PGD
1
PGC
22pF
2
3
4
5
IC1
22pF
1
CON2
PROGRAMMING
(ICSP) HEADER
CATHODE
DOT
SC
20 1 6
CD
X5R
100nF
Vcc
OPTIONAL
40
X1 20MHz
DATA FROM CARD
CARD DETECT
OSC2 AVss Vss
39
GND
Vss
IC1 PIN47
AN1/RB1/RPB1/PGEC1
470Ω
MCLR
Vdd
1
2
3
4
5
6
7
8
CLOCK TO CARD
MCLR
IC2 MCP120-270
RST
+3.3V
AN0/RB0/RPB0/PGED1
OSC1
RESET
S1
CON3
MICRO SD
CARD SOCKET
RE4/PMD4
64
CON5
CARD ENABLE
MICROMITE+ EXPLORE 64
MCP120
LED
Vin
GND
RST
A
MCP1703
Vss
K
Vdd
Vout
Fig.2: the Explore 64 is mostly a carrier for the 64-pin Micromite Plus (IC1), so its circuit is relatively simple. Most
I/O pins from the microcontroller are made available on the board’s edge where they can be plugged into a solderless
breadboard or into header sockets on a larger board. Voltage regulator REG1 provides 3.3V for the microcontroller and
the reset supervisor (IC2) ensures that the microcontroller is held in reset if the 3.3V supply drops below a critical level.
I/O pin on the board’s edge for powering external circuitry.
The capacitors across the supply
lines before and after the regulator
ensure regulator stability and reduce
siliconchip.com.au
variations in supply voltage with
changing current demands. Note the
capacitor connected between pin 56 of
IC1 and ground. This stabilises IC1’s
internal 1.8V core regulator and must
be a multilayer ceramic type, preferably with an X5R or X7R dielectric.
Ideally, all capacitors should be X5R
or X7R ceramic types except for the
22pF crystal load capacitors which
August 2016 65
16
10 µF
K
Micromite Plus Explore 64
RevC
Micromite Plus by Geoff Graham
07108161
LED1
CON1
USB-B
MCP1703A-3302E/DB
22pF
REG1
22pF
10 µF
470Ω
10k
100nF
100nF
100nF
IC2
100nF
10Ω
(optional)
1k
100nF
100nF
PCB by RICTECH
100nF http://geoffg.net/micromite.html
www.rictech.nz
X5R
SB1
JP1
10 µF
X1
20MHz
Vbus
3.3V
OUT
5Vin
GND
48
47
46
45
44
43
42
= 5V tolerant
17
18
21
22
23
24
27
28
29
30
31
32
33
02
49
IC1
PIC32MX
470F
512H
03
04
05
06
MCLR
08
11
12
13
14
15
01
S1
ICSP
1
12 3 4 5 6 78
CON3
microSD
RESET
CON2
59
CD
58
55
54
53
52
51
50
62
61
60
64
63
Fig.3: follow these top and bottom PCB parts layout diagrams to build the Explore 64. The top of the PCB (left) carries
most of the parts including the microcontroller, SD card socket and USB connector, while most of the power supply
components and I/O pin headers are on the bottom side.
Compare these photos with the layout diagrams when installing the parts on the PCB and
check that all polarised parts are correctly orientated. CON1-CON3, IC2 and S1 can be left
off if they are not required but most constructors will want to fit them.
should be C0G/NP0 ceramic. As a bonus, these capacitors tend to have a
very long life (practically indefinite).
I/O pins
Most of IC1’s I/O pins are connected
to pads along the sides of the PCB, as
depicted on either side of the circuit
diagram and in Table 2, along with
pads for the +5V and +3.3V supply
rails and ground. CON3 is the microSD
card connector. The I/O pins used for
this connector are also brought out to
the sides of the PCB so that they can be
used as general purpose I/O pins if the
microSD connector isn’t used.
IC2 (bottom left of Fig.2) is an optional “supervisor” chip. This holds
the Micromite Plus in reset until the
3.3V power supply reaches a set level
(2.7V in this case). It will also monitor
the 3.3V line and reset the microcontroller if there is a glitch or if the supply drops to a low value (a brown-out
condition). IC1 has an internal brownout detector but its threshold is much
lower and external circuitry could stop
working well before this trips.
The supervisor chip will be important if the Micromite Plus is used in
an industrial situation where power
fluctuations and electrical noise are
common. In other situations, the supervisor chip is not critical and so IC2
and its associated 100nF capacitor can
be left out with no ill-effects. We’ll be
supplying the MCP120-270 in our kits,
so you might as well fit it anyway; it
certainly won’t hurt.
CON2 is an in-circuit serial pro-
Suitable Microcontrollers
The Micromite Plus uses Microchip’s MX470 series chips. These are part of
Microchip’s PIC32 (32-bit processor) range and are available in 64-pin and 100pin packages with top speeds of 100MHz or 120MHz.
The Micromite’s firmware starts up at 100MHz so you can use chips with
either speed. However, a 120MHz version gives you option of stepping up to
120MHz in your program.
The recommended chips for the Micromite Plus are:
• PIC32MX470F512H-I/PT: 64-pin, 100MHz
• PIC32MX470F512H-120/PT: 64-pin, 120MHz
• PIC32MX470F512L-I/PF: 100-pin, 100MHz
• PIC32MX470F512L-120/PF: 100-pin, 120MHz
SILICON CHIP will supply the 120MHz version in all cases, ie, for individually
purchased programmed PICs as well as in kits.
66 Silicon Chip
gramming (ICSP) header and this allows the Micromite Plus firmware to
be loaded into a blank microcontroller.
It suits a Microchip PICkit 3 programmer or similar.
The only other items of note are the
USB socket, which connects directly
to IC1, and a 20MHz crystal which is
used as the clock source for IC1. SB1
is a solder bridge which should be left
open; it’s included to give the option
of supporting a USB device (such as
a USB keyboard) in a future firmware
upgrade.
Construction
Building the Explore 64 is reasonably easy despite the fact that it uses
SMD components. Soldering SMD
devices is not that much harder than
soldering through-hole components;
it just requires a different technique
and is easy when you have mastered it.
The essential tools are a good magnifier, plenty of flux and a steady hand.
The magnifier needs to be at least x3
power and preferably x10. A jeweller’s
loupe can be used but the best option
is a stereo microscope and SILICON CHIP
reviewed some good candidates in the
July 2014 and November 2015 issues.
The flux should be a good quality
flux paste/gel such as Cat. H1650A from
Altronics or Cat. NS3036 from Jaycar.
Fig.3 shows the parts layout on the
Explore 64 PCB. The first step is to install microcontroller IC1. Apply flux to
all of its pads, then position the chip so
that its pin 1 (marked with a dimple)
siliconchip.com.au
Table 2: Explore-64 I/O Pin Allocations
SSD1963 D5 - ANA
1
64
ANA - SSD1963 D4
SSD1963 D6 - ANA
2
63
5V - SSD1963 D3 - PWM1C
SSD1963 D7 - ANA
3
62
ANA - SSD1963 D2
SPI2 CLOCK - ANA
4
61
5V – SSD1963 D1
SPI2 OUT - ANA
5
60
5V – SSD1963 D0
CONSOLE Rx
6
59
5V – COM1 Rx
CPU Reset when Low
58
CONSOLE Tx
SPI1 OUT - ANA
8
55
5V - KEYBOARD DATA
COM2 Tx - ANA
11
54
5V - KEYBOARD CLOCK
ANA
12
53
5V - PWM 2A
COM2 Rx - ANA
13
52
5V - COUNT
ANA
14
51
ANA - COUNT - WU - IR
COM1 Tx - ANA
15
50
ANA - SPI1 CLOCK
COM3 Tx - ANA
16
49
ANA - COUNT
COM3 Rx - ANA
17
48
PWM 1A
ANA
18
47
SPI2 IN - PWM 2B
ANA
21
46
5V
ANA
22
45
5V - SPI1 IN
COUNT - ANA
23
44
5V - I2C CLOCK
SSD1963 WR - ANA
24
43
5V - I2C DATA
42
5V - PWM 1B
SSD1963 RS - ANA
27
SSD1963 Reset - ANA
28
COM1 Enable - ANA
29
ANA
30
3.3V OUTPUT (100mA MAX)
5V
31
5V OUTPUT OR INPUT
5V
32
GROUND
DIGITAL INPUT ONLY
33
(1) Pin Nbr refers to the number used in MMBasic to identify an I/O pin; (2) All pins (except 33) are capable of digital input/output and can
be used as an interrupt pin; (3) ANA means that the pin can be used as an analog input; (4) 5V means that the pin is 5V tolerant; (5) COUNT
means that the pin can be used for counting or frequency/period measurement; (6) SSD1963 refers to pins that are used to interface to LCD
panels using the SSD1963 controller; (7) If the serial console is disabled the CONSOLE pins can be used for COM4
Note: the Explore 64 is shown here scaled up by a factor of almost 2.
is lined up with the pin 1 marking on
the PCB (at left). That done, hold it in
position using a toothpick or tweezers
and solder one corner pin.
Now check that the IC is correctly
aligned; if not, re-melt the solder while
gently nudging it into position. Once
it’s in position, apply more flux to all
the pins and solder each one in turn,
then recheck the first pin and add fresh
solder if necessary.
The technique here is simple; put a
very small amount of solder on your
iron’s tip, touch the tip to the solder
pad and slide it forwards to gently
touch the first pin. The solder should
flow around the pin and the pad. You
should then be able to solder at least
siliconchip.com.au
15 more pins (one side of the IC) before you need to add more solder to
the iron.
The secret is to be generous with
the flux, as this will allow the solder
to flow freely onto the pads and their
corresponding pins. Alternatively, if
you have a mini-wave tip or a very
steady hand, with sufficient flux in
place, you can drag solder across one
side (16 pins) in a single movement.
Often you will find that you are
actually soldering two or more pins
simultaneously but the solder will
not usually bridge the pins. If it does,
this is an indication that you have too
much solder on your iron. If any pins
are bridged, come back later with sol-
der wick (and more flux) and remove
the excess.
The SD card connector is next on
the list. It’s located on the PCB by two
small plastic pins that match two holes
on the board. Solder its four mounting
lugs first, followed by the signal pins.
These pins are soldered using the same
technique as for IC1.
Note that the SD card connector’s
pins are fragile and the plastic they
are embedded in will melt if too much
heat is applied so only touch the soldering iron to the pins for a very short
time. As before, apply plenty of flux
before soldering.
The mini-USB connector can now
go in. It also has locating pins to posiAugust 2016 67
A Microchip
PICkit 3 can be
used to load the
firmware into
the PIC32 micro.
Alternatively,
you can buy a
pre-programmed
PIC32 chip from
the SILICON CHIP
Online Shop.
tion it correctly and you should push
it down firmly so that it sits flush
against the board. Once again, solder
the mounting lugs first and then the
signal pins. These are a bit of a challenge as they are partially under the
connector’s body and you will need a
fine-tipped soldering bit to reach them;
we have extended the pads outside the
body to make this easier.
Passive SMD components
Soldering the passive SMD compo-
nents requires a different technique
compared to that used the microcontroller. Start by applying flux to one
solder pad and then tin it by applying
a thin layer of solder to it. That done,
you have two choices.
First, you can place the component
in position and hold it still with a
toothpick or tweezers while you apply the iron’s tip to the end sitting on
the tinned pad, so that the component’s lead sinks into the solder underneath. Alternatively, you can slide
the component into place while heating the solder on the pad. The second
technique will probably require more
practice but it will be quicker once
you get used to it.
Either way, once the component is
secure, apply more flux and solder the
other end before returning to the first
to make sure that the joint is good.
Once again, the secret is to use plenty of flux and don’t forget that it may
have boiled off one of the pads while
you were soldering the other end of
the component, so keep reapplying it.
LED1 (the power indicator LED) is
polarised and should be marked with
a bar or dot on the cathode end. Some
LEDs might be different so it’s good
practice to use a multimeter’s diode
test facility to check the polarity. Be
sure to solder it in with its cathode
towards the bottom of the board, as
shown in Fig.3.
You can use a similar technique as
used for the passives to solder regulator REG1 and IC2 (if this is to be fitted). The only trick is that with REG1,
you first apply flux to all four pads
and then start by soldering one of the
smaller leads. That done, check its
alignment before soldering the other
smaller leads and finally the large tab.
It may take a few seconds to heat the
part and PCB up enough to get a good
solder joint on that tab.
Crystal X1 is a through-hole part
and can be soldered using the usual
method. PCBs supplied by SILICON
CHIP will have solder mask over the
top side of the mounting pads so it
should be possible to push the crystal
can right down onto the PCB surface
before soldering it.
That just leaves tactile pushbutton
S1 (which can be fitted either way
around) and the various pin headers,
which are made by snapping longer
pin headers to length and then soldering them in the usual manner. Normally, JP1 and CON2 should be fitted
on the top of the board, with the other
pin headers on the bottom (see Fig.3).
CON2 does not need to be fitted if you
have a pre-programmed PIC chip.
Loading firmware into the PIC32
Pre-programmed PIC32s are available from the SILICON CHIP Online
Shop. If using a blank PIC32 chip,
you will need to program it yourself.
In this case, you will need a suitable
programmer such as a PICkit 3 from
Microchip.
The Explore 64 has a set of header
pins on the top surface labelled ICSP
and the PICkit 3 plugs directly onto
them (see photo at left).
The first step is to download the
firmware from the SILICON CHIP website and extract the Micromite Plus
HEX file (0710816A.hex). It’s then just
a matter of using your computer and
the MPLAB software supplied with
the PICkit 3 (or downloaded from Microchip) to program the HEX file into
the microcontroller (see page 26 of the
February 2016 issue for further details).
During this procedure, the PICkit3
will verify the programming operation
by reading back the data on the chip.
If it reports a fault, you will need to
fix that before progressing. Usually
though, the programming operation
Pin 6
USB-to-Serial
Converter
Explore 64
Pin 58
Fig.4: here’s how to connect a USB-to-serial converter between your PC and the Explore 64. Note that the converter
can supply the 5V power required by the Explore 64 but you also need to fit jumper JP1 (see text).
68 Silicon Chip
siliconchip.com.au
USB-to-Serial
Converter
A USB-to-serial converter
such as this CP2102-based
unit from the SILICON CHIP Online
Shop is necessary in order to use
the serial console when developing or
editing programs. This unit is supplied
complete with a short DuPont cable
Explore 64 Parts List
and plugs directly into your PC’s USB
port (which also supplies the power).
The DuPont cable then connects between the converter and the Explore
64 as shown in Fig.4.
Fig.5: this is what
you should see
in your terminal
emulator when
you press the reset
button on the
Explore 64. If you
don’t see this, the
probable reason is
that the USB-serial
converter is not
connected correctly.
will be verified as OK, indicating that
the PIC32 has been correctly programmed.
Serial console
To set up and use the Explore 64,
you must connect a terminal emulator
to its console. The console is a serial
interface over which you can issue
commands to MMBasic to configure
the chip and edit or run programs.
MMBasic also uses the console to display error messages.
The Explore 64 actually has two
consoles, one serial and one USB. The
USB console is useful for making quick
changes to a running program or for developing a program where the Explore
64 is being used as a general-purpose
computer. However, if you are using
the Explore 64 as a controller, it’s best
to use the hard-wired serial console
via a USB-to-serial converter.
The reason for this is that when the
Micromite Plus PIC32 is reset, it will
also reset its USB interface. This generally means that you must close the
terminal emulator then restart it to
restore the connection. When you are
developing a program for controlling
other equipment, you often need to reset the Micromite Plus and repeatedly
closing and re-opening the terminal
emulator can get tedious.
A USB-to-serial converter is required in order to use the hard-wired
serial console. One end of this consiliconchip.com.au
verter plugs into a USB port on your
computer, while the other end connects to the Explore 64’s serial console (Fig.4). To your computer it will
look like a serial port (via USB), while
the connection to the Explore 64 is a
standard serial interface with TTL (03.3V) signals levels.
We recommend converters based
on the CP2102 chip. These are available from the SILICON CHIP online
shop at www.siliconchip.com.au/
Shop/7/3437 It is supplied with a
short DuPont female/female cable
which plugs straight into the Explore
64 board. We also have USB/serial converters based on other chipsets (see our
website for the full listing).
Fig.4 shows how a CP2102-based
converter is connected to the Explore
64 (other types should be similar). Note
that the converter feeds through the 5V
supply rail derived from the PC’s USB
port to power the Explore 64.
When the converter is plugged into
your computer and the correct driver
is installed, it will appear as a serial
port (eg, COM3 in Windows). You then
need to start a terminal emulator on
your computer.
For Windows we recommend Tera
Term V4.88 which can be downloaded
for free from http://tera-term.en.lo4d.
com You will need to set its interface
speed to 38,400 baud and connect
it to the serial port created by the
USB-to-serial converter.
1 double-sided PCB, code
07108161, 72 x 27mm
1 tactile switch, 2-pin, surfacemount (S1)
1 20MHz crystal, low profile
HC-49 (X1)
1 Mini USB type B socket (CON1)
(Altronics P1308 or similar)
1 microSD card socket (CON3)
(Altronics P5717 or similar)
2 40-pin or 50-pin male headers,
2.54mm pitch (JP1, CON2,
CON4-6)
1 shorting block (JP1)
Semiconductors
1 PIC32MX470F512H-120/PT
(120MHz) or PIC32MX470F512H-I/PT (100MHz) 32-bit
microcontroller programmed
with 0710816A.hex (IC1)
1 MCP1703A(T)-3302E/DB lowdropout 3.3V regulator, SOT223 (REG1)
1 MCP120(T)-270I/TT 2.7V
supply supervisor, SOT-23 (IC2;
optional – see text)
1 green SMD LED* (LED1)
Capacitors**
3 10µF 6.3V ceramic, X5R or X7R
7 100nF 50V ceramic, X5R or X7R
2 22pF ceramic, C0G/NP0
Resistors, 1% or 5%*
1 10kΩ
1 470Ω
1 1kΩ
1 10Ω
* Use SMD 3216 (1206 imperial)
size; 2012/0805 or 1608/0603
sizes are also suitable but not
recommended for beginners.
Where To Buy Parts
A kit for the Explore 64 is available from the SILICON CHIP Online
Shop.This includes the PCB, a programmed PIC32 microcontroller
and all other parts as listed above.
The PCB & programmed Micromite Plus microcontrollers are also
each available separately.
Also available are CP2102 USBto-serial converters and 2.8-inch
ILI9341 touchscreen displays (as
used in the LCD Backpack).
PCBs, complete kits and fully
assembled and tested Explore 64s
are also available from Graeme
Rixon (the designer of the PCB)
– see www.rictech.nz/micromiteproducts
August 2016 69
Supported LCD Panels
The Micromite Plus has built-in support for 10 different LCD panels, as follows:
1.44-inch ILI9163-Based Displays
ILI9163-based displays use an SPI interface and have the
following basic specifications:
• A 1.44-inch LCD.
• 128 x 128 pixels resolution.
• 25.5 x 26.5mm viewing area.
• Do not come with a touch controller.
• Do not have an SD card socket.
A typical ILI9163 based display is shown at right. You can find suitable displays on
eBay by searching for the controller name, ie, “ILI9163”. Be warned that some
displays with a red PCB won’t work with the Micromite Plus. Choose a display with a
black PCB (as illustrated), as these have been tested and work correctly.
1.8-inch ST7735-Based Displays
The ST7735-based displays also use a SPI interface
and have the following basic specifications:
• A 1.8-inch LCD.
• 160 x 128 pixel resolution and a colour depth of
262K/65K.
38
• x 35mm viewing area.
• Do not come with a touch controller.
• Have a full-size SD card socket.
You can find suitable displays on eBay by searching for “ST7735”.
2.2 to 2.8-inch ILI9341-Based Displays
ILI9341-based displays use an SPI interface and
have the following basic specifications:
• A 2.2, 2.4, 2.6 or 2.8-inch LCD.
• 320 x 240 pixel resolution and a colour depth of 262K/65K
• 43.5 x 35mm to 57.5 x 43mm viewing area.
• May have a touch controller (SPI interface).
• Have a full-size SD card socket.
The display that you purchase should look like the display
shown at right, as there are other ILI9341-based displays which use a
different interface and will not work with the Micromite.
In most cases, this display has a touch-sensitive facility which is fully
supported by MMBasic. However, there are some versions of this display without the touch controller (the 16-pin IC on the back of the PCB
at bottom right).
The standard Micromite also supports the ILI9341-based displays
(both 28-pin and 44-pin versions).
Once that’s been done, hit the Enter
key in the terminal emulator and you
should see the Micromite’s command
prompt (>). You can then enter, edit
and run programs from this command
prompt using nothing more than the
70 Silicon Chip
PC’s terminal emulator and the USB
cable.
Testing
If you don’t see the Micromite’s
prompt, something is definitely wrong
and you will need to go through the
following troubleshooting procedure.
The first step is to measure the current drawn by the Explore 64 from
the 5V power supply. With nothing
attached to its I/O pins, this should be
siliconchip.com.au
4.3 to 8-inch SSD1963Based Displays
Displays based on the SSD1963
controller use a parallel interface,
are available in sizes from 4.3 to 8
inches and have much better specifications than the smaller SPIbased displays. The characteristics of supported SSD1963-based
displays are:
• A 4.3, 5, 7 or 8-inch LCD.
• 480 x 272 pixels resolution for
the 4.3-inch version; 800 x 480
pixel resolution for 5, 7 and 8-inch
versions.
95
• x 54mm to 176.5 x 99mm viewing area.
• SSD1963 display controller with a parallel interface (8080 format).
• Have a touch controller (SPI interface).
• Have 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 in the photo at top right. It is strongly recommended that any display purchased has this
type of connector so that you can be reasonably confident that the manufacturer has followed the standard that the Micromite
Plus is designed to use.
The 8-inch display supplied by the Chinese company EastRising uses a different connector layout to that shown, However, it has
been tested with the Micromite Plus and works perfectly.
60-80mA. If it’s substantially more or
less than this, it indicates that something is wrong with either the soldering, the microcontroller or its power
supply.
If this is the case, check that +3.3V is
present on pins 10, 26, 38, 57 & 35 of
IC1 and on various other components
– see Fig.1. If this checks out, check
that the capacitor connected to pin 56
(Vcap) of IC1 is correctly soldered and
is the correct type; it must be a 10µF
siliconchip.com.au
multi-layer ceramic type. A faulty capacitor will prevent the internal CPU
from running and the current drain
will be quite low (less than 10mA).
A disconnected pin can also prevent
the micro from running so check the
soldering on IC1’s pins. It’s easy to miss
a pin and leave it floating just above
its solder pad and without a decent
magnifier and bright light, this may
not be obvious.
Another cause of low current drain
is either not programming the Micromite Plus firmware into the PIC32 chip
or ignoring an error during this operation. Check that the micro has been
correctly programmed.
If the current drain is about right,
the next step is to attach the Explore
64’s console to your computer or terminal emulator as shown in Fig.4. You
could also try using the USB connector as the console but this is best left
until last as it can involve some work
August 2016 71
Fig.6: this is the
display that you
will see on the
LCD when the
command GUI
TEST LCDPANEL is
used. The display
is animated with
the circles being
rapidly drawn on
top of each other.
in installing the correct device driver
and that would just confuse the testing process.
With the console connected, press
the Reset button on the Explore 64
and you should see the start-up banner as shown in Fig.5. Note that you
will not see this banner if you are using the USB console because resetting
the Micromite Plus will also reset the
USB interface.
If you don’t see the start-up banner you should check the console Tx
pin for some activity when the Reset
button is pressed (this indicates that
MMBasic is outputting its start-up banner). This can be done using a logic
probe, oscilloscope or, at a pinch, a
moving coil multimeter. If you do see
some activity, the fault is probably either an incorrect console connection
or is in the USB-to-serial converter.
User manuals
The Micromite Plus is quite an advanced device. After all, it is a full
computer with a multitude of facilities. As a result, it has two user manuals which together add up to almost
150 pages.
The first manual is called the “Micromite User Manual” and it describes
the features that are standard across
the whole Micromite range, from the
original 28-pin version to the 100-pin
Micromite Plus (to be described in this
magazine in the near future). The extra features of the Micromite Plus are
described in the “Micromite Plus Addendum” which covers subjects such
as the GUI functions, the SD card interface and other features that are only
found in the Micromite Plus.
Both manuals are in PDF format
and available for free download from
the SILICON CHIP website. Before you
build and test the Explore 64, it would
72 Silicon Chip
be worthwhile downloading and looking through them as they provide a lot
more information than we can fit into
these pages.
Configuring an SD card
Once your Explore 64 is up and running, you can configure it to use an
SD card. This occupies I/O pins 4, 5,
12, 14 & 47, ie, they can no longer be
used as general purpose I/Os (GPIOs).
To set up the SD card, you need
to use the OPTION SDCARD command.
Note that this must be entered at the
command prompt and can not be used
in a program. The syntax is:
OPTION SDCARD CS-pin, CD-pin
where “CS-pin” is the I/O pin number that is used as chip select and
“CD-pin” is the I/O pin number used
for the card detect pin on the SD card
connector.
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.
On the Explore 64, 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 you should
enter the following command:
OPTION SDCARD 12, 14
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.
As another test, you can pop an SD
card into the slot and run the command FILES. This will list all the files
and directories on the SD card.
Note that some SD cards can be temperamental and may not work so if you
encounter a problem here, try a few SD
cards before deciding that you have a
fault. For example, some cards (especially high capacity, fast types) may
demand more current than the power
supply on the Explore 64 can provide.
USB interface
The USB interface on the Explore
64 doesn’t need configuring. MMBasic
monitors the interface and if it detects
a host computer, it automatically configures it for serial emulation over USB.
A Windows-based host computer
(versions before Windows 10) will require the installation of the “SILICON
CHIP Serial Port Driver”, which can
be downloaded from the SILICON CHIP
website. Macintosh and Linux based
computers do not need a device driver,
as support is built into the operating
system.
Similarly, Windows 10 should not
require any drivers to be installed.
Once configured, the USB interface
works just like a serial port that’s connected to the console. You can start
up a terminal emulator such as “Tera
Term for Windows” and tell it to connect to the virtual serial port created
by the Micromite Plus.
Anything outputted by the Micromite Plus will be sent out on both the
USB interface and the serial console.
Similarly, anything received on either of these interfaces will be sent to
MMBasic.
One benefit of using the USB interface as the console is that you can
disable the serial console. This allows
you to use the I/O pins allocated to the
serial console for other duties, including use as a fourth serial I/O port. This
is described further in the “Micromite
Plus Addendum”.
Configuring a display
As stated, MMBasic for the Micromite Plus has inbuilt support for 10
different LCD panels (1.44 to 8 inches). The smaller displays employ an
SPI interface which uses only five I/O
pins, so they are a good choice when
you need a small display and want to
keep as many I/O pins free as possible.
By contrast, the larger displays (4.38 inches) use an 8-bit parallel interface
to transfer data. This requires 11 I/O
pins but this is a small sacrifice considering the speed that it brings.
siliconchip.com.au
The full selection of supported displays is listed in an accompanying
panel. Note that you do not have to
use a display with the Explore 64; it
is entirely optional and MMBasic will
work perfectly well without one.
Having said that, using an LCD
touchscreen is so simple and it adds
such a professional air to a project that
it is hard to think why you would not
want to use one.
To configure the Micromite Plus for
a particular LCD panel, use the OPTION
LCDPANEL command. This comes in
two forms. Displays with an SPI interface use this form:
OPTION LCDPANEL controller, orientation,
D/C pin, reset pin [, CS pin]
While displays that have a parallel
interface use this form:
OPTION LCDPANEL controller, orientation
[, LCD-A pin]
The “controller” parameter defines
what type of display controller chip is
used on the display. This can be one of:
• ILI9163: a 1.44-inch display with an
ILI9163 controller.
• ST7735: a 1.8-inch display with an
ST7735 controller.
• ILI9341: A 2.2, 2.4, 2.6 or 2.8-inch
240 x 320 pixel display with an ILI
9341 controller.
• SSD1963_4: a 4.3-inch display with
an SSD1963 controller.
• SSD1963_5: a 5-inch display with an
SSD1963 controller.
• SSD1963_5A: an alternative version
of the 5-inch display if SSD1963_5
doesn’t work.
• SSD1963_7: a 7-inch display with an
SSD1963 controller.
• SSD1963_7A: an alternative version
of the 7-inch display if SSD1963_7
doesn’t work.
• SSD1963_8: an 8-inch display sup-
plied by the Chinese company EastRising (www.buydisplay.com).
The “orientation” parameter specifies the normal position of the display
which might be mounted in a portrait
orientation or even upside-down. Your
choices for this parameter are 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.
The remaining parameters in the
siliconchip.com.au
When using an LCD panel that has an SSD1963 controller, the Micromite Plus can
display 800x480 pixels in true (24 bit) colour. This image of a tiger demonstrates the
resolution and colour range.
command specify some of the I/O
pins used for the display. There are
other pins that are dedicated when
you specify a type of display as listed
the “Micromite Plus Addendum”. This
specifies exactly how to connect a display and what I/O pins to use.
To test the display, enter the command:
GUI TEST LCDPANEL
You should immediately see an animated display of colour circles being
rapidly drawn on top of each other
(Fig.6). Pressing the space bar on the
console’s keyboard stops the test.
Configuring touch
Most displays are supplied with a
resistive touch-sensitive panel and its
associated controller chip. To use the
touch feature in MMBasic, the touch
controller must first be connected to
the Micromite Plus and then configured. The connections for the touch
controller are different on each LCD
panel, so refer to the “Micromite Plus
Addendum” for the details.
MMBasic is configured for touch
using the OPTION TOUCH command at
the command prompt (not in a program). This should be done after the
LCD panel has been configured. The
syntax is:
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).
The “click_pin” parameter is optional 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, thereby providing an audible feedback whenever a
GUI element on the screen is activated.
We will cover this subject in detail in
a future article, where we describe the
on-screen graphic (GUI) controls.
As with other options, this command only needs to be run once and
every time the Micromite is restarted,
MMBasic will automatically initialise
the touch controller. If the touch facility is no longer required, the command
OPTION TOUCH DISABLE can be used to
disable the touch feature and return
the I/O pins for general use.
Before the touch facility can be used,
it must be calibrated using the GUI CALIBRATE command. The calibration processes starts with MMBasic displaying
Firmware Updates
For firmware updates and other information relating to the Micromite Plus,
check the author’s website at geoffg.net/
micromite.html
Firmware updates will also be made
available for download from the SILICON CHIP website as soon as we have
been notified.
August 2016 73
Coming soon:
The Explore 100
I
N COMING months, we will describe
the Explore 100, a full Micromite
Plus-based computer with display,
keyboard and SD card storage, with
even more I/O pins thrown into the
bargain. It combines a 100-pin Micromite Plus with a 5-inch touch-sensitive
LCD panel to make a powerful integrated computer or controller with a
multitude of uses.
a target in the top-left corner of the
screen. A blunt pointed object such
as a stylus is then pressed exactly on
the centre of the target and held down
for at least one second. MMBasic will
record this location and then continue
the calibration by sequentially displaying the target in the other three
corners of the screen.
Following calibration, you can test
the touch facility using the GUI TEST
Acknowledgements
My thanks to Graeme Rixon who designed the Explore 64 PCB and helped
with its development. Graeme can supply bare PCBs, parts and the fully assembled and tested Explore 64s – see
the parts list for details.
My thanks also to the many members
of the Back Shed forum who acted as
beta testers during the Micromite Plus’
long development. The forum also has
many members who are happy to help
newcomers to the Micromite series.You
can find it at thebackshed.com/forum/
Microcontrollers
74 Silicon Chip
The Explore 100 PCB mounts directly onto the back of the LCD, making a compact package which can
be mounted in a control panel. With
stunning graphics and plenty of input/
output lines, the Explore 100 is ideal
for controlling anything from a homebuilt lathe to an industrial process.You
TOUCH command which will blank
the screen and wait for a touch. When
the screen is touched with a stylus, a
white dot will appear on the display.
If the calibration was carried out successfully, this dot will be displayed exactly under the location of the stylus.
Pressing the space bar on the console’s keyboard exits the test routine.
Touch functions
It’s easy to use the touch interface
with MMBasic. There are eight functions that provide useful information,
as follows:
TOUCH(X) – returns the X coordinate of
the currently touched location.
TOUCH(Y) – returns the Y coordinate of
the currently touched location.
TOUCH(DOWN) – returns true if the screen
is currently being touched (this is
much faster than TOUCH(X) or TOUCH(Y)).
TOUCH(UP) – returns true if the screen
is currently NOT being touched (also
faster than TOUCH(X) or TOUCH(Y)).
TOUCH(LASTX) – returns the X coor-
could also use it to write games or to
control a telescope, or you might just
want to play with a powerful BASIC
computer.
dinate 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. We will cover this subject in depth in a future article.
TOUCH(LASTREF) – returns the reference number of the control that was
last touched.
You can also set up an interrupt subroutine to be called when the screen is
touched or touch is removed. A touch
interrupt is important when you are
using the GUI controls.
These powerful functions make
employing the Micromite Plus as a
controller a dream and we will cover
them in more detail in a future article.
That’s all for now. In coming months,
we will present the Explore 100, which
can be mounted on the back of a 5-inch
display to make a complete controller
SC
or self-contained computer.
siliconchip.com.au
|