Silicon ChipOur new DAB+ Tuner with FM and AM – Part 3 - March 2019 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: We all deserve a right to repair
  4. Feature: Medical, Health and First Aid Smartphone Apps – Part 2 by Dr David Maddison
  5. Project: Ultra low noise remote controlled stereo preamp, Pt.1 by John Clarke
  6. Product Showcase
  7. Project: Our new DAB+ Tuner with FM and AM – Part 3 by Duraid Madina & Tim Blythman
  8. Serviceman's Log: My father, the ultimate "serviceman" by Dave Thompson
  9. Project: Touch controlled all-diode checker and plotter by Tim Blythman
  10. Review: First Look at the Arduino MKR Vidor 4000 by Tim Blythman
  11. Project: Versatile Trailing Edge Dimmer – Part 2 by John Clarke
  12. Feature: El Cheapo Modules 23: Galvanic Skin Response by Jim Rowe
  13. Vintage Radio: Astor HNQ Mickey 4.5 valve radio by Fred Lever
  14. PartShop
  15. Market Centre
  16. Advertising Index
  17. Notes & Errata: Tinnitus & Insomnia Killer, November 2018; Stationmaster, March 2017
  18. Outer Back Cover

This is only a preview of the March 2019 issue of Silicon Chip.

You can view 34 of the 104 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Medical, Health and First Aid Smartphone Apps - Part 1 (February 2019)
  • Medical, Health and First Aid Smartphone Apps - Part 1 (February 2019)
  • Medical, Health and First Aid Smartphone Apps – Part 2 (March 2019)
  • Medical, Health and First Aid Smartphone Apps – Part 2 (March 2019)
Items relevant to "Ultra low noise remote controlled stereo preamp, Pt.1":
  • Low-Noise Stereo Preamplifier PCB [01111119] (AUD $25.00)
  • Input Switching Module PCB for the Low Noise Preamplifier [01111112] (AUD $15.00)
  • Input Selection Pushbutton PCB for the Low Noise Preamplifier [01111113] (AUD $5.00)
  • Universal Voltage Regulator PCB [18103111] (AUD $5.00)
  • PIC16F88-I/P programmed for the Low-Noise Stereo Preamp with Six Input Selector [0111111M.HEX] (Programmed Microcontroller, AUD $15.00)
  • PIC16F88-I/P programmed for the Low-Noise Stereo Preamp [0111111B.HEX] (previously 0111111A.HEX) (Programmed Microcontroller, AUD $15.00)
  • Firmware and source code for the Low-Noise Stereo Preamplifier [0111111B.HEX] (previously 0111111A.HEX) (Software, Free)
  • Low-Noise Stereo Preamplifier PCB pattern (PDF download) [01111119] (Free)
  • Low-Noise Stereo Preamplifier Input Switcher PCB pattern (PDF download) [01111112] (Free)
  • Low-Noise Stereo Preamplifier Input Selector Pushbutton PCB pattern (PDF download) [01111113] (Free)
Articles in this series:
  • Ultra low noise remote controlled stereo preamp, Pt.1 (March 2019)
  • Ultra low noise remote controlled stereo preamp, Pt.1 (March 2019)
  • Ultra low noise remote controlled stereo preamp – Part 2 (April 2019)
  • Ultra low noise remote controlled stereo preamp – Part 2 (April 2019)
Items relevant to "Our new DAB+ Tuner with FM and AM – Part 3 ":
  • DAB+/FM/AM Radio main PCB [06112181] (AUD $15.00)
  • Dual Horizontal PCB-mounting RCA sockets (white/red) [RCA-210] (Component, AUD $2.50)
  • PCB-mount right-angle SMA socket (Component, AUD $3.00)
  • 465mm extendable VHF whip antenna with SMA connector (Component, AUD $10.00)
  • 700mm extendable VHF whip antenna with SMA connector (Component, AUD $15.00)
  • PCB-mount right-angle PAL socket (Component, AUD $5.00)
  • Short Form Kit for the Micromite Plus Explore 100 (Component, AUD $75.00)
  • Case pieces for the DAB+/FM/AM Tuner (PCB, AUD $20.00)
  • Firmware (BAS and HEX) files for the DAB+/FM/AM Radio project (Software, Free)
  • DAB+/FM/AM Radio main PCB pattern (PDF download) [06112181 RevC] (Free)
Articles in this series:
  • DAB+ Tuner with FM & AM and a touchscreen interface! (January 2019)
  • DAB+ Tuner with FM & AM and a touchscreen interface! (January 2019)
  • Build-it-yourself DAB+/FM/AM radio (February 2019)
  • Build-it-yourself DAB+/FM/AM radio (February 2019)
  • Our new DAB+ Tuner with FM and AM – Part 3 (March 2019)
  • Our new DAB+ Tuner with FM and AM – Part 3 (March 2019)
Items relevant to "Touch controlled all-diode checker and plotter":
  • Diode Curve Plotter PCB [04112181] (AUD $5.00)
  • 2.8-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $25.00)
  • STFU13N65M2 650V logic-level Mosfet (Component, AUD $10.00)
  • Matte Black UB3 Lid for the Multi Diode Curve Plotter (PCB, AUD $5.00)
  • Firmware (.ino sketches) for the Multi Diode Curve Plotter (Software, Free)
  • Multi Diode Curve Plotter PCB pattern (PDF download) [04112181] (Free)
  • Multi Diode Curve Plotter box cutting diagram (PDF download) (Panel Artwork, Free)
Items relevant to "Versatile Trailing Edge Dimmer – Part 2 ":
  • Touch and IR Remote Control Trailing Edge Dimmer Main PCB [10111191] (AUD $10.00)
  • Touch and IR Remote Control Trailing Edge Dimmer Mounting PCB [10111192] (AUD $10.00)
  • Touch and IR Remote Control Trailing Edge Dimmer Extension PCB [10111193] (AUD $10.00)
  • PIC12F617-I/P programmed for the Touch and IR Remote Control Trailing Edge Dimmer [1011119B.HEX] (Programmed Microcontroller, AUD $10.00)
  • Hard-to-get parts for the Touch and IR Remote Control Trailing Edge Dimmer (Component, AUD $20.00)
  • Infrared receiver parts for the Touch and IR Remote Control Trailing Edge Dimmer (Component, AUD $12.50)
  • Firmware (ASM and HEX) files for the Touch and IR Remote Control Trailing Edge Dimmer [1011119A.HEX] (Software, Free)
  • Touch and IR Remote Control Trailing Edge Dimmer PCB patterns (PDF download) [10111191-3] (Free)
  • Warning label for the Touch and IR Remote Control Trailing Edge Dimmer (PDF download) (Panel Artwork, Free)
Articles in this series:
  • Versatile Trailing Edge Dimmer with Touch Plate & IR (February 2019)
  • Versatile Trailing Edge Dimmer with Touch Plate & IR (February 2019)
  • Versatile Trailing Edge Dimmer – Part 2 (March 2019)
  • Versatile Trailing Edge Dimmer – Part 2 (March 2019)
Items relevant to "El Cheapo Modules 23: Galvanic Skin Response":
  • Sample code for El Cheapo Modules 23 - Galvanic Skin Response (GSR) (Software, Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Low-cost electronic modules: 8×16 LED Matrix module (July 2025)
  • Low-cost electronic modules: 8×16 LED Matrix module (July 2025)

Purchase a printed copy of this issue for $10.00.

BUILD-IT-YOURSELF WITH FM, AM and a Touchscreen Interface using an Explore100 The DAB+/FM/AM Radio is complete. In our last exciting episode, we had left the heroine tied to the railroad tracks (woops, sorry, wrong episode) we had just finished assembling the radio PCB, leaving us with quite the cliffhanger! Part 3: By Duraid Madina and Tim Blythman I f you’re building our fantastic new DAB+/FM/AM radio, after following the instructions in the article last month, you will have a completed Explore 100 module and digital radio board. We now need to put those together and into a case, and load all the required software to get it up and running. While you’re reading this article, be sure to check out the updated screen grabs, as the software is now complete and it looks much better than the ‘work in progress’ interface shown in the last couple of articles. Final assembly The following instructions assume that you are building the radio into our custom-designed laser-cut acrylic case. If you are not, the general assembly of the ‘stack’ will be much the same, but you will be omitting the acrylic parts. The case arrangement is shown in Fig.3. You might think that it would be a good idea to test the whole stack before completely assembling it, but we 42 Silicon Chip found that it needs to be held rigidly together to ensure that all the connections between the boards are good. So we suggest that you put it all together before testing and programming it. It isn’t difficult to get apart if you run into problems later. Start with the front acrylic piece, with the large cutout for the LCD screen. Put an M3 x 32mm machine screw through each corner hole and secure them to the panel with M3 Nylon nuts. The panel is not symmetrical; the small cutout for the touch panel cable is the most obvious indicator. So check that the screws are the correct way around relative to the LCD panel before securing them with the nuts. Feed the 5-inch touchscreen assembly over the machine screw shafts so that its front sits nearly flush with the front of the acrylic front panel. Attach it to the front panel by threading 12mm tapped spacers over the machine screws. Now feed the assembled Micromite Plus Explore 100 module over the over the machine screw shafts, ensuring that the header on the touchAustralia’s electronics magazine screen board seats into the header on the Micromite board. The Explore 100 module is then secured by four 9mm tapped spacers over the screw shafts. Next, fit the 15mm tapped spacers over the remaining stubs of the machine screws. You may have noticed that you have a spare 20x2 female header socket with long pins (it was in parts list). This is used to bridge the gap between the Micromite board and the radio PCB. We’ve seen a few versions of these with different lengths, so you may find you need to trim the pins, or you might even be able to replace CON3 entirely and solder the header with long pins directly to the radio PCB. However, we do not recommend that you try to de-solder CON3 if you have already fitted it to the board, since you’re likely to damage the board in the process. In that case, you’re better off using the intermediate header, as we did. The radio PCB sits flush against the M3 x 15mm tapped spacers (24mm from the Micromite board), so you can judge at this stage how the headers between the Micromite board and siliconchip.com.au the radio PCB will fit. In any case, ensure that the connection between the Micromite board and the radio PCB is solid. To finish the case assembly, rest the partly assembled stack with the screen facing down (it’s a good idea to set it on a sheet of blank paper or a clean cloth to protect it). Slot the longer, narrow acrylic pieces in place. The one with the single squarish hole goes over the IR receiver. Slot it into the front panel, then tilt it over the IR receiver; you may need to gently bend the IR receiver to suit the hole. The other long, narrow acrylic piece goes along the opposite edge of the front panel, with the cutouts matching the small three-pin header for the serial port (to program the Explore 100) and the microSD card socket (to load the Si4689 firmware). With these two panels in place, the two side panels can now be fitted. The side panel with four round holes is for the side with the RCA sockets. Slot the tabs in the front panel, then tilt into place over the side tabs. The RCA sockets protrude, so it will be difficult to get this on the wrong way. The remaining small panel fits on the other side. Similarly, the antenna socket protrudes, so slot the panel into the front and tilt up to engage the tabs in the adjacent panels. At this stage, you’ll have a large piece of acrylic, four 25mm-long machine screws and four 15mm-long tapped spacers left. You’ll also note that the large piece of acrylic has a long slot on one side and two short slots along the opposite edge; these align with the tabs on the back of the side panels. While appearing symmetrical, the back panel is not. The long slot goes on the side near the RCA connectors (and is needed due to their location in that side panel). Thread the 25mm machine screws through the mounting holes in this rear panel and fit the 15mm tapped spacers to their threads. Tighten the spacers until they are almost, but not quite tight; we need the machine screws to be able to rotate to complete the last step. Finally, line up the back panel by placing its machine screws into the holes in the corner of the radio PCB, and tighten them up, ensuring that the tabs are correctly captured in the slots. siliconchip.com.au 15mm Radio 40-pin Long pin 40-pin tapped spacer PCB socket socket header LCD PCB Case top panel Case front panel M3 Nylon nut M3 x 32mm screw M3 x 25mm screw VHF antenna socket 15mm tapped spacer 9mm tapped spacer 12mm tapped spacer Touchscreen LCD panel Case side panels mini USB socket AM loop antenna socket Access hole Speaker terminals Case rear panel 12mm M3 tapped spacer 16mm tapped spacer M3 x 32mm screw M3 x 25mm screw M3 Nylon nut SC Explore 100 PCB 20 1 9 Case bottom panel Access hole Serial header Fig.3: this shows how the three PCBs (LCD, Explore 100 & Radio) are joined using tapped spacers and pin headers. The top, bottom and sides of the case are sandwiched in between the front and rear panels, which are held rigidly together by the whole stack. At this stage, the external telescopic antenna and AM loop antenna can be attached, and a set of headphones or other means of testing the audio plugged in. Loading the software The first step for installing the radio software and firmware is to load MMBasic onto your PIC32 chip (if it isn’t pre-loaded) and then load the radio’s BASIC source code into it. The software for this project is available for download from the SILICON CHIP website. The ZIP package includes the BASIC source code, two HEX files and the Si4689 firmware file. Most constructors will already have the Micromite firmware installed on the PIC32 in the Micromite Plus Explore 100 module, as they will be building it from a kit with a pre-programmed chip. If instead you have a blank PIC32 and need to load MMBasic yourself, you will need a PICkit 3, PICkit 4 or Microbridge (described in May 2017; siliconchip.com.au/Article/10648). The August 2016 article on the MiAustralia’s electronics magazine cromite Plus has some information on programming the PIC32 chip with a PICkit, on page 68; see siliconchip. com.au/Article/10040 After that, you will need to configure the LCD screen, touch panel and SD card to work as noted in this article. The steps to do this are listed below. But first, we’ll explain how to program a blank PIC32. You can upload the firmware HEX file to the microcontroller using the in-circuit serial programming (ICSP) header on the Explore 100 board. This can be done with a PICkit or Microbridge. You can either load a plain Micromite HEX file, in which case you will also need to load the BASIC code later, or use a HEX file specifically for the radio project which contains MMBasic and the radio code. If using a PICkit, plug it into the ICSP header with pin 1 (arrowed) lined up on both plug and socket, then launch the Microchip MPLAB IPE software (included with the free MPLAB X IDE download). Connect to the PICkit and select March 2019  43 Changes to the final circuit and PCB While testing the radio, we found that we needed to make some minor “tweaks” to the circuit and the PCB design, which were presented in the January and February issues. You may remember from the first article that the AT25SF321 32Mbit serial flash chip is wired both to the flash SPI interface on IC1, the Si4689 radio IC, and also to pins 5, 8, 10, 12, 14, 16 & 20 on CON3, the Micromite Explore 100 interface header. As we explained then, while the Si4689 can read its firmware straight off the flash chip via its direct interface, we need the Explore 100 to communicate with the flash chip directly, to initially write the firmware into it. And we may also need to write a new firmware later, if an update becomes available. We planned to set the connected Explore 100 pins as highimpedance inputs after programming the flash chip, allowing the Si4689 complete control over the flash. But unfortunately, due to the high frequencies that it uses to communicate with the flash chip (to load the firmware quickly), even with the Explore 100 pins in a high-impedance state, these extra connections still caused problems. We found that the Si4689 would sometimes fail to boot or worse, boot a corrupted copy of the firmware and then crash when specific radio functions were activated. We tracked this down to the parasitic inductance/capacitance of the long tracks on the Explore 100 board connecting these pins (the intervening connectors don’t help, either). the correct chip type (PIC32MX470F512L). Load the HEX file, then power up the Explore 100 board and press the program button. Check the bottom of the window. It should tell you that the chip has been programmed and correctly verified. If you got an error, check that the programmer is wired up correctly and that you don’t have any soldering or component errors on your Explore 100 board. The process with the Microbridge is similar except that you use differ- ent software. See the May 2017 article for instructions on how to program a PIC32 with a HEX file using pic32prog. Setting up the touchscreen Your chip should now be programmed with MMBasic. If you used the HEX file with the radio code included, the touchscreen will be configured, but you may still want to calibrate the touchscreen to ensure its touch sensing is accurate. If you have programmed it with plain MMBasic, you will also need to Screen1: at power up, the radio displays a simple splashscreen. After initialising the digital audio transceiver chip, the radio feeds the bootloader code into the Si4689 radio IC, as shown here, and it switches to the main screen once this chip is ready for reception. 44 Silicon Chip The resonance and antenna-like properties of these tracks caused overshoot and ringing on the flash SPI lines when they were being driven by the Si4689, interfering with its ability to read the firmware data off the flash chip. Our solution was to insert four resistors in series with the FLSO, FLSI, FLCK and FLCS lines of the flash SPI bus, between IC3 and CON3. We placed these close to IC3, keeping the tracks between IC1 and IC3 short. This solved the booting problem. We determined that the ideal values are 2.2kΩ for the data lines (SO and SI) and 100Ω for the clock (CK) and chip select (CS) lines. These have been added to the final version of the PCB, close to IC3 and inside the radio box at upper-right. They will be presoldered to those boards which have been ordered with IC1 and associated parts already fitted. We have decided to supply the flash chips pre-programmed with the firmware, on those boards which are supplied with the chip fitted. In theory, those resistors could be removed once the flash chip is programmed, leaving flash chip IC3 only connected to the radio chip, IC1. However, you would then lose the ability to write a new firmware image to the flash chip (we’re not sure if there will be any firmware updates in future). Because we program the flash chip from the Explore 100 at a fairly slow rate (it takes a couple of minutes to write around 2MB), these extra series resistors do not interfere with that process at all. set up the LCD controller and SD card. These steps can all be done using a computer’s USB port. You can also use this connection to load the BASIC code, as described below. Note that the micro-USB connector on the Explore 100 CON1 (if installed) only supplies power, so you will need to use the mini-USB connector (CON2) for this task. This, in turn, requires that JP1 be set to provide power from CON2. You should also take care that no other power supplies are connected, as they Screen2: the main radio screen, in DAB+ mode. 204.64MHz is channel 9B, one of four DAB+ frequencies used in Australia, and WSFM is one of the channel 9B services in Sydney. The channel text is displayed below this (it scrolls so you can read it all), with the reception power of 49dBµV shown above. The + and - buttons select different services while the << and >> buttons change frequency. Australia’s electronics magazine siliconchip.com.au may back-feed the computer through CON2. Alternatively, you can use a USBSerial Module connected to the serial port pins (GND/TX/RX) on the Micromite instead, with external power. If you are using Windows 10, macOS or Linux, then you should not need any special drivers on your PC. For earlier versions of Windows, you can download the SILICON CHIP USB Serial Port driver from http:// geoffg.net/Downloads/Maximite/ Silicon_Chip_USB_Serial_Port_Driver.zip or from siliconchip.com.au/ shop/6/930 You will need a terminal program such as TeraTerm or PuTTY. Find the serial port of the Micromite and open this port with the terminal program. The baud rate is unimportant, as it is merely a virtual serial port. After opening the serial port, press enter and you should see the text prompt “>” appear, possibly along with a boot message. To set up the LCD screen, type the following command: OPTION LCDPANEL SSD1963_5, LANDSCAPE, 48 OPTION SDCARD 47 GUI TEST LCDPANEL You should then see coloured circles appear on the screen. Press the spacebar to stop the test. Then run the following commands to set up and calibrate the touchscreen: OPTION TOUCH 1, 40, 39 GUI CALIBRATE You only need to run the last command above if your screen has already been set up. Use a stylus or similar to press accurately on the targets that appear in each corner of the screen. You should get a message like “done.” to indicate that calibration was successful. If you get an error message, try again. is set and the program will start when power is applied. By the way, it is also possible to get the BASIC code onto the Micromite by loading it onto a microSD card, plugging it into the Explore 100 and using the LOAD command. Loading the BASIC code Loading the radio firmware If you programmed the PIC32 with the HEX file that already contains the BASIC code, you can skip to the next section. Otherwise, you will need to load the radio code onto the Micromite chip. Note that the ‘uncrunched’ (ie, including comments and whitespace) version of the BASIC program is too large to be loaded into the Micromite’s flash memory, so the ‘crunched’ version must be used unless you are using a program like MMedit, which supports automatic crunch-on-load. In the terminal, type “XMODEM RECEIVE” and press Enter. Use the terminal program’s menu to send the BASIC file using the XMODEM protocol. In TeraTerm, this can be done by choosing the File Transfer → XMODEM → Send.. menu option and then selecting the file. After a few seconds, you should get a message that the program has been saved. Now type “RUN” and press Enter. The program will start and display diagnostic information in the terminal window, and the Micromite display panel should show its startup messages too. While you might not be ready to use the unit just yet, this step ensures that the AUTORUN flag In addition to the MMBasic software that runs on the Micromite, providing the radio user interface and controlling the Si4689 radio IC (IC1), there is also software (firmware) that needs to be loaded into the radio IC itself. While it is possible to get the Explore 100 to read this off an SD card and load it into IC1, that’s a slow process, so it is also stored on serial flash memory chip IC3. Three firmware images need to be loaded into IC1, one for each radio reception mode (DAB+/FM/AM). There is also a so-called “bootloader” image which is loaded directly from the Micromite, which allows IC1 to load the main firmware images by itself. The bootloader is just 940 bytes, so it fits comfortably in the Micromite’s own flash memory, and since it’s small, it’s fast to load in this way (the main firmware images are around half a megabyte each). This 940-byte bootloader then loads a larger 6kB bootloader from the serial flash IC, and that is then used to load the larger firmware images. If you have purchased the kit from the SILICON CHIP ONLINE SHOP, your flash chip should already be programmed with the necessary firmware images. So you just need to load Screen3: the main screen with the radio in FM mode. You can see that the RDS data has given us the station name and currently playing song. The SNR and received power figures are shown just below the tuning control, which is surrounded by the fine and coarse tuning buttons and scan up/down buttons. The eight channel presets are below, with the mute and volume control to their right. siliconchip.com.au Screen4: in AM mode, there is no text display or station name; we simply show the tuned frequency, signal-to-noise ratio and received power figures. The Standby button switches the radio and screen off but leaves the micro powered up, so you can wake it up by touching the screen or pressing the power button on the remote control. Australia’s electronics magazine March 2019  45 the software into the Explore 100 (see below). If you do not have a pre-programmed flash chip, there is a routine in the supplied Micromite BASIC code which can do this for you. By the way, we’re storing the 940byte bootloader as binary data encapsulated in a “CFUNCTION” in the BASIC code. But it isn’t really a function; it’s just a blob of data that we can read out of the micro’s flash memory and feed to the radio IC. progress of the write as follows: Programming the flash chip If you see something very different or an error is reported, then the write has not completed correctly. You should check that the connections between IC1 and IC3 are correct, especially the four series resistors (see panel). If the write completes successfully, then the programming is complete. If you need to program the flash IC with the radio IC’s firmware, this can be done from the unit itself, although it does require the firmware images to be placed on a microSD card, so that they can be copied. They consist of four files with .bin extensions (see Fig.3). Copy them to the root directory of a microSD card and plug it into the Explore 100. Power the radio on from a USB socket (so that the diagnostic serial data can be viewed) and allow it to boot. Open the serial port and press the Config button on the main screen. There is a button labelled “Write Flash”. Press this to start the process of copying the files from the microSD card to the flash IC. The “Write Flash” button will change to say “Writing...” and the process will take around five minutes. You should see the button change to “Write Done” when the process is complete. The serial port will also display the erasing flash chip: please wait... flash chip erased writing FM radio firmware to flash... writing DAB radio firmware to flash... writing AM radio firmware to flash... writing Loader firmware to flash, copy 1 at 0x2000 writing Loader firmware to flash, copy 2 at 0x4000 Setting up the radio As you can imagine, the DAB+/FM/ AM radio is full of features which we will now explain in detail. On power-up, a splash-screen is displayed while the various systems are initialised (Screen 1). After a few seconds, the main screen appears and the radio is ready to use (Screens 2-4). In the AM and FM modes, there is one station or program at each frequency. But with DAB+, multiple “services” (which can have multiple components) coexist on the same frequency. There are few frequencies used for DAB+ (four in Australia), so the radio only needs to search for services inside this limited range of frequencies, rather than seeking across an entire band, as with AM or FM. The top half of the radio display (inside the large frame) is responsible for tuning and band control, as well as the selection of digital radio services. Some of the buttons only appear in certain modes; some of the tuning buttons do not appear in DAB+ mode, while the service selection buttons are not visible in the AM or FM modes. Tuning The buttons around the frequency display near the top of the screen are used for tuning. The “+” and “-” buttons change the frequency in small steps, akin to fine-tuning. In AM mode, for example, these are 1kHz steps. This is mainly useful for correcting small errors when entering a frequency using the keypad. The next buttons, “<” and “>”, tune in larger steps: 9kHz for AM and 0.1MHz for FM. These would generally be used for manually stepping through the frequency band, listening for stations. The outermost buttons, “<<” and “>>” are used for seeking. They will step the frequency down or up until the radio finds a station. This is done by the radio chip internally. In DAB+ mode, these are used to switch between the four channels. By default, the radio is set up for the Australian DAB+ frequencies, but you can change this in the settings if you are overseas. If you try to seek but the radio cannot find any stations, you can press one of The serial port produces a lot of useful information during the boot process, and will be helpful in troubleshooting any problems. This test screen is typical of a normal startup. Screen5: the configuration screen gives you some checkbox (on/off) options at upper left, LCD backlight control settings, a locale setting (to determine which DAB+ frequencies are used) plus an error log display at right and a button to write new firmware to the serial flash chip (IC3). 46 Silicon Chip Australia’s electronics magazine siliconchip.com.au Fig.4: these files need to be in the root directory of the SD card plugged into the Explore 100 module before you can program flash chip IC3 with the radio firmware. You could also copy the basic file and use the LOAD command the tuning buttons again to cancel the seek. Note that all the other buttons are disabled while a seek is occurring. The frequency display can also be touched to manually enter a station frequency using an on-screen numeric keyboard. Sensible bounds are provided to prevent invalid values being entered. In the DAB+ mode, the buttons next to the upper frame are available, and these are used to cycle through the available services on a given frequency. There is no specific order to these services; they are listed in the order that they are detected by the radio chip, IC1. The smaller frames below are used to indicate station information and, if available, information about the current program (eg, which song the station is currently playing, or the latest news or weather). AM broadcasts have no facility for carrying program information, so the station information is limited to the tuned frequency in this case. In FM mode, it displays the tuned frequency by default, but if RDS (Radio Data System) is available, this will carry the station name which will then be displayed. RDS data usually also contains program information, which is displayed in the lower frame. When DAB+ mode is active, the upper frame displays the service name, with the lower frame showing program information, if available. There are also small numerical displays indicating the received RF power and either signal-to-noise ratio (SNR; in AM/FM mode) or signal quality (in DAB+ mode). Despite DAB+ transmissions being vertically polarised, we found DAB+ reception to be best with the antenna horizontal while FM reception was siliconchip.com.au best with the antenna vertical. You may need to experiment with antenna orientation and positioning to maximise reception. Keep the AM loop antenna away from the radio and ideally, near a window. Station presets Below the tuning controls, eight preset buttons provided, which can be set to any station, band or service. A long press on one of these buttons (for more than one second) will store the currently tuned station or service to that preset. The button caption is changed to match the name displayed in the upper frame, which may be a frequency or text if this is available from an RDS or DAB+ service. A short press activates the preset, changing band, frequency and service as necessary. Any time a station or service is saved, all of the current settings are saved to flash, so that they are reloaded the next time the radio starts. To the right of the presets are the volume and mute controls. The volume level is remembered while muted, although the control is disabled and can’t be changed until mute is disabled. The volume scale is from zero to 63 (loudest), as this is what the radio IC uses internally. The radio can detect when headphones are plugged into the jack socket, and any connected speakers are automatically muted when headphones are plugged in. Since the stereo amplifier driving the speakers has its own volume control, volume for the headphones and speakers can be set independently. This saves your ears from being blasted when plugging headphones in (although it’s always a good idea to put Australia’s electronics magazine them on after plugging in) and is also convenient since you can set a comfortable default level for both outputs. Because IC1 is not able to deliver digital and analog audio outputs simultaneously, if you want to use the digital outputs, you will need to enable them using the Dig Out button on the main screen. It is automatically disabled when headphones are plugged in, so that the headphone output can produce sound, and this also has the beneficial effect of automatically muting any speakers connected to the digital outputs. Settings At the bottom right of the display is the “Config” button, which will take you to a separate Settings page. Pressing the “Main” button will then return to the main radio screen. Whilst on the Settings page, the radio will continue doing whatever it was doing last, so you can continue listening to the last tuned station as you fiddle with the settings. As well as providing some configuration options, this page also includes an error log, which can be used to help debug the unit in the absence of a serial terminal display. If the message “No Errors” is seen, chances are that everything is working normally. If multiple errors are indicated, pressing the up and down arrows next to the display will cycle through the text description of the errors found. Practically all the errors that can be shown will involve IC1, the main radio IC. We’ve also mentioned the “Write Flash” button above in the setup section. There is little need to use this after the radio is operational, but we hope that there will be future firmware upgrades to the Si4689 radio IC to expand its features, in which case this can be used to write the newer firmware to the flash We’ll briefly explain what each of the settings does now. There is a “Save Settings” button in the top right corner. While most settings will take effect immediately, they will not be saved automatically; they must be saved if you want them to be retained after a power cycle or reset. There is a backlight dimming control which can be used to reduce the backlight brightness after the display is not touched for the delay period. As soon as the display is touched, the March 2019  47 maximum backlight intensity is set. The maximum cannot be set any lower than 20%. This prevents the screen from becoming unreadable. The “Digital Output” checkbox disables analog audio when selected (and no headphones are plugged in), allowing the digital audio outputs to be used. There is also a setting to swap the left and right analog outputs, in case your speaker or headphone channels are swapped. And there’s a setting to force mono output in cases where you may only have one speaker, eg, if you’ve built the radio into a box with an internal speaker. And there’s also an option to enable “quiet mode”, where SPI traffic and CPU activity is kept at a minimum, to maximise reception, especially for AM. Note though that when this is enabled, you will not get an FM RDS or DAB+ station information display. Remote Control In addition to the touchscreen, the unit can also be manipulated using a universal infrared remote control. We have included code to allow many of the functions to be controlled by an Altronics A1012 or Jaycar XC3718 remote control (others may be suitable, but we have not tested them). Many, but not all of the features can be accessed from the remote control. Since there is no easy way to tell a long press from a short press, stations cannot be preset, but existing presets can be selected using the remote control. The BASIC program has space for custom remote codes, and also displays the codes it receives to the serial monitor. Thus, if you’re interested in modifying the BASIC source, you can easily find out what codes are being transmitted by your remote, and use them to add functions to your radio. By default, remote control buttons 1-8 select between your presets, with the volume and mute controls providing their standard functions. Seeking can be accomplished with the channel up and down buttons, and switching bands is done by the AV button on the Altronics remote. Since the Jaycar remote lacks a mute or AV button, the play/pause button is used for muting, and the “CH” button provides band switching. You can also enter an AM or FM station frequency manually using the remote control, by first pressing the “200+” (Jaycar) or “OK” (Altronics) button, then typing in the frequency. Then press the 200+/OK button again to tune to that station, or standby/on/ off on the Altronics remote to abort. The Jaycar remote should work out of the box, but the Altronics remote needs to be set to use AUX code 171. This is done by pressing and holding the SET button, then pressing the AUX button and releasing the SET button. When the LED illuminates, enter the code 171 using the number keys, and the LED should go out. Refer to the remote control manual for more detail on the programming process. You will need to press the AUX button before using the remote so that the codes are sent using the correct code. What’s next? We’ve been swamped with suggestions of extra features for the DAB+/ FM/AM Radio. You will have seen from the first part of the series that we have even included a header to attach a potential expansion board and connections to the audio multiplexer to allow an alternate source of audio to be fed to the output stages. We don’t yet have any firm plans for what (or even if or when) will be added here. The expansion header was designed with the intent of allowing Two of probably hundreds of remote controls suitable for this project (the only ones we actually tested). On the left is the Altronics A1012 “Universal Remote Control” while the smaller unit on the right is the Jaycar XC3718. It’s sold as an “Arduino” remote control but works perfectly with the DAB+ radio. 48 Silicon Chip Australia’s electronics magazine a WiFi-equipped board (such as one based on an ESP8266) to be attached, and be able to provide access to internet radio stations. But there are so many possibilities for expanding or enhancing the radio that we couldn’t possibly investigate all of them properly. So, we put the call out to you, dear reader. We challenge you to add features to the radio. The source code is available to those subscribers constructing the project, and the expansion header makes changing the hardware easy (and reversible). Take great care if you are considering changing the interface with the radio IC. It’s easy to “break” the code, although you probably won’t damage anything; going back to the original software should at least get your radio going again. Adjust the user interface if you like. The colour scheme is simply set by numerous CONSTs at the start of the code, so this aspect can quite easily be changed if you prefer a different feel. If you come up with a useful enhancement, please send it in. We may publish it in Circuit Notebook, or even its own article, if it’s significant enough. We look forward to seeing what you come up with. SC DAB Receiver Parts: The following parts for the DAB+/FM/AM Receiver will be available from the SILICON CHIP ONLINE SHOP: Main PCB only (SC4895) $15.00 Main PCB with IC1 pre-soldered (SC4896) $60.00 Main PCB with IC1 and extra SMD parts pre-soldered (SC4897) $80.00 Set of SMD parts (contains most parts not included with the partially preassembled board) (SC4904) $30.00 Clear acrylic case (SC4849) $20.00 465mm extendable VHF whip antenna with SMA connector (mainly for DAB+) (SC4847) $10.00 700mm extendable VHF whip antenna with SMA connector (good for DAB+ and FM) (SC4875) $15.00 PCB-mount right-angle PAL socket (SC4848) $5.00 PCB-mount right-angle SMA socket (SC4918) $2.50 Dual horizontal PCB-mount RCA sockets (RCA-210) (SC4850) $2.50 siliconchip.com.au