Practical_Electronics-May_2019

([email protected]) #1

Make it with Micromite


Phil Boyce – hands on with the mighty PIC-powered, BASIC microcontroller


Part 4: Digital inputs and outputs


F


or those of you following this
series, by now you should have your
Micromite Keyring Computer (MKC)
communicating with a PC (using TeraTerm)
via the plug-in Development Module (DM).
If so, then you are nearly ready to begin
exploring MMBASIC and start working
through the topics discussed in the up-
coming articles. However, if you’ve not
yet had success for any reason, and you
need help, then simply drop us an email
and we will get you started.
This month, we will begin by performing
the same kind of LED test discussed in
Part 2 (when checking the MKC) to fi nish
testing the DM. This will ensure that all
the input/output (I/O) pins on the DM are
correctly connected. This is an essential
step and should not be skipped.
We will then configure a couple of
MKC options and change some settings
in TeraTerm to make the development
environment more pleasant to use.
Next, we will touch on the basics of
MMBASIC, just to ensure that we are
all aware of some fundamental concepts
regarding the Micromite and MMBASIC.
After that, the fun will begin; starting
with how to control a simple digital output
(LED), and then how to monitor a digital
input (button). If you’re thinking this
isn’t very exciting, please don’t worry



  • we will quickly expand our activities
    to demonstrate just how easy it is to use
    MMBASIC to add ‘intelligence’ to these
    basic components.
    Ultimately, we will work towards our
    first mini-project, which will use the
    concepts that we’ll be covering here. That
    mini-project, which will appear in next
    month’s article, is an Electronic Dice –
    see Fig.1. Although it is just seven LEDs
    (digital outputs) and one button (digital


The first thing to do is to test your
actual test-circuit! So plug the DM into
the MKC and power it up (ensure the
two power LEDs come on). Connecting
to TeraTerm will help in a little while,
so go ahead and do that too (press the
DM reset button and ensure you see the
Micromite start up message – remember
to set baud speed to 38400, as discussed
in Part 3). Now insert the test probe into
any position on the middle 4-way header,
J8. The four points on J8 are all at 3V3, so
your test LED should turn on. If it does,
then great; however, if the test LED does
not light up then you will need to check
a few things.
Begin by ensuring the MKC and DM are
powered up (check power LEDs). Check
you have the LED in the correct orientation

input), please don’t underestimate it. My


  • ‘surely there’s an app!’ – children have
    explored many board games thanks to
    the fun they have had when using this
    Electronic Dice! And it will teach you
    some very useful Micromite basics.
    We mentioned in Part 1 that the idea
    of this series is to give you exposure to
    MMBASIC and to make you aware of
    what is possible, so don’t be afraid to
    modify the hardware and code that we
    present here, after all, that is the best
    way to learn!
    It is assumed at this point that your
    MKC is successfully communicating with
    TeraTerm. If not, then please perform all
    the tests discussed in Parts 2 & 3 before
    contacting us for help.


Testing the DM
Before you continue with any of the topics
coming up, it is very important that you
successfully perform the LED test on the
input/output headers on the DM. Each of
the 19 input/output pins has two points
to test on the DM, hence 38 points in total
will need checking. These points are all
shown highlighted in Fig.2.
To perform the test, simply grab yourself
an LED and a resistor with a value between
330 Ω and 1kΩ.
Connect them as
shown in Fig.2,
either by soldering
them together, or by
using a breadboard
and some jumper
wires. Ensure that
the LED’s shorter
lead is properly and
securely inserted
into the 4-way 0V
header J7 (any of
the four points is
suitable). The test
probe can be poked
into the socket
point under test.

Fig.1. This Electronic Dice will be our
fi rst mini-project, appearing in next
month’s article.

Fig.2. Summary of the 19 I/O pin numbers and locations on the
Development Module (DM). Also shown is the simple test circuit.

2 3 4 5 6 7 9 101415161718212223242526

J10 (14-way)

J2 (6-way) J3 (6-way)

J7 J8 J9

J12 (20-way)

Reset

0V

0V 5V

0V 3V3 5V

Console3V3

Test
LED
Test
probe

470Ω

262524232221 18171615

Reset 2 3 4 5 6 7 910 14

Questions? Please email Phil at:
[email protected]
Free download pdf