Silicon ChipThe all-new Colour Maximite 2 - July 2020 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: The paperless office... and working from home
  4. Feature: Subtractive Manufacturing by Dr David Maddison
  5. Review: A 100kHz - 500MHz digital RF Power Meter by Jim Rowe
  6. Project: The all-new Colour Maximite 2 by Geoff Graham & Peter Mather
  7. Review: Low-cost pocket DAB+ receiver. Is it any good? by Jim Rowe
  8. Project: Ol' Timer II by Tim Blythman
  9. Serviceman's Log: Well-designed thoughtlessness by Dave Thompson
  10. Feature: Vintage Workbench by Alan Hampel
  11. Project: Infrared Remote Control Assistant by John Clarke
  12. Project: Digital/Touchscreen RCL Substitution Box, Part 2 by Tim Blythman
  13. PartShop
  14. Vintage Radio: Loewe's 1927 OE333: simplicity itself by Ian Batty
  15. Product Showcase
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: H-field Transanalyser, May 2020; Nutube Guitar Overdrive & Distortion Pedal, March 2020; Super-9 FM Radio, November-December 2019; Ultra Low Noise Remote Controlled Stereo Preamp, March-April 2019
  19. Outer Back Cover

This is only a preview of the July 2020 issue of Silicon Chip.

You can view 39 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.

Items relevant to "The all-new Colour Maximite 2":
  • Colour Maximite 2 PCB [07107201] (AUD $10.00)
  • Colour Maximite 2 front & rear panels (PCB, AUD $10.00)
  • Colour Maximite 2 software and documentation (Free)
  • Colour Maximite 2 PCB pattern (PDF download) [07107201] (Free)
  • Colour Maximite 2 front and rear panel cutting diagrams and front panel artwork (PDF download) (Free)
Articles in this series:
  • The all-new Colour Maximite 2 (July 2020)
  • The all-new Colour Maximite 2 (July 2020)
  • The Colour Maximite 2 – part two (August 2020)
  • The Colour Maximite 2 – part two (August 2020)
Items relevant to "Ol' Timer II":
  • Ol' Timer II PCB [19104201] (AUD $5.00)
  • PIC16F1455-I/SL programmed for the Ol' Timer II [1910420A.HEX] (Programmed Microcontroller, AUD $10.00)
  • DS3231 real-time clock IC (SOIC-16) (Component, AUD $7.50)
  • WS2812 8x8 RGB LED matrix (Component, AUD $12.50)
  • Ol' Timer II laser-cut case pieces and spacer (PCB, AUD $7.50)
  • Firmware and source code for the Ol' Timer II word clock (Software, Free)
  • Ol' Timer II PCB pattern (PDF download) [09104201] (Free)
Items relevant to "Vintage Workbench":
  • Tektronix T-130 LC Meter Supplemental Materials (Software, Free)
Articles in this series:
  • Vintage Workbench (June 2020)
  • Vintage Workbench (June 2020)
  • Vintage Workbench (July 2020)
  • Vintage Workbench (July 2020)
  • Vintage Workbench (August 2020)
  • Vintage Workbench (August 2020)
Items relevant to "Infrared Remote Control Assistant":
  • Infrared Remote Control Assistant PCB (Jaycar case version) [15005201] (AUD $5.00)
  • Infrared Remote Control Assistant PCB (Altronics case version) [15005202] (AUD $5.00)
  • PIC16F1459-I/P programmed for the Infrared Remote Control Assistant [1500520A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware and source code for the Infrared Remote Control Assistant [1500520A.HEX] (Software, Free)
  • Infrared Remote Control Assistant PCB patterns (PDF download) [15005201-2] (Free)
  • Infrared Remote Control Assistant panel artwork and drilling templates (PDF download) (Free)
Items relevant to "Digital/Touchscreen RCL Substitution Box, Part 2":
  • Touchscreen RCL Box resistor PCB [04104201] (AUD $7.50)
  • Touchscreen RCL Box capacitor/inductor PCB [04104202] (AUD $7.50)
  • PIC32MX170F256B-50I/SP programmed for the Touchscreen RCL Box (Programmed Microcontroller, AUD $15.00)
  • Micromite LCD BackPack V3 complete kit (Component, AUD $75.00)
  • Firmware (HEX) files and BASIC source code for the Touchscreen RCL Box [RCLBox.hex] (Software, Free)
  • Touchscreen RCL Box PCB patterns (PDF download) [04104201-2] (Free)
Articles in this series:
  • Our new RCL Subsitution Box has touchscreen control (June 2020)
  • Our new RCL Subsitution Box has touchscreen control (June 2020)
  • Digital/Touchscreen RCL Substitution Box, Part 2 (July 2020)
  • Digital/Touchscreen RCL Substitution Box, Part 2 (July 2020)

Purchase a printed copy of this issue for $10.00.

Colour Maximite 2 Words and MMBasic by Geoff Graham Design and firmware by Peter Mather Part 1 The Colour Maximite 2 is a low-cost, easy-to-build computer that is both lots of fun and also seriously useful. It’s a bit of a throwback to the computers of the 80s, like the Commodore 64 and Amiga series. Despite this, it packs a wallop with a 480MHz 32-bit processor, 9MB of RAM and 2MB of flash memory for firmware/program storage. Plus it provides an 800 x 600 pixel colour VGA display! I nspired by the home computers of the early 80s, the Colour Maximite 2 starts up immediately when power is applied, and takes you straight into the BASIC interpreter where you can have your first program running within minutes. It is ideal for learning to program, entertaining children or just messing around discovering what you can do with it. Or it can be used as a powerful control system for just about any device that you may wish to build. If you remember computers like the Tandy TRS-80, Commodore 64 or Apple II, you will be right at home with this little beauty. The difference is that the Colour Maximite 2 is about a hundred times faster, has over 100 times as much memory, with higher resolution graphics – and despite all this, costs a fraction of their price! You may remember the Maximite and Colour Maximite computers that we published in March-May 2011 (siliconchip.com.au/Series/30) and September-October 2012 (siliconchip. com.au/Series/22) respectively. They were huge hits, with many thousands built. The Colour Maximite 2 follows in that vein but with vastly improved technology. 30 Silicon Chip The processor that powers it is an STM32 ARM Cortex-M7 32-bit RISC type running at up to 480MHz. It includes its own video controller and generates a VGA output at resolutions of up to 800x600 pixels with up to 16 bits of colour (65,536 colours). The Colour Maximite 2 is designed to be simple and fun. It includes a BASIC interpreter and powers up in under a second. The emphasis is on ease-of-use and ease-of-construction. The main PCB is a simple double-sided board using through-hole components, and the whole thing can be built in a couple of hours. The complex part, the plug-in CPU module, is pre-assembled and costs just US$30 (about $45 at the time of writing), while the other parts don’t add too much more, so building this project will not break the bank. It is also powerful. The Colour Maximite 2 runs about ten times faster than the original Colour Maximite and has over ten times the program space. Where it really stands out is the quality of the video generated on the VGA output. The graphics are rocksolid, and with up to 65,536 colours, you can create visually stunning programs. It is well suited to creating comAustralia’s electronics magazine puter games, and we are hopeful that programmers of retro games will use these features to amaze us. The BASIC interpreter used in the Colour Maximite 2 is MMBasic, which will be familiar to many of our readers who have built projects based on the Maximite computers or the Micromite series. This computer runs the same interpreter, with extensions to suit its use as a general-purpose computer. MMBasic is a full-featured language that is easy to use and learn, but at the same time, can be used to create powerful and useful programs. Design Fig.1 shows an assembled Colour Maximite 2 and points out its major components. The brains of the Colour Maximite 2 is an ARM Cortex-7 microcontroller from the STM32 range made by Europe-based company STMicroelectronics, formerly known as SGS Thomson. The particular chip we’re using is the STM32H743IIT6. It runs at up to 480MHz and has 2MB of flash memory and 1MB of onboard RAM. This CPU has a 32-bit RISC (Reduced Instruction Set Computer) architecture, which uses a simpler and siliconchip.com.au more consistent set of instruction codes than chips like the x86/x64 series from Intel and AMD. This chip is at the centre of the Colour Maximite 2 and does almost everything needed to make the computer run. That includes running the BASIC interpreter, holding the BASIC program in memory, communicating with the keyboard, driving the display and controlling the external I/O pins. The STM32H743IIT6 includes a video processor, which is quite advanced and allows for multiple video planes which can overlap each other, allowing a background to show through. This is managed by the BASIC program, and is particularly useful for making computer games or other complex 2D graphics schemes. For the mathematically-minded, the CPU includes a hardware doubleprecision floating-point unit. Doubleprecision means that the result of any calculations will be very accurate, to 14 significant digits, and the fact that this is implemented in silicon makes it fast. While the STM32H743IIT6 is a very capable chip, it has one significant disadvantage, which is that it only comes in a large 176-pin surface-mounting package with a tiny 0.2mm gap between its pins. This is challenging to hand-solder and is a barrier to its use by the average home constructor. Fortunately, Chinese company Waveshare has mounted this chip on a plug-in module with supporting components, and this module costs just US$30 fully assembled. By incorporating this module, we managed to design the Colour Maximite 2 with a simple double-sided ‘motherboard’ using through-hole components, which the Waveshare module simply plugs into. Because the STM32 processor contains its own firmware loader/programmer, you do not need any specialised equipment to load the BASIC interpreter into its flash memory and get it up and running. You can do that in a few simple steps using a personal computer running Windows, Linux or macOS. Another advantage of this plug-in concept is that if in the future, you suspect that you have damaged the CPU, you can test or rectify this by simply swapping out the module. As well as hosting the STM32 processor, the Waveshare module includes some extra components including a siliconchip.com.au Features & Specifications CPU : 32-bit ARM Cortex-M7 at up to 480MHz with 2MB of flash. RAM: 1MB on-chip plus 8MB off-chip RAM for BASIC variable storage and video pages. Display type: Colour VGA output with VGA standard timing. Software selectable pixel resolutions: 800 x 600 (default), 640 x 400, 320 x 200, 480 x 432 & 240 x 216. Display modes: 8-bit (256 colours; default), 12-bit (4096 colours plus 16 levels of transparency) or 16-bit (65,536 colours). Graphics: seven built-in fonts, user-designed fonts, lines, circles, squares and control over any pixel with any colour. Gaming: video layers with selectable levels of transparency, multiple video pages with high-speed copying between pages, BLIT (copy a block of video), SPRITE (animated sprites) and support for the Wii Nunchuk. Image loading: files formatted as BMP, GIF, JPG or PNG can be loaded from the SD card and positioned on the screen, then scaled and rotated. Audio: stereo audio output can play WAV, FLAC and MP3 files, computergenerated music (MOD format), synthesised speech, synthesised sound effects and precise sinewave tones. Storage: SD card socket (up to 128GB formatted in FAT16, FAT32 or exFAT) for storing programs and files. Built-in graphical file manager makes it easy to manage files and directories. BASIC interpreter: full-featured with support for ANSI and Microsoft BASIC constructs, and unlimited user-defined subroutines and functions. BASIC data types: three (strings, double-precision floating-point and 64-bit integers) with support for long variable names and arrays with up to five dimensions (limited only by the available RAM). BASIC programs: size up to 516KB (typically 25,000 lines or more) at speeds of greater than 200,000 lines per second. Data RAM is 5470KB (enough for huge arrays). Code editor: built-in full-screen editor with colour coded text, unlimited line lengths and sophisticated search and replace. Compatibility mode: run programs written for the original Colour Maximite. Clock: battery-backed real-time clock and calendar with software trimming. Keyboard support: USB (US / UK keyboard layout) including support for wireless keyboards with a USB dongle (but not keyboard/mouse combos). USB interface: for connecting to a personal computer (Windows, Mac or Linux) as a terminal or for file transfer. Firmware upgrades via USB. I/O: 28 external I/O lines which can be configured as analog inputs, digital inputs/outputs, frequency counters etc. The pin layout is compatible with the Raspberry Pi HATs. Serial I/O: communications protocols including 2 x serial, 2 x I2C, 2 x SPI and Dallas 1-wire. Firmware upgrades: via USB; no special hardware is required. Powered: from USB 5V drawing less than 300mA. Australia’s electronics magazine July 2020  31 voltage regulator, a couple of crystals and an 8MB SDRAM chip. We use this RAM to provide a large amount of memory for the BASIC program (over 5MB), and implement multiple video pages for the video processor. VGA output A standard 15-pin VGA connector on the back panel provides the video output. On startup, this is set to 800x600 pixels and 256 colours. These colours can be selected from a palette of over 65 thousand colours, so almost any practical colour combination can be accommodated. This default mode is perfect for editing and running programs, and MMBasic returns to this setting when a running program ends. BASIC programs can use the MODE USB Keyboard Power & serial console Stereo audio command to select a range of other display resolutions, as listed in the specifications panel. The colour depth can be 8-bits, 12-bits or 16-bits (65,536 colours). As expected, there are trade-offs with the various modes. Generally, the lower resolution modes with lots of colours are useful for graphicallydemanding programs that need to update the screen rapidly. This is because they require less data be manipulated to update the display; this is particularly handy for computer games. But unless you want to write a graphically intensive game, you will probably be happy with the default 800x600 pixel resolution and 256 colours. Unlike the original Colour Maximite, the VGA signal is generated by a Temperature sensor dedicated graphics processor built into the STM32 chip (called the LCD-TFT display controller). This generates precise VGA signal timings and results in a steady image with very clear characters on the screen. The video output is generated from an area of RAM (the graphics memory) that is repeatedly sent to the VGA monitor by the display controller, with each pixel represented by one or two bytes in the graphics memory. When MMBasic draws a graphic image, it just sets these bytes to correspond to the colour of the pixels to be displayed – the hardware handles everything else. This means that the Colour Maximite 2 is always in graphics mode. To display text, the firmware converts each character to its graphic representation by looking up its bitmap and External I/O Connector Reset switch VGA Connector Firmware upload select USB-Serial Converter Infrared Receiver Figure 1 Nunchuk connector Power & SD card activity LED SD card socket Power switch copying this into this graphics memory. This allows for multiple fonts to be implemented and accordingly, the Colour Maximite 2 has seven built-in fonts ranging from small to very large. Custom fonts can also be embedded in the BASIC program, so programmers have many choices for text display. For games programmers, the graphics accelerator can be put into a 12-bit colour mode which supports three video layers. The lowest layer is a solid background colour with the other two layers sitting above this. Images on the upper layers can be specified with various levels of transparency so that (for example) an image on the top layer can be made to move over the lower levels, while allowing some of the lower images to show through the transparent sections of the top image. This is a powerful feature, and you can expect many games to use this mode. If an HDMI output is required, an inexpensive VGA-to-HDMI converter can be used. These cost about US$10 (about $15) on eBay and will also encode the audio from the computer. As an example, the Colour Maximite 2 was successfully tested with this device from Banggood (see below right): siliconchip.com.au/link/ab2e You might be tempted to ask “why not provide HDMI in the first place?” The answer is that the LCD-TFT graphic controller cannot generate it, so we would need to add an expensive and complex chip, which in the end would cost a lot more than a cheap VGA-to-HDMI converter. Plus there is a substantial licensing fee for using the HDMI standard. Fig.2: the I/O socket on the rear panel is compatible with the Raspberry Pi, so you can connect various add-on boards designed for the Pi (called Pi HATs). It includes 28 input/output pins that can be controlled from within the BASIC program plus several 3.3V, 5V and ground pins for powering external circuitry. Also on the back panel is a 40-pin connector which provides 28 digital input/output pins that can be controlled from within the BASIC program, plus several 3.3V, 5.0V and ground pins for powering external circuitry. The pin layout and the positioning of special functions is compatible with the Raspberry Pi, so you can connect various add-on boards designed for the Raspberry Pi (they are called Pi HATs) and use them with this computer. The I/O connector’s pinout is shown in Fig.2, and it includes a mixture of 28 digital I/O pins, 12 analog pins for measuring voltages, two SPI siliconchip.com.au ► I/O capabilities An HDMI output can be provided by inexpensive VGA to HDMI converters like this. They cost about $15 on eBay. Photo from banggood.com The Nunchuk is a controller developed for the Nintendo Wii. The Colour Maximite 2 has full support for it, and many games written for the ► Colour Maximite 2 use it. Source: Wikimedia, Author Tsukihito Australia’s electronics magazine July 2020  33 serial communications channels, two I2C serial channels and two regular serial ports. Other I/O features include five PWM outputs and five I/O pins with the ability to measure frequency, period or general timing (one of these can run up to 40MHz – useful as a general-purpose frequency meter). 16 of the pins are 5V-tolerant, so they can be used to interface with 5V circuits. Sound generation Near the I/O connector on the rear panel is the audio output, a 3.5mm stereo phono socket suitable for feeding into an amplifier or amplified speakers. The STM32 chip includes its own twin DACs (digital-to-analog converters), and these generate stereo audio while not affecting the performance of the CPU. Under the control of the BASIC program, you can play music or sound effects stored in a variety of formats (WAV, FLAC and MP3). The Colour Maximite 2 can also play computergenerated music in the MOD format, which was popular with computers in the 80s and 90s. Other features include the ability to output computer-generated speech (stored in the TTS format) and the ability to generate sound effects composed of a mixture of sine, triangle and noise waveforms. Finally (as if that was not enough), the Colour Maximite 2 can generate audio sine waves with a very accurate frequency, and this can be used for making a simple beep or testing amplifiers, speakers etc. Power, console & keyboard Next to the audio connector on the back panel is a USB Type-B connector for power and access to the serial console over USB. The Colour Maximite 2 is powered from 5V at about 300mA, well within the capabilities of most computer USB ports and USB chargers. However, some older laptops and cheap chargers can cause trouble, so be prepared to try a different power source if you experience random restarts, hangs or video or keyboard problems. This serial-over-USB function allows a personal computer to access the Colour Maximite 2’s console. Everything that could be done with a keyboard/monitor (except graphics) can also be done over this interface. This 34 Silicon Chip Fig.3: this block diagram is of the Waveshare CoreH743I plug-in CPU board, which provides the Colour Maximite 2 with its computing power. It includes an STM32 ARM Cortex-7 microcontroller, a 3.3V regulator, two crystals, an 8MB SDRAM chip and some components supporting the USB interface. means that you can run the Colour Maximite 2 without an attached keyboard and monitor if you wish. The main benefit of this interface is that it is easy to transfer programs and data between the two computers. This allows you to use the bigger computer to edit and manage the program, while testing it on the Colour Maximite 2. But with an attached keyboard and monitor, the Colour Maximite 2 is a capable computer in its own right, so you can use either arrangement as you fancy. Next to the power connector is a Type-A USB connector for a USB keyboard. The original Colour Maximite used a PS/2 connector for this, but PS/2 keyboards are getting hard to find, so being able to use a USB keyboard is a welcome improvement. This feature supports most keyboards, including those with a wireless dongle, so you have plenty of choices. One restriction is that you cannot use a USB hub on this port and as a consequence, keyboards with a built-in mouse will not work. by many Chinese manufactures, so it is widely available and quite cheap (under $10 locally). The Nunchuk is well-equipped with a four-position joystick, two pushbutton switches and an accelerometer. You can query the state of the joystick and the switches from BASIC, and get the current outputs of the accelerometer. Usually, only one Nunchuk is required, but MMBasic supports up to three Nunchuks (the other two connect via the rear I/O connector), so you can have multiple players at the same time. Many games written for the Colour Maximite 2 will use the Nunchuk to control gameplay. Also while not supported out-of-thebox, the Wii Classic Controller uses the same connector and communicates over I2C. So it is possible to make one work with the Maximite, if you wanted a more ‘standard’ controller. Check out WiiBrew for the data format for Classic Controller’s data format: siliconchip. com.au/link/ab2w Nunchuk connector Also on the front panel is a slot for a full-size SD card. The Colour Maximite 2 supports cards up to 128GB, formatted as FAT16, FAT32 or exFAT. These formats are fully compatible with Windows, Linux and Mac com- On the front panel of the Colour Maximite 2 there is a connector for the Nunchuk games controller. This was created by Nintendo for its popular Wii gaming console, and has been cloned Australia’s electronics magazine SD card siliconchip.com.au puters so you can pop the card out and plug it into your personal computer to transfer programs and data. Because BASIC programs are generally quite small, you don’t need a large SD card. 8GB cards are very cheap and commonly available. You can also use a micro SD card in a micro SD-to-SD card adaptor (often supplied with the card). The Colour Maximite 2 relies quite heavily on the SD card. For example, when you edit a program, it resides on the SD card, and you will also run the program from there. This is different from the original Colour Maximite where you did not need an SD card, as programs were edited and run from the computer’s random access memory (RAM). The Colour Maximite 2 does not do this because when a program is loaded, the firmware performs a lot of preprocessing to optimise the program for speed. This includes inserting any include files, stripping out comments and spaces and other speed-orientated changes. As a result, the program stored in the main chip is not easy for a human to read, which is why you only ever edit or list the SD card copy of the program. As well as the much-improved speed, with the Colour Maximite 2, this means that program comments do not use up space in the program memory. So you can be as lavish with them as you wish. The compressed program is stored in flash memory, but that is transparent to the user. However, this means that after the program has started running, you can swap out the SD card with another containing the data required by the program. If the computer restarts (perhaps due to a power failure), the program can automatically restart, regardless of what has happened with the SD card. Waveshare CPU module Fig.3 is the block diagram for the Waveshare CPU module. This is a small four-layer PCB dominated by the STM32H743IIT6 ARM Cortex-7 CPU in a 176-pin flat package. Most of its pins go directly to the 80-pin connectors on either edge of the module. The only other significant components are the 3.3V regulator, two crystals, an 8MB SDRAM chip and some components supporting the USB interface. siliconchip.com.au The top side of the CPU module holds the STM32 ARM Cortex-7 STM32H743IIT6 CPU, which is in a 176-pin SMD package. There is a tiny 0.2mm gap between its pins, which is why we used this Waveshare module rather than asking constructors to solder it. The underside of the Waveshare CPU module holds the 3.3V regulator, two crystals (8MHz and 32.768kHz), 8MB SDRAM chip and some components supporting the USB interface. The SDRAM provides a large amount of RAM for the BASIC program (in addition to the 1MB within the ARM chip) and allows for multiple video pages for the video processor. The 3.3V regulator supplies power to the processor and is also made available on the 80-pin connectors. On the motherboard, this is used by the USBserial converter, the Nunchuk (if connected), the SD card and is also made available on the rear I/O connector, to power external circuits. Current draw should be limited to 100mA to prevent the regulator from entering thermal shutdown. The two crystals on the CPU module are 8MHz and 32768Hz. The 8MHz is Australia’s electronics magazine multiplied over 50 times within the STM32 chip to give it its main clock. This directly drives the ARM Cortex-7 CPU and is divided down to drive onchip peripherals like the USB interface, serial ports, etc. There are two versions of the STM32H743IIT6. The older one called Rev Y runs at 400MHz, while the newer one is Rev V which runs at 480MHz. Other than this, both versions work identically. The version letter is engraved on the IC, but you can also July 2020  35 Fig.4: this is the full circuit of the Colour Maximite 2 ‘motherboard’. It holds the various connectors, the USB-Serial converter and the resistor ladders for the VGA analog output. Most devices such as the Nunchuk, SD card, etc connect directly to the STM32 processor via the two 80-pin connectors. 36 Silicon Chip Australia’s electronics magazine siliconchip.com.au cessor. A battery on the motherboard powers this clock. So it keeps the time and date, even when the power is off. You can easily retrieve this time/ date for use in your program. The firmware also uses this data to timestamp files on the SD card so that you can tell when they were created or modified. Like the CPU, the 8MB RAM chip comes pre-mounted on the Waveshare module. The STM32 CPU maps this RAM into its address space, so MMBasic can use it in a similar way to the 1MB of built-in RAM. MMBasic uses this memory for a variety of jobs, including providing multiple video pages for assembling video images, as a buffer for use when editing a program and as general memory for the BASIC program. The CoreH743I CPU module has two connectors on the top of the PCB. The first is for a 20-pin ribbon connector which is used for an external JTAG programmer/debugger. The second is a USB connector, which is not used in this design, as the USB signals from the STM32 processor are routed to the motherboard and then to the USB keyboard socket on the back panel. Main circuit tell by using the command PRINT MM.INFO(CPUSPEED) which will tell you the speed of the chip. As there may be some old stock in circulation, you could get either version when you order a Waveshare siliconchip.com.au board. Regardless, both versions of this chip are crazy fast so you will not notice this small difference. The 32768Hz crystal (sometimes written as 32.768kHz) is used by the real-time clock built into the STM32 proAustralia’s electronics magazine The motherboard circuit diagram is shown in Fig.4. It essentially holds the various connectors (VGA, I/O etc), the USB-serial converter, the resistor ladders for the VGA analog signals and little else. Most devices such as the Nunchuk, SD card etc connect directly to the STM32 processor via the two 80-pin connectors. The backup battery is a CR1220 coin cell which, as described above, keeps the STM32’s real-time clock running while the power is off. It also keeps a bank of 4KB RAM alive. This battery needs to be in place, as the 4KB RAM is used to store configuration data and options; if the battery is missing, these will be reset to their defaults when power is removed. That’s very annoying, to say the least. The only other component of significance is the USB-to-serial converter. This is a 14-pin DIP chip and can be either the Microchip MCP2221A USB bridge or our own Microbridge (May 2017: siliconchip.com.au/Article/ 10648). Note that instead of the PIC16F1455I/P specified for the Microbridge, July 2020  37 Parts List – Colour Maximite 2 1 double-sided blue PCB coded 07107201, 128mm x 107mm 1 pair of front and rear panels to suit case (optional, SC5500) 1 Waveshare CoreH743I STM32H743IIT6 MCU core board 1 USB 5V power supply or computer with powered USB socket 1 USB Type-A to Type-B cable (for power) 1 USB Type-A to Type-A or micro-B cable (for loading the firmware) 1 USB Type-B right-angle PCB socket (CON1; Amphenol FC1 61729-0010BLF) ♦ 1 USB Type-A right-angle PCB socket (CON2; Amphenol FCI 73725-0110BLF) ♦ 1 3.5mm stereo jack socket (CON3; Switchcraft 35RASMT4BHNTRX) ♦ 1 40-way DIL right-angle box header, 2.54mm pitch (CON4; Hirose HIF3F-40PA-2.54DS{71}) ♦ 1 15-pin right-angle HD D-sub PCB socket (CON5) [RS 481-443, element14 2401183/2857990, Digi-key AE11036-ND, Mouser 523-7HDE15SDH4RHNVGA] 1 SD card socket (CON6; Hirose DM1AA-SF-PEJ{82}) ♦ 2 80-way DIL sockets, 2mm pitch (CON7-8; Samtec MMS-140-01-L-DV) [eBay 292145372983] 1 right-angle vertical PCB-mount SPDT toggle switch (S1) [Altronics S1320, RS 734-7107, element14 9473297, Digi-key EG2364-ND, Mouser 34ASP27T7M2QT] 1 button cell holder for CR1220 (BAT1; Harwin S8411-45R) ♦ 1 CR1220 lithium button cell (BAT1) 1 14-pin DIL IC socket (for IC1) 1 plastic instrument case, 140 x 110 x 35mm [Jaycar HB5970, Altronics H0472, element14 1526699] Semiconductors 1 PIC16F1455-I/P 8-bit microcontroller, DIP-14, programmed as the Microbridge (IC1) OR 1 MCP2221A-I/P USB bridge, DIP-14 (IC1) (RS 171-7828) ♦ 1 3mm dual green/red LED assembly (LEDs1-2; Dialight 553-0112F) ♦ Optional components 1 Dallas DS18B20+ temperature sensor, TO-92 ♦ 1 Vishay TSOP4838 38kHz infrared remote receiver or similar ♦ Capacitors 2 10µF 16V X7R through-hole multi-layer ceramic 1 1µF 50V X7R through-hole multi-layer ceramic 2 100nF 50V X7R through-hole multi-layer ceramic Resistors (all metal film, 0.125W or 0.25W miniature body, 1%) 6 10kW■ 1 4.7kW■ (for optional DS18B20 temperature sensor) 2 1kW■ 19 240W 13 120W 3 75W 1 10W■ 1 2.2W■ ■ can be larger body 0.5/0.6W metal film or 5% carbon type Where to get a kit These suppliers are planning to either offer kits, fully assembled units and/or parts (PCB etc) for the Colour Maximite 2. O Silicon Chip Online Shop: PCB (Cat SC5461); short-form kit (Cat SC5478; does not include the CPU module, case, power supply or optional components); or short-form kit with CPU module (Cat SC5508) O Rictech in New Zealand (www.rictech.nz) O Micromite Org in the UK (https://micromite.org/) O CircuitGizmos in the USA (http://circuitgizmos.com/Color-Maximite-2-p192570471) If you want to source your own parts, you can download the construction kit from the author’s website at http://geoffg.net/maximite.html This includes the Gerber design files for the motherboard PCB so that you can get it made by a PCB fabrication house. ♦ available from RS Components, element14, Digi-Key and Mouser. 38 Silicon Chip Australia’s electronics magazine you can also use a PIC16LF1455-I/P, PIC16F1454-I/P or PIC16LF1454-I/P. Regardless, this allows a personal computer to connect to the Colour Maximite 2 and access its console using the serial over USB protocol. With this, you can use the Colour Maximite 2 without a keyboard and/or VGA monitor, and easily transfer programs and data between it and the computer. The STM32 processor generates the VGA signal as two synchronising signals (vertical and horizontal sync) and sixteen digital output lines which are divided into five outputs for red, six for green and five for blue. These are fed into three resistor arrays which act as digital-to-analog converters to generate the analog red, blue and green signals required by the VGA monitor. By the way, if you are wondering why the green colour has one extra signal line (bit), it is because the human eye is more sensitive to the colour green and can discern more subtle shades in that colour. The type of this resistor array is an R–2R ladder. This is a simple and inexpensive method of performing a digital-to-analog conversion and requires a total of 35 resistors for the number of colours that we generate. Because of this large number, and to save space, they are mounted vertically. They are all through-hole types; however, if you are confident in soldering SMD components, you can use SMD 3216/1206-sized resistors as the pads are sized to take these as well. Sourcing the components The complete list of parts required to build the Colour Maximite 2 is shown adjacent. These can be purchased as a short-form kit from the Silicon Chip Online Shop shop and other suppliers in the UK, USA and New Zealand (see the side box for their details). The Waveshare CoreH743I CPU Board can be purchased directly from Waveshare (www.waveshare.com/ coreh743i.htm) or via eBay or AliExpress. The Waveshare page also provides links to the module’s specifications and the circuit diagram. The two 80-pin sockets used to connect the Waveshare board have a pin spacing of 2mm rather than the more usual 2.54mm (0.1-inch). They can be purchased from the usual suppliers (Mouser, RS Components etc) but siliconchip.com.au tend to be expensive. We found a much cheaper source on eBay, and they were of good quality and worked perfectly (search eBay for “2mm 2x40 Pin Female PCB Header”). You need to be careful with the vertical Type-A USB connector used for the keyboard. There are two variants that look identical but have their PCB pins reversed. To avoid damaging your keyboard or the Waveshare board, you need to make sure that you have purchased the correct type which is manufactured by Amphenol FCI with their part number 73725-0110BLF. Mouser sells this (Cat 649-737250110BLF) as does RS Components (771-0048). To make fitting the resistors easy and avoid them getting in the way of the Waveshare board, it is best if they are 0.25W metal film resistors (these are much smaller than carbon resistors). The tolerance is not critical in this ap- plication, but most metal film resistors are 1% tolerance anyway. Finally, we have specified a vertically-mounted LED module for the power and SD card activity LEDs. Using this module makes it easy to get the correct alignment with the matching holes in the front panel, but you can use discrete 3mm LEDs. If you do this, you will have to bend their leads and jiggle them around to get the correct alignment. Advanced features A very useful built-in feature in the Colour Maximite 2’s firmware is a graphical file manager that lets you use the arrow keys to move around a list of directories and files. These can then be deleted, renamed, run, edited etc all from within the file manager. This makes it easy to manage even a large number of files on the SD card. Within your BASIC program, you have full access to the SD card so you can change directories and create, delete and rename both files and directories. Up to ten files can be simultaneously open for reading, writing and random access. This is similar to the disk access that you have on a personal computer, so you can think of the SD card as the Colour Maximite’s “hard drive”. The motherboard includes a coin battery which is used to keep the clock inside the STM32 processor alive. So the Colour Maximite 2 always knows the correct time and date, which are used to timestamp files on the SD card. The time and date are also available to the BASIC program. The motherboard also has provision (on the front) for an infrared receiver, so that you can use a universal IR remote control to send instructions to your BASIC program. Finally, on the rear panel, there is provision for a DS18B20 temperature sensor so you The assembled Colour Maximite 2, with its lid removed. The motherboard shown here is an early prototype – the final PCB has some small changes. On the rear panel, you can see the VGA connector, the 40-pin I/O connector, audio output socket, the USB Type-B connector for power and serial terminal and finally, the Type-A connector for a USB keyboard. siliconchip.com.au Australia’s electronics magazine July 2020  39 can measure the ambient temperature from within your program. MMBasic interpreter While the hardware is important in making the Colour Maximite 2 what it is, the other important part is the firmware and in particular, the MMBasic interpreter. This is designed to resemble Microsoft BASIC, which was used in many computers of the early 80s. This means that many of the programs of that era can, with a few modifications, run on this computer. When the Colour Maximite 2 powers up, it immediately loads the BASIC interpreter and presents a command prompt. You are straight away ready to enter a program, or run a program from the SD card. This immediacy and ease-of-use is what made the early computers so much fun and so easy to learn, and the Colour Maximite 2 is the same in this respect. The BASIC language was created in 1964 at Dartmouth College in the USA for teaching programming. As a result, it is easy to use and learn. At the same time, it has proved to be useful in creating large and complex programs, and this led to it becoming the language of choice for the early personal computers. These days, personal computers have evolved into something far more potent with their complicated operating systems and even more complex programming languages. However, in that evolution, the ease-of-use and the fun factor of the early computers were lost. This is something that the Colour Maximite 2 brings back. Typically, the first thing people will do with a new computer or programming language is to get it to produce the phrase “Hello World”. This makes sure that the budding programmer understands the steps needed to create a program and coax the computer and software into running it. On the Colour Maximite 2, this just requires the following steps. At the command prompt (ie, after power on), enter: EDIT “hello” This starts the editor and creates the program “hello.bas” on the SD card. It then waits for you to enter some text. Type: PRINT “Hello World” Then press the F2 key to save the 40 Silicon Chip Maximite 2 Graphics Demos As examples of the graphic capability of the Colour Maximite 2 check these short videos: https://youtu.be/h5gtEo5zkGo https://youtu.be/tzUwGCgYMAY https://youtu.be/JMOrlBthwQc https://youtu.be/edt647Dy6F8 program and immediately run it. You should see the words “Hello World” appear on the screen. That’s it. Within a minute, you have created and run your first program! If (somehow) you entered this short program incorrectly, the BASIC interpreter will display a message indicating what the problem was. All you need to do is press the F4 key, taking you back to the editor with the cursor positioned on the line that caused the trouble. You can then correct the fault and press F2 to save and instantly rerun the program. It’s that easy. More on programming A tutorial called “Introduction to Programming with the Colour Maximite 2” is available as a free download (siliconchip.com.au/link/ab30). This will take you through programming in BASIC, controlling the I/O pins and so on. This is recommended reading for anyone starting with the Colour Maximite 2. However, there are some special features of this computer that are worth talking about now. Firstly, there is the legacy mode for users of the original Colour Maximite. This makes it easy to migrate programs, as it changes the drawing commands such as LINE, CIRCLE and PIXEL to use the original Colour Maximite syntax and accept colours in the range of 0 to 7. This is not a perfect emulation, as there are other changes to MMBasic between the old and the new, but it makes it much easier to run old programs – especially ones that use graphics. One new feature is the ability to play audio files through the audio output. These files reside on the SD card and can be encoded as MP3, FLAC or WAV. This means your program can have a musical background or you could play voice announcements (eg, “please close the fridge door”) or play sound effects (explosions, etc). You can also play audio files at the command prompt. If you tell MMBaAustralia’s electronics magazine sic to play a directory containing audio files, the firmware will play each, one after the other, in the background and keep doing that while you are using the computer for other tasks (editing, running a program, etc). So you can have music while you work! Another very handy feature is the ability to load images from the SD card and display them on the VGA output. Images can be encoded as BMP, GIF, JPG or PNG and you can specify exactly where on the screen they should be located. This feature could be used to create a slide show of your favourite holiday snaps, but its main application is to display a detailed background for your program or load a logo, or a diagram to brighten up your program. You can also manipulate these images. You can scale them (make them bigger or smaller), rotate them and move them. Because the Colour Maximite 2 is so fast, you can (for example) move an image sideways one pixel at a time, and the image will slide smoothly across the screen. This would be great in a game, or as a method of illustrating some action in a program. While we are on the subject of image manipulation, you can also define sprites. These are images that your program can move around the screen while leaving the background intact. For example, the background could be a road (loaded as an image) and the sprite could be the image of a car. Your program could move the car over the road while not disturbing the image of the road. A program can have many sprites simultaneously on display, and MMBasic will keep track of their location and tell your program if there is a collision between any of them as you move them about. The sprites are in PNG format; each pixel can be one of 4096 colours and also have a degree of transparency. This latter feature will let the background show through, so you can have transparent sprites if you wish. Next month In the next article, we will describe the construction (it is easy) and provide some pointers for using MMBasic and writing programs. In the meantime, if you would like to know more about the Colour Maximite 2, you can download the User’s Manual from siliconchip.com.au/link/ab2z SC siliconchip.com.au