Silicon ChipOl' Timer II - 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.

O l’ T i m e r I I Once upon a time, clocks were not very accurate. Nowadays, the time shown on your mobile phone or computer is probably accurate to a tiny fraction of a second. If you’re yearning for a more relaxed attitude to time, this project is for you! T he digital clock in your mobile phone or computer is highly accurate and regularly updated, kept within a fraction of a second of an atomic clock standard via the Internet. But it hasn’t always been like that. When I visited my grandparents as a child, I remember the tall grandfather clock they had in one corner of the house. Aside from the minor ceremony of its weekly winding, it was practically hidden away and not easy to see, but frequently heard, as it had the type of chimes that would sound off the quarter hours. On the hour, it would sound off the number of hours; in between, distinct 44 Silicon Chip chimes for each quarter-hour. It was easy to tell what the time was to the nearest fifteen minutes. The Ol’ Timer II recalls this more relaxed attitude to time while evoking a modern and stylish appearance. Inspiration This project was of course inspired by and named for the (old) Ol’ Timer project from November 1994 (siliconchip.com.au/Article/5211). It displayed the time as a combination of words and numbers and used a PIC16C57 microcontroller to control bitmaps on a 40x7 LED matrix. by Tim Blythman Australia’s electronics magazine We now take the PIC microcontrollers for granted but, only a few months prior to the Ol’ Timer, an article in the April 1994 issue gave us our first glimpse into their inner workings (siliconchip.com.au/Article/6279). Back in the day, we didn’t need to know the time to the nearest second, and the manner of speaking the time reflected that. People would say “Quarter to ten” or “five o’clock” instead of “nine-forty-five” or just “five”. The proliferation of digital clocks means that some (many!) younger people can’t even read older analog clocks, let alone understand this way of speaking the time! siliconchip.com.au But the Ol’ Timer II displays the time in written words, expressed in this style. The display is only updated every fifteen minutes; this was partly a conscious design decision, and partly because we’re limited by what fits on the chosen display. So if you prefer a relaxed and oldfashioned attitude to time, this clock is for you. Design Rather than using a graphical or character LCD, we have combined an 8x8 RGB LED matrix with a cleverlydesigned PCB mask, allowing various combinations of letters to be displayed. It’s the sort of thing that could have been rigged up with a matrix of incandescent lamps controlled by clockwork. That is, if we were designing this in the 1920s rather than the 2020s! So this is how words are displayed on the Ol’ Timer II, although the choice of an RGB LED matrix means we aren’t limited to illuminating the letters in an ‘incandescent yellow’ colour. The RGB matrix is based on 64 WS2812B ICs which each contain red, green and blue LEDs plus a serially-controlled driver chip. We reviewed this type of display in January this year, starting on page 85 (siliconchip.com.au/ Article/12228). I/Os at pins 6 and 7 connect to the I2C serial bus interface of IC2, a DS3231 RTC (real-time clock) IC. Although IC1 has a dedicated I2C interface, its pins are shared with the programming header. Since I2C is easy to ‘bit-bang’ with direct port operations, we preferred to do it this way. Thus, IC2 cannot interfere with programming signals and vice versa. We had sufficient free pins on IC1 to allow us to do this; it also simplifies the PCB layout slightly. The two I2C lines are pulled up to the 5V supply by a pair of 4.7kΩ resistors, as required by the I2C specification. IC1’s pins 8, 9 and 10 (analog pins AN6, AN5 and AN4 respectively) are connected to circular touchpads on the PCB. We use the analog to digital converter (ADC) peripheral to sense these pads being touched. A finger on any of the pads alters its capacitance slightly, changing the rate at which it charges or discharges via weak DC currents, Circuit description Refer to Fig.1, the circuit diagram. The Ol’ Timer II is controlled by IC1, a PIC16F1455 8-bit microcontroller. IC1’s RC5 GPIO pin (pin 5) is configured as a digital output, and this drives the serial data input of the LED matrix via a 390Ω resistor and pin header CON3. The other two pins on the three-pin display header supply 5V power to the 8x8 RGB LED matrix module, MOD1. Details on how this serial data is used to control the colour and brightness of the 64 LEDs are in the article mentioned above. Suffice it to say that these three lines are sufficient to power and control all the LEDs with individually settable 24-bit RGB colour values, giving 16,777,216 possible colours for each. IC1’s RC4 and RC3 general-purpose siliconchip.com.au The Ol’ Timer II sports a modern look but recalls an older way of reading the time. It’s powered by 5V from a miniUSB socket, and the display colours are fully customisable. Australia’s electronics magazine Features • Displays the time as words • Uses a DS3231 real-time clock chip for accurate long-term timekeeping • Compact and stylish • LED colours are customisable • USB-powered • Set up via USB or inte gra ted capacitive touch buttons • Adjustable brightness with amb ient light sensing enough to be detected by IC1. These touchpads provide a way to set the unit up even if you don’t have a computer with a USB interface handy. LDR1 has a resistance which changes depending on the light level falling on it. It is connected in series with a 1MΩ resistor across the 5V supply, and a 100nF capacitor smooths the resulting voltage, which is then fed to the AN3 analog input (pin 3) on IC1. When the LDR is illuminated, its resistance is of the order 100kΩ, and the voltage at AN3 is around 4.5V. In the dark, the LDR has a resistance around 10MΩ, so the pin 3 voltage is closer to 0.5V. The 100nF capacitor provides a low impedance source for the AN3 analog pin (pin 3), which reads this voltage and calculates a display brightness level based on the ambient light level and user settings. IC1, IC2 and the LED matrix receive 5V DC power from CON1, a mini-USB socket. IC1 and IC2 each have 100nF local supply bypass capacitors. The USB data lines on CON1 are also connected to the dedicated USB D+/ D- pins (13 and 12) on IC1, allowing the device to be configured via a computer’s USB port. A 10kΩ resistor provides a pullup for IC1’s MCLR pin (pin 4), allowing it to run whenever it is powered. IC2 has support for battery backup power at its pin 14, which is connected to a button cell battery holder. It is July 2020  45 Screen1: the menu system offered over the USB-serial port is easy to use. Press Esc then 1 to set the time, followed by six digits in 24-hour HHMMSS format. Screen2: display colours can be set with menu options 2, 3 and 4, in the standard ‘web’ format of a sixdigit hexadecimal colour code in RRGGBB order. The colour shown here (ØØFFØØ) is pure green. Screen3: pressing Q at any time starts a debugging output display which can be stopped by pressing Esc. The RTC status, digital time and intended LED display are shown and updated every second. intended to be fitted with a CR2032 type battery, so that the time is kept even when 5V power is removed. Finally, IC1’s in-circuit serial programming (ICSP) pins are wired to CON2 so that IC1 can be programmed after it has been soldered to the board. The required connections are 5V, GND, MCLR, ICSPCLK and ICSPDAT (pins 9 and 10). Pins 9 and 10 have 100Ω series resistors to avoid damage to a programmer if it is connected while pins 9 and 10 are being driven. CON4 is not electrically connected to any part of the circuit, but is used to mechanically secure a corresponding set of pads on MOD1, the LED matrix PCB. time-critical work independently in hardware, so as long as the software doesn’t delay too long, it works fine. As briefly described above, the three touchpads are probed using the shared capacitance technique. The detail behind this method is explained in a panel in our ATtiny816 Breakout Board article that we published in January 2019, starting on page 44 (siliconchip. com.au/Article/11372). Essentially, the change in capacitance from finger proximity can be measured by clever use of the ADC (analog to digital converter) peripheral. So we have been able to add three ‘pushbuttons’ without any extra hardware, apart from some PCB tracks. At the back of the PCB, on the reverse of the touchpads is a copper ground pour. This, combined with the shape chosen for the touchpads, maximises the capacitance change that occurs when it is touched. These three pads can be used to set the time and alter the clock configuration, with the SET button cycling between several parameters and the UP and DOWN buttons allowing the parameters to be changed. The USB peripheral on IC1 is also programmed in firmware to behave as Operation The general operation of the circuit is typical for microcontroller-based digital circuits and naturally depends heavily on the firmware we have written. IC1 checks the time by querying IC2 over the I2C bus and then updates the display at CON3 as necessary. As you might have seen from the article about these modules (and the individual LED chips used in them), the control signal is quite time-sensitive. Thus, we have written this part of the code in assembly language to guarantee the timing. This includes turning off microcontroller interrupts while the data is being sent to the matrix. We were initially concerned that this might interfere with USB communications (it takes around 2ms to update all the LEDs), but we have not noticed any problems. IC1’s USB peripheral does all the 46 Silicon Chip In keeping with the modern look of the Ol’ Timer II, we’re producing the PCBs with red, blue and black silkscreens. If someone can produce a wood-veneer silkscreen, then you can produce a truly retro looking clock! Australia’s electronics magazine siliconchip.com.au +5V +5V 100nF  10k D+ 12 13 4 GND 10k 2 +V D– 10k 1 +5V CON1 1 2 3 X 4 100nF LDR1 Jaycar RD3480 8 9 10 D–/RA1 AN3/RA4 IC1 RC5/RX PIC16F PIC 1 6F1 14 4 55 D+/RA0 MCLR/RA3 RC4/TX AN7/RC3 RC2/SDO/AN6 RC1/SDA PWM2/RA5 RC0/SCL/AN4 VUSB3V3 1M 3 100nF 16 15 5 5 6 6 7 7 2 8 +5V 390 9 11 0V 3 100nF 14 2 SCL Vcc SQW/INT SDA NC NC 32kHz RESET NC NC NC 1 3 BAT1 2032 4 IC2 14 DS3231 VBAT NC NC 1 GND NC 2 12 1 11 10 13 CON3 CON2 1 3 4 100 SC 2020 SET DOWN 5 ICSP CON4 WS2812B 8x8 RGB LED MODULE (BEHIND) 2 100 UP CAPACITIVE ‘BUTTONS’ OL’ TIMER II WORD CLOCK Fig.1: like many microcontroller-based projects, the circuit for this one is quite simple. It uses two ICs and a handful of passives; the largest part is 8x8 RGB LED matrix MOD1, which connects to the rest of the circuitry via pin header CON3. a USB-serial bridge. When connected to a serial terminal program, an intuitive configuration menu can be accessed to change the time and other clock settings. Display That we have used a microcontroller to control the LED matrix is straightforward enough, but we think the clever part is how the matrix is used to create a readable output capable of displaying words. Most of the PCB is actually a carefully crafted mask intended to transmit the shape of the letters. Where we want light to shine through, the solder mask and copper layer have been removed, meaning that light from the LED underneath is only diffused by the FR4 fibreglass material in between. The top copper layer forms a solidly opaque mask, and the solder mask gives a uniform appearance (the altersiliconchip.com.au H A L F P A S T Q U A R T E R O T M E I G H I H S I R T E N I E L S E V E N L E X F T T W O E O C L native here would be a bright silver layer of solder). To reduce spillover from adjacent LEDs, an acrylic mask sits around each LED, further limiting the spread of light. Since each LED can be lit up to practically any colour in the RGB spectrum, we can illuminate each letter a different colour to differentiate the words, or set the brightness to account for different viewing conditions. This basic concept is not new, but most of the similar designs we have seen use a much larger matrix. We felt that 8x8 should be enough. Laying out the letters to display the necessary words was the tricky part. We managed to fit everything in with the help of a spreadsheet, although we did have to fit some words in vertically, which is not something we’d seen done before. We had a few LEDs left over which were not needed to form any of the Australia’s electronics magazine O U R N E O L O C K V E AM PM words, so we have allocated them to other useful features. The last two ‘pixels’ at bottom right were free and are well suited to an AM/PM display, so the masks have been designed to show these pairs of letters in a slightly smaller font. With some clever use of the existing LOOKING FOR A PCB? PCBs for most recent (>2010) SILICON CHIP projects are available from the SILICON CHIP PartShop – see the PartShop pages in this issue or log onto siliconchip.com.au/shop You’ll also find some of the hard-to-get components to build your SILICON CHIP project, back issues, software, panels, binders, books, DVDs and much more! July 2020  47 CON4 SET P T I F I V E C A E G O N E L K DOWN S R H U E N V T O T R O L E T O T R O L E S R H U E N V MP MA AM PM UP P T I F I V E C F L A R AU EM I X I S N E T E S L OWT O L C 100nF 100nF + OL’ TIMER II BAT1 FRONT VIEW 4.7k 4.7k IC2 DS3231 CR–3032 SILICON CHIP A E G O N E L K H Q T H R E E O CON3 1M LDR1 CON3 100nF 10k IC1 A L F UA R I ME S I X T E N L S E TWO C L O PIC16F1455 H Q T H R E E O 390 100nF CON1 2x 100 CON2 REAR VIEW (WITHOUT RGB LED MODULE) Fig.2: follow these top and bottom side PCB overlay diagrams during construction. Most of the PCB does not have components installed; it is used as a mask for the LEDs. Since virtually all components are on the back, the letter mask appears backwards in that view. Fit the USB socket, then the ICs, followed by the passives. The battery holder and LED module come last. letter layout, some other words can be displayed, if necessary, although the software does not make use of this. The matrix can also be used as individual pixels, so we can also display some small bit-mapped numbers if necessary. We use this to display information when the colour or brightness is being updated by the touchpad controls. Construction Like many projects, this one depends on surface-mounted components; not so much due to size, but because it allows the front of the PCB to be unmarred by soldered pads. As such, we suggest that you have some solder flux paste, braid (wick), tweezers and a magnifier on hand, along with a soldering iron, preferably one which can have its temperature adjusted. The flux generates a moderate amount of smoke, so use a fume extractor or work outside if possible to avoid breathing in the fumes. A finetipped iron is helpful, but even a chisel tip held with its edge vertically should be OK to do the job. We used a 2.4mm chisel tip to build our prototype. 48 Silicon Chip Refer to the PCB overlay diagrams (Fig.2) during construction. The Clock is built on a 77 x 99mm PCB coded 19104201. Start with the components that mount on the back. Specifically, solder CON1 first because its pins are somewhat difficult to access. We’ve extended its PCB pads to make soldering it slightly easier. Apply some flux paste to the pads for the USB socket, turn your iron up slightly (if it’s adjustable) and line up the socket; the locating pins go into holes on the PCB to aid in its correct alignment. Solder one of the larger mechanical pads on the body, ensur- ing that the electrical pads are flat against the PCB. Load up the tip of the iron with a small amount of fresh solder and place it on each PCB pad in turn, adding some solder to the tip between pins. The flux will induce the solder to run off the iron and onto the pins. Inspect your work with a magnifying glass; it will be much easier to correct this now without other components in place. Use the braid and iron to remove any excess if there is a bridge. There isn’t much room to do this, so take your time. Once you are happy with the socket’s pins, solder To remove the plastic holder from the pin headers (after soldering to the main PCB), carefully place a pair of pliers as shown and squeeze. You should repeat this procedure for CON4 too, before soldering MOD1 in place. Australia’s electronics magazine siliconchip.com.au At left is the populated PCB with the LED Matrix (MOD1) fitted above. Not seen is the acrylic mask that sits between the two. The photo at right shows the gaps in the solder mask which allow the light to shine through. the remaining mechanical tabs. The iron can be turned back to its regular setting after this. Fit the ICs next. IC1 is the smaller, 14-lead part. Apply some flux to the IC’s PCB pads and rest the IC on its pads. Check that the pin 1 dot is adjacent to the dot marked on the PCB. Solder one corner pin in place and check that the remaining pins are flat and within their pads. If not, soften the solder with the iron and adjust until they are. Solder the remaining pins, adding solder to the iron as you go. If you make a solder bridge, leave it for now and ensure that the pins are all soldered before correcting. This will ensure that the IC stays in the correct place. Use the braid and iron (and extra flux if necessary) to remove any excess solder which is bridging between pins. The technique we use is to apply the flux to the top of the bridge, then press the braid against it using the iron. Gently draw the braid away from the pins after the solder melts and is drawn into the braid. IC2, the wider 16-pin part, has a similar treatment. Check its orientation then solder one pin. Once it is in the correct location, solder the remaining pins and remove bridges as necessary. There are four identical 100nF capacitors. They will have no markings and are not polarised. Refer to our photos, the overlay and PCB silkscreen to see where they fit. As with the ICs, apply flux, solder one pin in place, check that it is square, flat and flush against the PCB before soldering the remaining pin. There are a few different resistor values, so check these against the PCB markings, the photos and Fig.2 before fitting them. The LDR is a through-hole part, but The LED matrix module is connected to the main PCB by two pin headers, with a laser-cut acrylic spacer in-between. It can be fiddly to put this all together and even tougher to disassemble if it is wrong, so proceed carefully. siliconchip.com.au Australia’s electronics magazine we have to mount it in an unorthodox fashion to fit in with the other parts. Have a look at the overlay and photos as you read through the explanation. Sit the PCB face-down on a flat surface, bend the LDR’s leads by 90° and place it in the centre of the hole marked LDR1 with the leads aligned vertically. It’s not polarised, so it doesn’t matter which way it is rotated. Mark on the leads where they cross the pads on each side of the hole, then trim one, using the other to position the part. Place the LDR back in the hole and solder the shortened lead in place to the adjacent pad. Flip the PCB over and check that the appearance is acceptable and that the LDR is centred and parallel to the PCB before trimming and soldering the remaining lead. It’s easier to bend and adjust the leads while only one is soldered. The battery holder is a larger part, so you might like to turn the iron temperature up. Apply some flux paste to the pads and sit the battery-holder (BAT1) over the top. Ensure that the opening is at the edge of the PCB to allow the battery to be fitted or removed. As for the other parts, solder one pad, then check the alignment and then solder the other pad. If you need to program IC1 in-circuit, then you can solder a header for CON2 as we have done. But this July 2020  49 Parts list – Ol’ Timer II 1 double-sided PCB coded 19104201, 77 x 99mm 1 8x8 RGB LED module using WS2812B or similar (MOD1) [SILICON CHIP Cat SC5270] 1 set of acrylic case pieces and spacer [SILICON CHIP Cat SC5448] 1 ORP12 or similar LDR (LDR1) [Jaycar RD3480, Altronics Z1617] 1 SMD button cell holder to suit CR2032 (BAT1) 1 CR2032 lithium cell (BAT1) 4 100nF 50V X7R SMD capacitors, 3216/1206 size Code 104 1 SMD mini type-B USB socket (CON1) 1 5-way male pin header (CON2, optional) 2 3-way male pin headers (CON3,CON4) 8 M3 x 6mm machine screws 4 M3 tapped 15mm Nylon spacers Semiconductors 1 PIC16F1455-I/SL 8-bit microcontroller programmed with 1910420A.hex SOIC-14 (IC1) 1 DS3231 real-time clock IC, wide SOIC-16 (IC2) [SILICON CHIP Cat SC5103] Resistors (all 1% SMD, 3216/1206 size) 1 1M Code 105 1 10k Code 103 2 4.7k Code 472 1 390 Code 391 2 100 Code 101 is not strictly necessary as it is possible to simply hold the header in place during programming. There are small vias on the pads which help to keep the header aligned. We should point out that while they are through-hole parts, none of the headers (CON2-CON4) are soldered in the regular manner. Instead, they are vertically surface-mounted onto a set of pads. In each case, first insert it into a header socket to keep the pins together and aligned (and also provide something to hold onto, as the header will get hot!). Put some solder flux on the pads and rest the header approximately where it needs to go. Solder one pin in place 50 Silicon Chip and check the alignment. If it is only slightly off, you might be able to gently flex it before soldering a pin at the other end of the row, but don’t flex it too hard, or it might tear the pads from the PCB. For CON2, once it is in position, solder the remaining pins of the header and then remove the header strip. For CON3 and CON4, you should check that MOD1 is correctly aligned before soldering the remaining pins. So once you’ve tacked CON3 and CON4 in place, check for squareness by trying to fit the LED matrix module over the top. It’s also a good idea to testfit the acrylic mask piece to ensure that everything is aligned before soldering all the header pins. Once they’ve been fitted, slide the acrylic mask piece over the pins, then fit MOD1. This is then soldered to CON3 & CON4. It will be tricky to undo this, so take extra care in ensuring that the two boards are parallel and as close together as possible. We tacked one pin, then firmly squeezed the boards together while remelting the solder, allowing the gap to close. Note that the PCB and module won’t quite be flush because the LED module also has small capacitors on its surface. Programming You don’t need to program IC1 if you purchased it pre-programmed. But if you have a blank micro, you need to program its flash memory with the firmware HEX file to get the Clock to work correctly. Download this from our website before proceeding and extract the HEX file from the ZIP package. You can use a PICkit 3, PICkit 4 or Snap programmer to do this. We used a Snap, but since this does not provide power, you will need to supply power via a USB cable plugged into the USB socket. Note that the Snap cannot perform high-voltage programming, so if IC1 has had its LVP (low-voltage programming) fuse bit set, the Snap can’t clear it. But it will work with a new, blank chip. Plug your programmer into the ICSP header (CON2). Its pin 1 is closest to the USB socket and marked with a small arrow. If you have not soldered the header for CON2, merely plug a male header strip into your programmer and hold it against the pads of CON2. We recommend that you use the free Microchip MPLAB X IPE (integrated Australia’s electronics magazine programming environment) software. Windows, Linux and Mac versions are available from www.microchip.com/ mplab/mplab-x-ide The PIC16F1455 is an 8-bit part, so install support for 8-bit parts if queried. Open the IPE, select “PIC16F1455” as the device and choose your tool from the drop-down below this. Select “power target circuit from tool” if you aren’t providing 5V via the USB cable. But do not do both. Click “Apply”, then “Connect”; the IPE should indicate that it has found a PIC16F1455 device. You can then use the browse button opposite the Hex File option to choose the .HEX file that you downloaded earlier. Click “Program” to write the .HEX file into the chip’s flash memory. If you run into problems, check that the programmer settings are correct and ensure that power is supplied from either the programmer or a USB cable, but not both. Also, check that your programmer is making good contact with CON2. If holding the header to the board, it might work if you try again. Setup If you haven’t already done so, connect the Clock to a computer using a mini-USB cable. The first time it’s powered up (ie, with IC2’s time unset), it should light up showing the words TWELVE OCLOCK AM. The Clock uses the same IC and USB-serial profile as the Microbridge (May 2017; siliconchip.com.au/Article/10648). If you need drivers (which should not be necessary under Windows 10, Mac or Linux), then suitable drivers can be downloaded from www.microchip.com/wwwproducts/ en/MCP2200 You will need a serial terminal program to complete the setup. We used TeraTerm, although most serial terminal programs, including PuTTY (but not the very limited Arduino Serial Monitor) should work. Find the device’s port and open it. You do not need to worry about the baud rate as the Clock uses a virtual serial connection that ignores that setting. Once connected, pressing the Esc key should bring up the menu. If at any time you don’t know what the setup program is doing, press Esc to return to this point and abort any entry. Refer to screengrabs Screen 1-3 during the setup process. The prompts and responses are quite intuitive. siliconchip.com.au The first option, “1”, sets the time. Press Esc, 1 and then the time in HHMMSS 24-hour form, then press Enter. The time is immediately saved to IC2 and the time display is updated. For example, to set the time to 3:30pm, type the digits 153000 when prompted. There are also three colours that can be set, for the hours, minutes and AM/PM. These are entered as sixdigit hexadecimal codes in the form RRGGBB. These sorts of codes are commonly used on webpages, so are easy to find, even if you don’t speak hexadecimal! We’ve listed a few common colours and their codes in Table1; these are taken from the officially named HTML colours. If these are not suitable, the website https://htmlcolorcodes.com/ is quite helpful for generating and listing codes. Thus, to set the colour of the minutes display to red, you would press ESCAPE, 2, FF0000 and press Enter. The colour change takes effect immediately, but does not get saved to nonvolatile memory. This is only done when needed to reduce wear and tear on the flash memory. If you make an error while typing, you can use Delete or Backspace to remove the last character, or press Esc to abort and jump back to the main menu. There are two different brightness settings. One of these corresponds to the brightness under low light conditions and is controlled by using the + and - keys. These can be pressed at any time to alter the brightness, no matter what the menu is doing. The < and > keys control to brightness under higher ambient light conditions, and they operate similarly. We found that in indoor conditions, quite low levels were comfortable, so we set the defaults quite low. The software prevents the level being set so low that the display is invisible. The software does not manage the current drawn by the Clock, nor make requests for power above the 100mA default set by the USB standards. We found that the normal clock display at default brightness levels sat just under 100mA, and rose to near 500mA with the brightness set high during setup (when more than the usual number of segments are lit). With the brightness set this high, the display is almost too bright to look at, so lower levels are quite adequate. Still, this should not be a problem, especially if the Clock is to be powered by a ‘dumb’ USB charger. Even if left connected to a computer, most USB ports will supply 500mA without complaining, enough to keep the Clock running. To set the Clock brightness to work with a full range of lighting conditions, put the clock in a dark room (what it would be typically exposed to, say, at night) and set the ‘low’ brightness to a comfortable level using + and -. Then expose the Clock to daytime illumination and set the ‘high’ brightness with the < and > keys. Check that the Clock now responds correctly under all light conditions and tweak these further if necessary; the ‘low’ and ‘high’ levels will interact to a small degree so you may need to iterate this process a few times. To save the colour and brightness settings, press Esc and then 5 as per the menu prompt. The current settings are saved to flash memory and will now be loaded every time the Clock powers up. Table1 - Common hexadecimal colour codes Aqua Blue Brown Crimson Cyan Gold Grey Green Indigo Lime Maroon Navy 00FFFF 0000FF A52A2A DC143C 00FFFF FFD700 808080 008000 4B0082 00FF00 800000 000080 Orange Pink Purple Red Salmon Sky blue Tan Teal Violet White Yellow FFA500 FFC0CB 800080 FF0000 FA8072 87CEEB D2B48C 008080 EE82EE FFFFFF FFFF00 The colour codes here are drawn from the standard HTML colours used on web pages (we don’t agree with some of the name choices, but they give you some idea). Note that they may look different on the Clock due to the PCB fibreglass colour and surrounding solder mask. The serial interface has one more trick. If the “q” key is pressed, the debugging mode is turned on. It can be turned off by pressing “q” again or pressing Esc. The result is shown in Screen3; the current time, RTC status and intended LED display is scrolled and updated every second. If the unit’s display does not look right, this will give you an indication as to what the problem might be. Or, if the time does not appear to be saved or loaded correctly, you will know whether RTC chip IC2 is functioning correctly. Touchpads If you don’t have access to a computer or USB terminal program, all these parameters can be set using the The case pieces are assembled from back to front; the spacers are fitted to the back panel before the side pieces are slotted in place, with the main PCB being screwed in from above. siliconchip.com.au Australia’s electronics magazine July 2020  51 In setting the hours, minutes and seconds, either an H, M or S is seen along with the value as a decimal number (17 here). The real-time clock is updated after you leave the seconds setting. touchpads. There are fourteen parameters set in turn; these are cycled by pressing the SET touchpad. The current parameter is changed by using the UP and DOWN touchpads. The pads have to be pressed quite firmly; we deliberately avoided making it too sensitive as it would be quite annoying to have the settings change unintentionally. If you have trouble, try slightly moistening your finger. The values are shown in decimal for The two brightness settings HI and LO are also set in hexadecimal, although you should simply adjust the level to be comfortable. A palette at the bottom indicates how some colours will look. 52 Silicon Chip time and hexadecimal for other numeric values (colour and brightness). Apart from the numeric display, some other LEDs are lit to let you know what is being set. The first three parameters (in order) are the time in hours, minutes and seconds, with the letters H, M or S being shown to indicate this. After the seconds are entered, the time is saved. If you make a mistake, the best option is to remove power for a second; there is no other way to avoid saving the time. This is followed by the hours colour (red, followed by green, then blue) components. The minutes colour and then AM/PM colour follow. The component is shown by, for example, a red H or blue O (for other; ie AM/PM). The top-right LED (a T) shows how the mixed red, green and blue components look. This is followed by the low brightness “LO” and the high brightness “HI”. A palette along the bottom line shows how different colours would look at these brightnesses. The photos on this page show these different displays. A fifteenth screen shows a red (floppy disk!) save icon. If the UP or DOWN buttons are pressed when this is showing, the colour and brightness settings are saved to flash. Thus all the parameters can be set, even if you don’t have access to a computer or terminal program. Completing assembly Once you are happy that the clock is working correctly, fit a CR2032 battery to the holder. Check that the time is retained when the power is off. The battery should last close to its shelf life if the Clock is powered most of the time. Fit the threaded spacers to the large back panel, with screws on the matte side. Slot the side and top pieces in place. The spacers are a tight fit, so you may need to rotate them to clear the side pieces. Note that the lefthand and righthand pieces are similar, but slightly different to fit around the USB socket or battery holder. Rest the PCB on top and use the remaining screws to secure it to the spacers and the remainder of the case. The Clock is now able to sit upright on its bottom edge. Final notes Coin cells can be dangerous if they Australia’s electronics magazine There are nine colour pages, one each for the red, green and blue components of the hour, minute, and AM/PM colour. The displayed colour is in hexadecimal and jumps by 15 steps each press. For a simpler way to set the colours, use the USB terminal. are ingested. Thus the Clock should be kept away from small children and babies. We suspect it would be very difficult to remove the battery from the Ol’ Timer II without removing the back of the case, but we recommend not taking any chances with this. If you wish to be even more cautious, you could secure the battery in place with some glue or silicone sealant. SC The settings are not saved by default. You should press the UP or DOWN button when this icon is visible to save the settings to flash memory, meaning they are loaded at power-on. siliconchip.com.au