Silicon ChipTouchscreen Wide-range RCL Box - July 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: ATtiny816 Breakout and Development Board with Capacitive Touch by Tim Blythman
  11. Project: Infrared Remote Control Assistant by John Clarke
  12. Project: Touchscreen Wide-range RCL Box by Tim Blythman
  13. Feature: Practically Speaking
  14. Feature: PIC n’Mix by Mike Hibbett
  15. Feature: AUDIO OUT by Jake Rothman
  16. Feature: Make it with Micromite by Phil Boyce
  17. Back Issues: Circuit Surgery by Jake Rothman
  18. Feature: Circuit Surgery by Ian Bell
  19. Feature: Max’s Cool Beans by Max the Magnificent
  20. Feature: Max’s Cool Beans cunning coding tips and tricks
  21. PCB Order Form
  22. Advertising Index

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

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

Articles in this series:
  • (November 2020)
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
  • Techno Talk (June 2025)
Touchscreen Wide-range RCL Box Part 2 – by Tim Blythman Last month, we described our new Touchscreen RCL Box, a compact device that lets you quickly and easily select various resistance, capacitance and inductance values for prototyping and testing. Now we’re going to go over the construction, testing and operating procedures. It uses mostly SMD parts, but they’re all easy to work with. I n part one, we described how the RCL box works and listed its features and specifications. We also explained how it’s built using a Micromite V3 LCD BackPack with a touchscreen and two new boards. Now, without further ado, let’s start putting it together. The Micromite itself You will of course have to build a Micromite V3 BackPack with its accompanying 3.5-inch LCD touchscreen module to control the whole shebang. If you haven’t already done so, refer to the article in the August 2020 issue – the PCB is available from the PE PCB Service, code 07106191. There is one variation from the original design to note: we used female headers (ie, header sockets) on the back of the BackPack PCB to connect to the two other boards used in this project. So when building the BackPack, it’s probably a good idea to leave the external I/O and power/serial headers off initially, and fit them later, after you’ve built the other board. There’s also not much point in mounting the LCD yet. Fit the headers and test that the Micromite connects to the LCD, but don’t install the mounting hardware at this stage. Note that any ‘optional’ components fitted to the BackPack may interfere with the RCL Box operation if they share pins; these should be removed if already fitted. Construction We suggest that you carefully follow these instructions and build the boards in the order given, or you may find it a bit tricky. 32 While none of the parts are tiny, you should avail yourself of the usual set of SMT tools, including a fine-pointed, temperature adjustable soldering iron, tweezers, magnifier, solder flux and braid (wick). Some flux removal solution or even isopropyl alcohol will be handy to clean up any excess flux. In general, more flux is better than not enough! The consequence of this is that the PCBs are left with a messy residue unless cleaned. Since both boards have mostly components only on one side, they are well suited to reflow soldering. See our articles on building a Reflow Oven from April and May 2021. The design effectively crams four PCBs into the UB3 Jiffy box, so once finished, space will be tight. Therefore, as you progress through the assembly steps, be careful of components standing higher than needed. In particular, the relays should protrude from the board no more than 7mm; use the parts we have specified (which are around 5mm tall) or check the data sheet of alternative parts before ordering. Naturally, positioning of the parts is critical for correct operation; if any of the resistors, capacitors or inductors are mixed up then the software won’t be able to produce the correct values. Resistor PCB We’ll start by building the resistor PCB which is coded 04104201 and measures 115×58mm. Its PCB overlay diagram (Fig.3) has been repeated from last month to help you during the assembly. First, check that you have the correct PCB; the two main boards look very similar. For all the components, we suggest the following process. Apply a small amount of flux to the pads and hold the component in place with tweezers. Add a small amount of solder to the iron and apply the iron to one lead. For the larger relays, you may be able to hold them in place with a wellplaced finger; their larger body will present less risk of being burnt. Once the component is flat, square and centred, solder the other pin(s). Start with the resistors. Apart from one 10kΩ resistor near the Micromite header, they are all down the centre of the board. We suggest you start at one end and work your way along, ensuring that the value printed on the part matches the silkscreen. We have repeated the relevant section from last month’s parts list for the expected SMD component markings (Table 1). You should be able to confirm their resistances, even after they are soldered, as they are connected to the (absent) relays at one end, ensuring that their measured values are not distorted by being connected to other components. There are two 100nF capacitors; they are interchangeable and non-polarised. Ensure they are fitted accurately, as there is not much space around them once installed. The two ICs have the finest pitch footprints on the PCB (although they aren’t very close by SMD standards). It is vital to ensure that the pin 1 dot lines up with the silkscreen. If you cannot see it, pin 1 is also closest to the 100nF capacitor. Practical Electronics | July | 2021 The RCL Box has three sets of terminals (right side) so you can use the resistance, capacitance and inductance functions independently of each other. It’s all under the control of the Micromite Backpack (V3) which allows you much more flexibility than traditional R, C or L substition boxes. Proceed with the ICs as for the other parts, but do not be concerned if a solder bridge forms, as long as the part is aligned correctly. Finish soldering the remaining pins and once the part is secure, use solder braid to carefully remove any excess from one side at a time. Before you start to add the higherprofile relays, now is a good time to clean up any flux residue according to the instructions on your flux cleaning solution. There are 14 relays to be fitted, all with their pin 1 markers facing the outside of the PCB. You can confirm this from the silkscreen and also the fact that the pin 1 pad is square instead of rounded. Check your progress against our photos. Our relays also have a stripe printed on their tops which should match the stripe printed on the PCB silkscreen. Leave RLY12 and RLY13 until last; they are oriented differently and have more space around them; this gives you better access to RLY10 and RLY11’s pins when fitting those parts. The spacing is quite tight, but the same techniques apply as for the other components. Using a fine-pointed soldering iron, come in almost perpendicular to the PCB so as not to burn and damage adjacent relays. The pins on the relays are at a generous 0.1in (2.54mm) pitch. Do not add the Micromite headers yet. If you are keen, you might like to run some jumper wires from a Micromite to test the resistor PCB in isolation, although you will naturally need the software installed to do this (as described below). Practical Electronics | July | 2021 Capacitor/inductor PCB Well recruits, this is what you have been training for. Not only are there 16 relays on this side of the PCB, but many of the components also don’t have any markings. Take care not to mix them up. But you should find that the process is much the same as for the resistor PCB. Start with the capacitors, checking the component value as you go. If you have a capacitance meter, you can use it to double-check that the correct parts have been fitted. As well as the output capacitors, there are two 100nF parts for bypassing the ICs and a single 10kΩ resistor to fit. As for the resistor PCB, the two ICs have the closest pin spacings. Note that pin 1 on both is closest to the Micromite header. Following on from this, fit all the inductors except the 3.3mH type. It is larger and can be fitted last, even after the relays. With all the low-profile parts fitted, clean up excess flux before moving onto the relays. The low-profile Panasonic TQ2SA5V relays we used are not commonly available, but they are in stock at Digi-Key and Mouser. If you have any doubts, now is the time to test the part values, as fitting the relays will make it more difficult to do so. Proceed with the relays as you did for the resistor board. Patience will definitely help! Do take note of the orientation markings; most of the relays face the same direction, but the two mounted at right angles face towards each other. We suggest fitting RLY24 and RLY30 before the remainder, as they have the smallest clearances to adjacent components. Finally, fit the 3.3mH inductor. It has the largest pads and so may need more heat. It’s best to apply a thin smear of flux paste to its pads before placing it. When finished, clean up any remaining flux residue. Mechanical assembly While the boards we supply are both covered with a solder mask layer, providing a degree of insulation if the boards are laid flat against each other, you should not rely on this. The solder mask appears durable, but is thin and will not resist much vibration or chafing, and it can even come from the factory with a few holes (especially around vias). So cover the back of one of the boards with Kapton (or a similar polyimide) tape, except for around the Micromite headers and the four mounting holes. While CON1, CON2 and CON3 appear to pass through the board, the tape can sit against the back of these; this will help to insulate their pins from the other board. We’ve used 33 TPIC6C595 5V TX RX GND RST 3 4 5 9 10 14 16 17 18 21 22 24 25 26 3V3 5V GND IC2 IC1 TPIC6C595 100nF CONNECTIONS TO MICROMITE COIL COIL COIL COIL COIL COIL RLY12 CON1 RLY10 RLY8 RLY6 RLY4 RLY2 COIL 100nF 10k 10M 2.2k 4.7M 1.5M 1k 330 680k 68 150k 15 RLY14 3.3k 33k 3.3 6.8M 1.5k 3.3M 680 1M 150 330k COIL 33 RLY13 RLY9 RLY11 RLY7 6.8 68k 1.5 15k 6.8k RLY1 RLY3 RLY5 COIL COIL COIL COIL COIL COIL Fig.3: the PCB overlay diagram for the resistor board, reproduced from last month. Be careful to orient the relays correctly, as shown here, and add the parts in the order stated in the text to make your life easier. If you have a magnifier, you can read the value codes on the individual resistors. through-hole pads here to provide more mechanical strength as surfacemounting pads are more easily torn off the PCB. Assuming you have built the Micromite V3 BackPack with LCD as described above, fit the 18-way and 4-way female headers on its back side. Remember that the Micromite BackPack usually has male headers in these positions. Rather than using multiple threaded spacers with machine screws front and back, we used a different technique for the board stack. Resistor Codes (all 1 of each, SMD 1% 3216/1206 size; SMD markings shown) 10MΩ 106 or 1005 6.8MΩ 685 or 6804 4.7MΩ 475 or 4704 3.3MΩ 335 or 3304 1.5MΩ 155 or 1504 1MΩ 105 or 1004 680kΩ 684 or 6803 330kΩ 334 or 3303 150kΩ 154 or 1503 68kΩ 683 or 6802 33kΩ 333 or 3302 15kΩ 153 or 1502 10kΩ 103 or 1002 6.8kΩ 682 or 6801 3.3kΩ 332 or 3301 2.2kΩ 222 or 2201 1.5kΩ 152 or 1501 1kΩ 102 or 1001 680Ω 681 or 680R 330Ω 331 or 330R 150Ω 151 or 150R 68Ω 680 or 68R0 33Ω 330 or 33R0 15Ω 150 or 15R0 6.8Ω 6R8 or 6R80 3.3Ω 3R3 or 3R30 1.5Ω 1R5 or 1R50 Table 1: reproduced from the parts list in the June issue, this shows the codes you can expect to be printed on the SMD resistors. CL TOP Mount the LCD to the front panel/ lid piece using four 32mm-long M3 machine screws, with 1mm nylon washers to separate the acrylic panel from the LCD and the 12mm threaded spacers generally used with the BackPack, to secure the machine screws to the LCD panel. Add the Micromite BackPack to the stack, then place 9mm tapped or untapped spacers onto the exposed threads. Add the resistor PCB with its relays facing the BackPack, then the capacitor/inductor PCB with its relays facing away and then secure the whole lot with four hex nuts. Although we haven’t made the electrical connections yet, you should now have a good idea of the overall size of the PCB stack. Before soldering anything, you might like to test fit the stack into the Jiffy box. This will let you know how much room there is left. If you’ve used the 5mm-tall relays we’ve specified, you should have around 2mm clearance left. We now need to use a pin header to connect the two PCBs to each other and the BackPack headers. To do this, we remove the individual pins from the plastic spacer strip, which you can do using small pliers. With the boards held together in the stack, simply slot the pins CL TOP 10 B ALL DIMENSIONS IN MILLIMETRES 15 A 15 A 13 A 10 9 12 HOLES A: 6.0mm IN DIAMETER HOLE B: 10 x 12mm CUTTING DIAGRAM FOR USB SOCKET END OF BOX 18 A A DRILLING DIAGRAM FOR A BANANA SOCKETS END OF BOX Fig.5: this shows the location and size of the cut-out for the USB cable, plus the hole locations and sizes for the banana sockets on the opposite side of the case. If you have a USB lead with a large housing, you may need to enlarge its hole. A round (drilled) hole is easier to make, but will not look as neat. 34 Practical Electronics | July | 2021 100nF Programmable LCR Reference 3 4 RLY19 470nF RLY21 1 F 220nF 47nF RST 9 5 10 14 16 18 24 GPIO21 25 GPIO22 26 5V 3.3 GND TX RX 17 100nF 10nF 2.2nF 470pF COIL COIL RLY17 91pF COIL 22nF COIL COIL RLY15 12pF 100nF 2.2 F 4.7 F RLY20 1nF COIL 220pF COIL RLY18 COIL COIL COIL 36pF 10 F RLY23 4.7nF 10pF RLY16 COIL RLY24 5V GND CON2 IC3 IC 4 TPIC6C595 TPIC6C595 LC PCB 04104202 C 2020 RevB 10k RLY22 RLY29 COIL L9 1mH RLY27 COIL RLY26 COIL RLY25 COIL COIL RLY30 L8 330 H L7 100 H CON3 L1 100nH L2 330nH RLY28 L4 3.3 H L6 33 H L5 10 H L10 3.3mH L3 1 H Fig.4: the capacitor/inductor board has more relays and some larger components, so it’s a bit packed. But if you follow our instructions, you should not find it too difficult. Again, watch the orientation of the relays. The inductors should have printed values but the capacitors won’t. Here’s a trick we even see some manufacturers perform; stacking multiple capacitors to achieve a higher capacitance value. In this case, we have combined a pair of 4.7µF parts to replace a single 10uF part. It’s not hard to do as long as you don’t apply to much heat. 5V and GND connections. See Fig.6 for how to wire such an arrangement. You will need to solder the wires to the pins on the capacitor/inductor board, as this connects to the header on the BackPack board. Note that such a DC jack must be installed near the lid of the Jiffy box as the PCB extends nearly the full width of the bottom of it. Altronics (P6701) and Jaycar (PP1985) both carry USBto-DC plug leads made up. Or you could use a regulated plugpack with 5V output and the correct tip polarity, to match the socket wiring. through the PCB holes into the female header on the Micromite BackPack, one at a time. Once you have confirmed that everything will fit together, solder the header pins to the PCBs, ensuring that enough solder is applied to wick down the stack into the bottom PCB of the pair. This can be assisted by squirting a little flux paste into each hole before inserting the pin. Alternatively, if you have no plans to remove the PCBs from the BackPack, you could omit the female headers and solder male headers directly to the BackPack. Then, after mounting the resistor and capacitor/inductor PCBs, solder the headers to these two PCBs as well. You may need longer pins to do this, or you may choose to run short lengths of wire between the two boards instead. USB socket For our prototype, we simply made a cut-out in the side of the box to allow power to be supplied to the BackPack using a standard USB cable with a mini Type-B connector. Its location is shown in Fig.5. This hole will allow most USB-mini plugs to pass through the side of the box and directly into the Micromite’s USB socket. It may need to be enlarged if your USB lead has an unusually large plug. An alternative that we have used on some projects is to fit a DC barrel socket; its wires are run back to the Banana sockets You might have noticed that there is not much space in the Jiffy box; thus, we’ve had to use low-profile banana sockets for the six test connections. The locations of their mounting holes, on the opposite side to the USB power cut-out, are shown in Fig.5. Once fitted, the sockets are simply free-wired back to their respective pads on the PCBs. We suggest mounting the sockets in the enclosure first, to test that they do not foul the PCBs. Once this is done, solder short (5cm) leads to each socket, then solder them to the respective pads on the PCBs. CON1 is for the resistance connections, CON2 for capacitance and CON3 for inductance. The LCD shows their values in this order from top to bottom, so the sockets should be wired accordingly. 5V 4 Tx 3 2 Rx 1 USB CONNECTOR TYPE A MALE GND DC PLUG Fig.6: if you want to add a DC socket for power, here is how to do it. But be careful that you mount it in a location where it won’t foul the board stack. The USB-to-DC plug lead is a commonly available, pre-assembled part (eg, Altronics P6701; Jaycar PP1985). Practical Electronics | July | 2021 DC INPUT SOCKET (ON END OF BOX) MICROMITE CON 1 POWER AND CONSOLE CONNECTOR 35 Screen1: the larger 3.5-inch display allows a lot of useful information to be displayed by the Micromite. At right are the three output parameters, displayed adjacent to their respective banana sockets. The values can be changed by a simple tap up or down, via a slider or automatically ramped by the software. You may find it easier to remove the PCBs from the stack while soldering the leads. None of the parts are polarised, so it actually doesn’t matter if you swap the wires to the pairs of sockets. Micromite setup There are two ways to load the software on the Micromite; the easiest is to simply load the RCLBOX.HEX file directly onto the chip using the onboard Microbridge or a PIC programmer such as a PICkit 3 or PICkit 4. The alternative is first to load the Micromite with MMbasic, then configure it and upload the BASIC source code over the serial terminal. This is the required approach if you wish to customise the way the RCL Box works. To do this, assuming you have a new Micromite (we’re using MMBasic version 5.4.8), first open the library. bas file (extracted from the download package for this project, available on the July 2021 page of the PE website) and upload it to the Micromite (eg, using MMedit). Then type ‘LIBRARY SAVE’ at the Micromite console and press enter. Next, type ‘WATCHDOG 1’. After pressing Enter, the Micromite should restart and the screen will clear. The terminal should display: Watchdog timeout Processor restarted ILI9488 driver loaded You can then run the command ‘GUI TEST LCDPANEL’; you should see circles appearing on the LCD. Press Ctrl-C to end the test. Next, run ‘OPTION TOUCH 7,15’ to enable the touch driver. Then run 36 Screen2: pressing the SETUP button opens the Limit Settings page. There, Soft limits can be set to avoid nonuseful or dangerous test values. Further settings can be found by tapping on the RAMP or DISPLAY buttons, while STORE saves the current setting to non-volatile Flash memory. ‘GUI CALIBRATE’ and complete the calibration sequence. If you like, you can run ‘GUI TEST TOUCH’ to confirm that the display and touch panel are working correctly together. Ctrl-C ends this test program too. At this stage, the display is configured and the main BASIC program can be loaded. Open the RCL Reference Box.bas file, send it to the Micromite and run it. The AUTORUN flag is automatically set, so the software will start up when powered in future. The software as loaded now is the same as what you would get from the HEX file; the remaining steps are settings and configuration within the Programmable RCL Box. Finishing touches If you have not already done so, now would be a good time to fit the acrylic lid to the display by removing the four machine screws. Place the 1mm spacers over the holes and then thread the machine screws through the acrylic panel and into the tapped spacers. Note that the acrylic lid piece is not symmetrical; if it appears that the PCBs behind are sticking out the side, you may have it the wrong way around. As a hint, the end of the Micromite BackPack with the USB socket goes to the end with the wider-spaced holes. Slot the stack into the case and secure the lid with the four screws that came with the Jiffy box. Configuration and use When powered up, a splash screen appears, followed by the main operating screen (Screen1). This is where the resistance, capacitance and inductance values are controlled. In a large font along the righthand side are the currently selected resistance, capacitance and inductance values. There are three ways that these values can be changed. First, the slider beneath each value can be used to make quick, coarse changes. You should have no trouble picking the exact value needed, but the up and down buttons to their left are better to make fine changes. To the left of the up and down buttons are the soft limits which can be set. These allow the output values to be restricted if this is desired. Note that the up and down buttons are greyed out when the values are at their soft limits, warning you that you are at the extreme values. At bottom left are the ramp controls, which can be used to step the outputs automatically. They are red when the ramp is inactive, turning green when activated. The ramps make use of the minimum and maximum soft limits as their range. Above this is there is a small numerical display, which indicates a characteristic time or frequency based on a selected combination of the currently enabled resistance, capacitance and inductance. The ‘Setup’ button at top right changes to the first of three pages for altering settings (Screen2). This allows the soft limits to be altered, with up and down controls for the minimum and maximum values of each range. Any changed settings are made active immediately, but are not automatically saved to Flash. This is done by the ‘Store’ button, which ensures that the current settings are saved for use at power-on. This has been done to minimise wear and tear on the internal Flash memory and also provides an Practical Electronics | July | 2021 Screen3: the RAMP setting page controls the automatic ramp modes. These can be set to up, down or sawtooth, with the option to perform a single or repeated ramp. There are individual settings for resistance, capacitance and inductance; thus, you can ramp resistance up and capacitance down simultaneously if that is what is needed. opportunity for settings to be tested before saving. If you change the settings to something you don’t like, then a simple power cycle will reload the last saved values. Pressing the ‘Exit’ button returns to the main control page; note that this and some of the other buttons are present on more than one page to allow ease of navigation. Pressing the ‘Ramp’ button opens a page for the settings that control the ramp modes (Screen3); a setting for ramp rate is found on the ‘Display’ page (Screen4). There are settings to ramp up, down and in a sawtooth pattern (‘Saw’), which alternates between up and down. The ramps can also be set to loop continuously or not (‘Off’). The current setting is displayed in a friendlier fashion above the buttons. If an output is set to ramp up but not loop, it will ramp up to its maximum and then stop. The next time it is started, it will reset to the minimum and ramp up again. This simplifies repeated tests. The Display page includes the ramp step time; this can be set from 0.1s to 10s in 0.1s intervals by dragging the slider along the bottom of the page. The final setting at the top of the Display page is the characteristic time/frequency, which controls what is displayed at the top left of the main page. There is a choice of RC, LR or LC combinations, and the characteristic time constant or frequency can be selected. Of course, these may not match the operation of your circuit as not all circuits operate at their characteristic time constant, but they are a useful thing that the processing power of the Micromite can add. Practical Electronics | July | 2021 Screen4: the DISPLAY page contains the setting for what characteristic time/frequency should be displayed. A choice of either LC, RC or LR combinations can be chosen, with either time constant or frequency being available as further options. The step time for the ramp modes is also chosen by the slider along the bottom of the page. BASIC code In case you wish to delve deeper into the operation of the BASIC program, we’ll explain a little bit about how it works. After a handful of OPTIONs are set near the start, several colour values are defined. If you wish to change the feel of the interface, changing these colours is an easy way to do it. The output values and relay images list the available values in pairs of arrays. One contains a list of the output values as floating-point numbers; these are the RVALUE, CVALUE and LVALUE variables. The RIMAGES, CIMAGES and LIMAGES arrays contain nominal 16-bit values which describe the bit pattern which is output to the relays. In the case of the capacitor and inductor images, these are combined with a simple addition to allow the data to be combined for simultaneous latching. There would be little point changing the image arrays unless you reworked the circuit itself, but you could add extra resistance values by using combinations of more values than what we have. Note that these lines are very close to BASIC’s 255 character limit, so edit them with care. Most of the remaining code is to create the user interface. While we often complain about how bloated software can be at times, it’s nice to have an easy-to-use set of controls; it’s just unfortunate that it takes so much code to do so! The five subroutines starting with RELAYINIT perform the interfacing to the shift registers. If, for example, you were interested in interfacing these boards to another microcontroller such as an Arduino or even a Raspberry Pi, then we suggest looking at these subroutines to understand how to interface and check the schematic to know what pins need to be connected. Reproduced by arrangement with SILICON CHIP magazine 2021. www.siliconchip.com.au This photo shows how the two PCBs are piggybacked inside the case. 37