This is only a preview of the September 2021 issue of Silicon Chip. You can view 43 of the 112 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:
Items relevant to "Touchscreen Digital Preamp with Tone Control – Part 1":
Items relevant to "Second Generation Colour Maximite 2 – Part 2":
Items relevant to "Tapped Horn Subwoofer":
Items relevant to "Micromite to a Smartphone via Bluetooth":
Items relevant to "Sanyo 8-P2 TV (1962)":
Purchase a printed copy of this issue for $10.00. |
Second-Generation
Colour Maximite 2
This new CMM2 computer is compatible with the original described in mid-2020 and
adds several great new features. These include more memory, higher-resolution
video modes, 24-bit ‘true colour’, more controller inputs, better keyboard and
mouse support and some new optional components like a super-accurate realtime clock.
Part 2: assembly & use
D
itching the use of a microcontroller module like in the original
CMM2 means there are more SMDs
onboard, but overall it has simplified
the design. Since many vendors are
now supplying boards with the vast
majority of the SMDs already soldered, the cost has been kept low and
assembly is quick and easy. So we’ll
get stuck into that before we describe
some ways you can use it.
Construction
Fig.4 shows the PCB overlay for the
CMM2 Gen2 board. You can use this
as a guide during construction, but it
is also helpful for debugging, testing
or planning hardware expansion (eg,
developing an add-on board for the
computer).
If you’re building your CMM2 Gen2
from scratch (including soldering all
the SMDs), we’ll assume that you
know what you are doing and just give
some general pointers. Firstly, make
sure that you have IC3 & IC4 orientated
correctly before you solder more than
a few pins. Even experienced constructors can sometimes mount ICs with pin
1 in the wrong location, and fixing it
is a lot of work!
siliconchip.com.au
Words and MMBasic by Geoff Graham
Design and firmware by Peter Mather
After soldering IC3 and IC4, clean
up the board and scrutinise the solder
joints to ensure they’re all good and
there are no bridges. You can mount the
remaining SMDs in pretty much any
order. Do check the orientation of the
remaining ICs and oscillator modules
before and after tacking them down.
Once you have all the ICs, resistors,
capacitors, oscillators and reset switch
in place, give the board another clean,
and you’re at the same point as someone who is starting assembly from one
of the partially pre-assembled kits.
Finishing your computer
Even if you have a partially assembled second-generation Colour Maximite 2, you still need to complete
it by soldering the connectors and
larger components, a few of which are
surface-mounted. This is reasonably
straightforward; only a couple of items
need to be treated with care.
The first is the SD card socket, which
should be soldered first so that you
have easy access with the soldering
iron. This is a surface-mounting connector, and it has two small pins on
its underside which match two holes
in the PCB. These help locate the
Australia’s electronics magazine
connector in the correct position while
you solder the pins.
The best approach in soldering this
socket is to apply plenty of liquid
flux on the pins and carry the solder
to the joint on a fine-tipped, temperature-controlled soldering iron. You
could also use fine-gauge rosin cored
soldering wire and solder the joints
directly, but this has the risk of adding too much solder causing shorts etc.
Note that the socket must be held
firm to the PCB while soldering, as
any gap between it and the PCB will
prevent an inserted SD card from making reliable contact with the connector pins.
To start, solder the two tabs on the
right-hand side of the socket (viewed
from the front) and the five on the lefthand side. Some are close to the socket
shield, so take care not to cause a solder bridge there. You can then solder
the nine pins at the rear. If you get a
solder bridge, don’t worry and carry
on with the other pins.
Finally, examine your soldering
carefully and clean up any solder
bridges using solder wick. Be careful
here as solder wick can suck up all
the solder (although generally, it will
September 2021 61
Fig.4 (above): the overlay diagram for the Colour Maximite 2
Gen2. Shown below is the PCB with all the connectors, the SD
card socket and the battery holder soldered in place. The large
central IC is the ARM Cortex-M7 processor, which does most of the work. Above
the processor is the 32MB RAM used for holding VGA images and providing
extra memory for BASIC programs.
leave enough behind). You should go
back over the pins and resolder any
that look like they don’t have enough
solder.
When you have finished, inspect
each joint with a x10 or x20 magnifier. Also count the pins on the SD
card socket; you should have soldered
a total of 16 pins. We have found that
most construction faults in this area
have been missed pins and blobs of
solder shorting to the shield of the SD
card socket.
The real-time clock cell holder is
also surface mounted, but it is easy,
and it also has two small pins on
the underside which ensure the correct positioning. The locations of
the remaining connectors are clearly
marked by the silkscreen on the PCB,
as well as being shown on Fig.4 and
in the accompanying photograph, so
they should drop in easily.
Usually, the case is supplied by the
vendor but, if not, you can purchase
it as a standard item from Jaycar (Cat
HB5970), Altronics (Cat H0472) or element14 (Cat 1526699). When mounting the PCB in the case, it needs 5mm
spacers to be placed between the PCB
and the four mounting posts. These
raise the PCB and the connectors to
match the cut-outs in the front and
rear panels.
Most vendors will also sell pre-cut
and labelled front and rear panels to
finish off the computer with a professional appearance. You can make the
required cut-outs in the blank panels
supplied with the case, but it is much
easier to use the machine-cut panels.
Getting started
With the Colour Maximite 2 Gen2
built, you then need to load the firmware, which includes the MMBasic
interpreter and the drivers for the hardware components (video, keyboard
etc). You can download the firmware
from the Silicon Chip website or the
author’s website.
There is only one version of this. It
will automatically detect the hardware
that it is running on (ie, the first- or
second-generation designs) and configure itself accordingly.
To load the firmware, you will need
a desktop or laptop PC running Windows, Linux or macOS. There are two
methods of loading the firmware using
either a USB Type-A to Type-A cable
or a Type-A to Type-B cable. Both
methods do not require any additional
62
Silicon Chip
Australia's
Australia’s electronics magazine
siliconchip.com.au
hardware and are fully documented
in the Colour Maximite 2 User’s Manual, which should be in the firmware
download package.
Here is a quick rundown of the
steps involved in programming the
STM32 chip.
01 Install the STM32 Cube programmer software from www.
st.com/en/development-tools/
stm32cubeprog.html
02 Move the jumper on BOOT0 from
RUN to PRG.
03 Plug the CMM2 Gen2 board into
your PC using a USB cable.
04 Launch the STM32 Cube app.
05 Select USB at top right, refresh
and connect.
06 Click the download button at left.
07 Browse to the firmware BIN file.
08 Tick Verify.
09 Start Programming.
10 Wait about five seconds for the
write/verify process to complete.
11 Check that you get the ‘File Download Complete’ OK message.
12 Check that you get the ‘Verify OK’
message.
13 Unplug the CMM2 Gen2 from
your computer
14 Move the BOOT0 jumper back
to RUN.
15 Plug it back into your computer.
With the firmware loaded, you
should see the boot-up screen as
shown in Screen 1. At this point, you
can try typing in a command at the
command prompt. For example, try
this simple calculation:
> PRINT 1/7
0.1428571429
See how much memory you have:
> MEMORY
Flash:
0K ( 0%) Program (0 lines)
516K (100%) Free
RAM:
0K ( 0%) 0 Variables
0K ( 0%) General
24800K (100%) Free
Count to 10:
> FOR a = 1 to 10 :
PRINT a; : NEXT a
1 2 3 4 5 6 7 8 9 10
Bubbles
The next step is to try an actual program, such as the following. This will
cover the screen in animated, overlapping coloured bubbles:
siliconchip.com.au
Oscillator Upgrade for the Colour Maximite 2
As described last month, the clock oscillator design in the first generation
Colour Maximite 2 was adequate for the default 800x600 pixel VGA video resolution. However, with firmware upgrades, it is now possible to generate much
higher resolutions. Still, they generally require the fitting of an external clock
oscillator to eliminate jitter and instability in the video.
If you have an original CMM2 and do not plan on using these high resolutions,
you don’t need to perform this upgrade. Also, note that the second generation
design described here already has this external oscillator fitted by default, so
if you build the new version, nothing extra needs to be done.
To perform the upgrade, you will need an 8MHz crystal oscillator in a 5x7mm
SMD package (QX7 XO ≤ 25ppm) such as the Abracon ASV-8.000MHZ-EJ-T,
and possibly a 100nF SMD ceramic capacitor in a 3.2x1.6mm (M3216 or imperial 1206) package. We sell these two parts through our website: siliconchip.
com.au/Shop/7/5654
The PCB used in the first generation computer has provision for these parts.
The solder pads are located under the Waveshare board near the left-hand
80-pin connector. Installing these parts can be tricky, so if you have not had
any experience with soldering SMD parts, you should practice on something
unimportant and take extra care.
Also note that the solder pads are close to the 80-pin connector, so care
also needs to be taken to avoid damaging this by accidentally touching it with
the soldering iron.
The oscillator has a dot identifying pin 1, and this needs to be aligned with
the dot on the PCB silkscreen (it is tiny). With the oscillator correctly aligned,
you can solder it with flux paste, a fine-tipped soldering iron and the minimum
of solder. Be careful not to overheat the joint, and do not let the solder touch
the case of the oscillator (which will short the connection to ground).
The capacitor should be fitted after the oscillator. It is easier to solder and
is not polarised.
It is not necessary to remove the 8MHz crystal from the Waveshare board.
The signal from the oscillator is strong enough to swamp the crystal, so it will
have no effect. This strong signal might also damage the crystal, but this is
not a problem as it is now surplus to requirements.
DO
CIRCLE RND*799, RND*599,
RND*100, 1, 1, 0,
RND*16777215
PAUSE 4
LOOP
You can see the result of running
this program in Screen 2. What the
photo does not show is that the screen
is quite lively, with bubbles of all sizes
popping into existence, then being
covered by subsequent bubbles. To
enter this program, type the command
below at the command prompt:
EDIT “bubbles.bas”
This will start the built-in editor
where you can enter the above program.
Once you have done this, press F2 (to
save and run it), and you should see
the screen fill with coloured bubbles.
It will carry on forever; to interrupt
it, press CTRL-C on your keyboard
and you will be returned to the command prompt.
Australia’s electronics magazine
If you made an error when entering
the program, MMBasic will stop the
program and display an error message.
You can then press the F4 key and that
will take you back into the editor, with
the cursor positioned on the line that
caused the error. Correct the error and
press F2 to save this new version and
run it again.
How does this program work? The
DO and LOOP commands set up a
loop that will continuously execute
the commands inside the loop until
interrupted. The CIRCLE command
looks complicated, but it simply draws
a circle at a random position with a
random size and random colour.
In MMBasic, the function RND
generates a different random number
from zero to 0.999999 every time it is
used. We multiply this random number by 799 to give a number between
zero and 799. This is the X-axis of the
centre of the circle, and it will fit on
the screen as the default video resolution is 800x600 pixels. Similarly,
September 2021 63
Screen 1:
when you have
soldered the
connectors in
place, loaded
the firmware
and applied
power, this is
what you will
be greeted with.
You can see
that we entered
a few simple
commands to
prove that we
have a working
computer.
multiplying RND by 599 will give us
the Y-axis position.
Next, multiplying RND by 100 gives
a number between zero and 100, which
is the radius in pixels.
The following three parameters
specify the line width (1 pixel), the
aspect ratio (circular) and the colour
of the circle’s border (black). The final
parameter uses the RND function to
generate a random colour from the 16
million-odd colours that the Colour
Maximite 2 can display (16777215 is
224 − 1), and that colour is used to fill
in the circle.
The PAUSE 4 command on the next
line pauses the program for 4ms after
each circle is drawn. This slows down
the creation of bubbles enough for you
to admire the display. If you delete that
line, you can appreciate the computer’s full speed – it is very fast, and the
bubbles merge into a blur.
Entering a program
Screen 2: the result of running the “bubbles.bas” program described in the text.
The screen is animated, with bubbles of all sizes popping into existence, then
being covered by subsequent bubbles.
Screen 3: the
Welcome Tape
is a collection
of introductory
programs
accessible via
an easy-to-use
menu system
designed for
users new to
the Colour
Maximite 2. You
can download
it from https://
github.com/
thwill1000/
cmm2-welcome
64
Silicon Chip
Australia’s electronics magazine
This was briefly mentioned above
in the “Getting started” section, but
it deserves to be explained in more
detail, as it is central to how the CMM2
is used.
A program is a sequence of BASIC
commands extending over many lines,
so except for the most trivial programs,
you won’t be typing commands in one
at a time at the command prompt. You
need a program editor, and the Colour
Maximite 2 has such an editor built in.
The editor includes colour-coded
text (commands in cyan, comments
in yellow etc), advanced search and
replace, a clipboard for cutting and
pasting and many more handy features.
To invoke the editor, you must have
an SD card inserted in the front panel
slot, as the editor will save the edited
file to this card. The command is:
EDIT "filename"
Where filename is the name of your
program (it must be surrounded by
double quotes). So, for example, type
the following at the command prompt:
EDIT "test.bas"
This will start the editor, allowing
you to edit the file “test.bas” on the
SD card.
If you have used a text editor before
(or even a word processor), you will
find that this one operates similarly.
The arrow keys move the cursor
around the text, the delete key deletes
siliconchip.com.au
the character under the cursor and the
backspace key deletes the character
before the cursor.
At the bottom of the screen, the status line displays common functions
such as F6 for save, ^F (hold CTRL
and press the F key) for find and so on.
At this point, you can try entering
the standard program that most programmers typically use to test a new
computer and programming language:
“Hello World”. This might not sound
like much, but in some cases, this
involves installing software, getting
to grips with complicated compiler
requirements, reading lots of manuals etc.
With the Colour Maximite 2, it
is easy. Just start up the editor (as
described above) and enter the line:
PRINT "Hello World"
Then press the F2 function key, and
the editor will save and run your program with the result that the words
“Hello World” should display on your
screen.
If you have made a mistake, an
informative message will be displayed
by MMBasic. You can then press the
F4 function key, and you will be
returned to the editor with the cursor placed on the line that caused the
problem. The error can be corrected
and by pressing F2 again, your modified program will be saved and run
for another test.
This ease-of-use is part of why the
Maximite series of computers, first
published by Silicon Chip ten years
ago (starting in March 2011), has
become so popular.
Colour Maximite 2 Resources
Since the introduction of the Colour
Maximite 2, many people have had
fun creating programs for this great
little computer and others have gathered them into libraries that you can
access. These are some of them:
Colour Maximite 2 Welcome Tape:
The Welcome Tape (Screen 3) is
a downloadable collection of programs written by the user community
that includes games, demonstrations
and utilities. It is designed for firsttime users and is intended as an easy
introduction to the Colour Maximite
2. See https://github.com/thwill1000/
cmm2-welcome
The CMM2 Library:
https://cmm2.fun is a wonderful
collection of games, utilities and fun
stuff written specifically for the Colour
Maximite 2. It is presented as an easyto-browse list with screenshots, so you
can easily select and download something that could cause you to waste a
whole afternoon or evening of playing around.
Even better, if you have written
something useful, you can upload it
to this library.
The Fruit of the Shed:
A huge catalog of information, code
fragments, programming techniques
for the Colour Maximite 2 and other
devices that run MMBasic. For the
Colour Maximite 2 content, go to http://
siliconchip.com.au/link/ab8u
101 BASIC Computer Games:
If you were around in the late 1970s
and playing with the computers of
that era, you may know the book “101
BASIC Computer Games”, edited by
David H. Ahl. This provides simple
games that you could type in yourself
and inspired a whole generation of
budding programmers. Most will run
on the Colour Maximite 2 with minor
modifications.
If you are into nostalgia, the book
and its programs are available from
this website: www.vintage-basic.net/
games.html
The Back Shed:
An online forum, where many users
gather to discuss the Colour Maximite
2 and swap programs they have written. It is also a great place to get help,
as many experienced people regularly
contribute, including the designers of
the Colour Maximite 2. You can find
the forum at: www.thebackshed.com/
forum/Microcontrollers
More information
If you would like to know more
about the Colour Maximite 2, browse
the comprehensive User’s Manual,
which is available in the download
package from the Silicon Chip website
and on the author’s website at http://
geoffg.net/maximite.html
Also available from both sources is
the free PDF “Introduction to Programming with the Colour Maximite 2”,
which guides you through using the
Colour Maximite 2, including a tutorial
SC
on programming in MMBasic.
Enthusiastic users from around the world have written many programs, including games, for the Colour Maximite 2. Two
of them include a modern representation of the Atari game Gauntlet and a version of the classic arcade game Pac-Man.
siliconchip.com.au
Australia’s electronics magazine
September 2021 65
|