Silicon ChipMake it with Micromite - March 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions: PicoLog Cloud
  5. Back Issues: PICOLOG
  6. Publisher's Letter
  7. Feature: The Fox Report by Barry Fox
  8. Feature: Techno Talk by Mark Nelson
  9. Feature: Net Work by Alan Winstanley
  10. Project: Nutube Guitar Overdrive and Distortion Pedal by John Clarke
  11. Project: Programmable Thermal Regulator by Tim Blythman and Nicholas Vinen
  12. Project: Tunable HF Preamplifier with Gain Control by Charles Kosina
  13. Feature: Circuit Surgery by Ian Bell
  14. Feature: Make it with Micromite by Phil Boyce
  15. Feature: PICn’Mix by Mike Hibbett
  16. Feature: Max’s Cool Beans by Max the Magnificent
  17. Feature: Max’s Cool Beans cunning coding tips and tricks by Max the Magnificent
  18. Feature: AUDIO OUT by Jake Rothman
  19. PCB Order Form
  20. Advertising Index: TEACH-IN by Max the Magnificent

This is only a preview of the March 2021 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Make it with Micromite Phil Boyce – hands on with the mighty PIC-powered, BASIC microcontroller Part 26: Having fun with a Micromite Plus L ast month, we discussed the main differences between the various versions of MMBASIC (Standard, Plus, and eXtreme). We also highlighted some of the different hardware modules that are available for use with these different versions of MMBASIC. Throughout this series, we have used the Standard version of MMBASIC. There are two good reasons for this; first, it is the ideal starting point when learning about MMBASIC; and second, it is the only version of the firmware that loads onto an easy-to-solder DIP IC – ie, the 28-pin PIC that we used in the easy-tobuild Micromite Keyring Computer (MKC). Over this month, and next, we are going to work through a fun (and hopefully useful) project based around the more powerful Micromite Plus. Ultimately, this means that we have more I/O pins available than the MKC, which in turn means we can add hardware modules that have more than just the usual handful of pins. In this project we will be connecting to various hardware modules including a 64x32 RGB LED matrix display panel (see Fig.1), which requires 13 I/O pins. Using Micromite Plus also means we have many new MMBASIC commands at our disposal; so, in this project we will be adding access to an SD card. We will show you how to write data to an SD card (which effectively means we will be creating a data logger), and also show you how to use a bitmap image that is stored on the SD card and display it on the 64x32 RGB panel. In addition to the RGB panel and the SD card, we will also use a couple of items that we have previously used elsewhere in this series: an infrared (IR) receiver and a real-time clock module (RTC). By now, you will be familiar with using these on the MKC, and you will see just how easy it is to migrate them from the MKC for use with a Micromite Plus (it’s the same MMBASIC commands, just different pin numbers). Project overview If you haven’t already guessed from the introduction above (and the photo opposite), we are going to create a smart clock that uses an RGB LED matrix panel as the display (Fig.2). This is the type of panel that you see in electronic signage that is appearing everywhere. However, those signs typically use many tens or hundreds of panels to form the overall display, whereas we will just be using a single panel. Nevertheless, our single-panel display allows the time to be easily viewed from several metres away, making it extremely useful in larger rooms. It also looks fantastic! In addition to the date and time, it also displays the current temperature. The temperature, date and time are all logged at regular intervals onto an SD card. The SD card can then be inserted into a computer and the data viewed in another application, such as a spreadsheet or graph. To add a fun element to this project, we will also incorporate the Mastermind game that we created earlier in the series (Part 15). Incorporating an IR receiver means we are able to use an IR remote transmitter to control everything – so here we will use it to select a function from a simple menu in order to switch between the clock and the Mastermind game; and yes, you will be able to play the Mastermind game by remote control while sitting several meters away in your favourite chair. One other menu option will allow you to display a bitmap file stored on the SD card, albeit the resolution will be limited to the display’s pixel resolution of 64x32. Building blocks This project will require the following main hardware items: • Micromite Plus Explore 64 module • 64x32 RGB LED panel • RTC module • IR receiver • IR transmitter • 5V PSU. In addition, you will require a piece of stripboard to mount everything on, along with some wire-links, and various pin-strips, sockets and a couple of screw terminals. You will also need a micro-SD card to Fig.1. A typical 64x32 RGB LED matrix panel (LR): a) front, b) rear, c) connection to it is via a 2x8 connector (ribbon cable) with the pinout as shown. 46 Practical Electronics | March | 2021 Fig.2. This fun project looks amazing when housed in a photo frame that uses a dark, LED-friendly front panel. store the temperature data and any 64x32 bitmap image files. Optionally, you can add an HC-05 Bluetooth module (as discussed in Part 14), allowing you to remotely access the Micromite Plus and make code changes from the comfort of your armchair! You may have noticed that there is no temperature sensor listed above – so how can it display the temperature? The answer is that the RTC module is based on the DS3231 chip, and this has a built-in temperature sensor, so no separate sensor is required. Access to the temperature value within the RTC is via software, more on that next month – this month, we will just focus on hardware. First, let’s discuss how to source the above items. Micromite Plus Explore 64 module Various versions of the Explore 64 module (also known as the E64) have been released over the last few years. However, they all comprise a 64-pin PIC pre-programmed with MMBASIC Plus, and they all have an onboard microSD socket. The E64 has two rows of downward-facing pins that allow it to be easily plugged into a breadboard, or alternatively plugged into your own custom-board via two rows of sockets (as in this project). All versions of the E64 have the same footprint, and pinout sequence for all of the I/O pins and power pins. Hence, any version can be use in this project. It’s available from micromite. org for just £29.95 plus shipping. For further technical details, including a circuit diagram of the original E64, please visit: https://geoffg.net/Explore64.html 64x32 RGB LED panel The RGB panel is the focus of this project and they’re available from many places. Practical Electronics | March | 2021 However, the cost varies considerably, from about £20, up to just over £100. Do not let this put you off; an online search for ‘RGB LED Matrix Panel 64x32’ will lead you to places where you pay the lower end of this price range. You will see references to the ‘pitch’, which essentially means the distance in mm between the pixel centres. The pitch is often referred to as the ‘P’ number, so an ‘LED matrix 64x32 P4’ means the pixels are 4mm apart. Multiply this by 64 (and add a bit for the edges) and this gives an approximation to the physical length of the panel (ie, a bit longer than 25.6cm). So, the higher the P number, the bigger the panel. Typical P numbers are: 2.5, 3, 4, 5, 6, 8 and 10. The panel shown in the photo (Fig.2) is a P3, which is nice and compact. Two warnings when choosing a panel; first, do ensure it is a 64x32 (and do not go for a smaller or larger one as the display driver won’t work correctly); and second, do check it has a 2x8 interface with pins labelled as in Fig.1. If the pin names are the same, but in a different sequence, then it will be fine to use, but you will need to modify the stripboard wire-links accordingly. It is far easier to just find a matching pinout. In the past I have used one from here (no affiliation): http://bit.ly/pe-mar21-miwm1 RTC module This is the same small DS3231 RTC module as used previously in this series for various other projects. It comes with a pre-soldered 5-way socket. You can search online for ‘RPi GPIO RTC’ to find many places from which to source this module cheaply. One example of a reliable UK seller (and no affiliation) is: http://bit.ly/pe-mar21-miwm2 IR Receiver and Transmitter This project uses the usual TSOP4840 (or TSOP4838) IR receiver that we have used several times in this series. So, you probably already have one; however, if not, they are readily available online. Likewise, with the transmitter, we have used two different types in this series; a smaller one for the Electronic Dice (Part 5), and a 44-button transmitter for the Mood Light (Part 13). Note that literally any IR Transmitter can be used providing it meets either of the two common IR protocols (NEC or Sony). All we need to do is alter the project’s program code slightly in order to decipher the various IR codes from any button presses. This will be covered next month. 5V PSU The RGB panel has a total of 2048 pixels (ie, 64x32). Each pixel comprises three LEDs (R, G, B), meaning that there are 6144 LEDs in total. Taking into account that each LED requires circa 15mA, this equates to an immense amount of power. However, the RGB panel’s internal circuitry multiplexes the LEDs, which essentially means that the potential number of LEDs turned on at any one moment in time is limited to a finite number, much lower than 6144. The result is that multiplexing reduces the maximum power required significantly. Even so, a decent 5V power supply must be used for this project, and you certainly don’t want to drive it from your computer’s USB port (which is typically limited to a maximum of 500mA). We recommend an official Raspberry Pi 4 Power Supply, available online for around £7.50. They can reliably supply 5.1V at up to 3A. They come with a hardwired USB-C connector on the end, but we can simply cut this off to expose the 0V and 5.1V wires which are inserted into a 2-way screw terminal. Alternatively, you can use a redundant tablet charger which should be able to supply 2.1A. Otherwise just use any 5V power supply with a minimum delivery of 2A. SD card The E64 works with any micro-SD card that has a capacity between 8GB and 64GB. There is no need to buy the latest highspecification card, but we do recommend using a branded one. For example, a 16GB SanDisk card should cost around £8. Circuit diagram As with all our circuits in this series, it is just a matter of connecting the relevant pins from the various items to the correct I/O pins on the Micromite; and then supplying power to each item. In this project, we need to connect the MM+ to the RGB panel (13 I/O), the RTC (2 I/O), and the IR receiver (1 I/O). All the pin numbers used in this project are shown in Fig.3. The RGB panel is driven by a display driver that effectively ‘bit-bangs’ the required signals over 13 standard I/O pins. The RTC communicates via I2C and hence is connected to the E64’s I2C Data and Clock pins (pins 43 and 44 respectively); and the IR receiver connects to the E64’s IR input pin (pin 51). All three items, including the E64, require a 5V supply, and this is supplied via the external PSU described above. Connectors are not shown in Fig.3; however, they are discussed below in the construction section. Assembly Apart from the RGB panel and the PSU, everything is assembled onto a piece of stripboard which is 36 tracks wide, with 26 holes in each track. The RGB panel is then attached via a short ribbon cable (supplied with the RGB panel); and the 5V PSU is attached via a 2-way screw-terminal. Fig.4 shows the stripboard layout which includes the wire links, track cuts, and component (or rather connector) placements. To begin with, cut the stripboard to size, and then make the 11 ‘regular’ track cuts 47 Fig.3. (left) This project comprises an E64, RGB panel, RTC module and IR receiver. Micromite Exp lore 6 4 21 49 27 2 1 63 62 60 1 64 2 63 3 62 CLK shown in Fig.4. There are also eight additional track cuts that need extra care as they are made mid-way between rows A R2 R1 P and Q in tracks 1-8 (marked in red in Fig.4). Ensure that 4 61 all 19 track-cuts fully extend the width of the track (either S K 2 5 60 visually, or ideally by using a continuity tester). Next, use 6 59 D 0V 0V 0V a pencil to mark out the end positions of the 25 wire links, 58 MCLR B G2 G1 8 55 recheck the markings, then go ahead and install them. Two 0V 52 24 3 0V 64 0V 61 11 54 2-way screw terminals (SK1 and SK3) may require the 12 53 stripboard holes to be made slightly bigger – if so, use an 13 52 appropriately sized drill bit. 14 51 SK2 is a shrouded socket to which the RGB panel connects 15 50 R TC via an IDC ribbon cable connector. This is 8x2 in size, and 16 49 0V N C C D 5V if you don’t have one available, then you can use two rows 17 48 of 8-way header pins instead. However, you will then need 18 47 to take great care when you attach the RGB panel’s ribbon 21 46 0V 44 43 5V 22 45 cable connector to ensure it is inserted the correct way round. 23 44 JS1 is a 3-way socket, allowing the IR receiver to be plugged 24 43 in (and removed if needed elsewhere). Alternatively, you can 27 42 solder the IR receiver directly into this position, avoiding the I R x receiver 28 TS OP 4 8 (3 8 / 4 0) need for JS1. Do ensure that the IR receiver’s ‘bump’ is facing 29 Data 5V outwards and away from the stripboard. 3.3V 30 JP1 is a 5-pin header, to which the RTC module is attached, 51 5V 5V 31 0V and JS4 is a 6-way socket into which the optional HC-05 0V 32 0V Bluetooth module can be inserted. Apart from JS2 and JS3, 33 now mount all of the screw terminals, header pins and sockets as required. When it comes to the ‘long sockets’ JS2 and JS3, extra attention is required. Essentially, they can be made up of several shorter header sockets that are 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 A A JS1 butted up together to create the 27 positions. However, B B SK1 it is essential that you pull out the contacts from the C C D D JP1 socket’s housing for all unused pins. This is easily E E achieved with a pair of nose pliers or side cutters. To F F G G JS2 clarify, you should be left with contacts only in the H H I I positions marked in Fig.4 (ie, in the top row: G10-14, J J G16, G20-21, G23, G28-29, G34-35; and the bottom K K L L row: P10-12, P15, P26, P29-30). If you do not carry M M out this step, then you will certainly run the risk of N N O O SK2 JS3 permanent damage to the E64. Once all the redundant P Cuts P contacts have been removed, solder in these sockets. Q Q R R As always, do a thorough visual check when you S S have finished assembly. Do not be tempted to insert T T U U any modules yet as they will be added gradually next V V month during the testing process. W W SK3 JS4 OE C B2 B1 LAT X X Y Y 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 Z Y X W V U T S R Q P O N M L K J I H G F E D C B A Z Y X W V U T S R Q P O N M L K J I H G F E D C B A 1 2 48 Next month Z Z 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 After the hardware assembly, next month we will test it bit-by-bit, configuring the Micromite Plus as we go. Then, to finish, we will show you how to make everything come together by installing the appropriate program code. In the meantime, why not take a look at the Micromite Plus User Manual (available for download from the March 2021 page of the PE website). and explore some of the many additional features that your new hardware provides. Until then, have fun! Fig.4. (left) The top and bottom sides of the stripboard showing the position of all the required track cuts, wire links, and connectors. Questions? Please email Phil at: contactus<at>micromite.org Practical Electronics | March | 2021