Silicon ChipMicromite BackPack Touchscreen DDS Signal Generator - April 2017 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Big Brother can control your aircon
  4. Feature: DRED: they can turn your aircon off! by Dr David Maddison
  5. Feature: El Cheapo Modules, Part 6: Direct Digital Synthesiser by Jim Rowe
  6. Subscriptions
  7. Project: New Spring Reverberation Unit by Nicholas Vinen
  8. Project: The eFuse: never replace another blown fuse by John Clarke
  9. Project: A Digital LCD Audio ’Scope for less than $40! by Jim Rowe
  10. Serviceman's Log: Stomping on the pedal killed it by Dave Thompson
  11. Project: Micromite BackPack Touchscreen DDS Signal Generator by Geoff Graham
  12. Review: Keysight DSOX1102G Digital Oscilloscope by Nicholas Vinen
  13. PartShop
  14. Vintage Radio: Sony’s TV8-301: the world’s first direct-view transistor TV set by Ian Batty
  15. Market Centre
  16. Advertising Index
  17. Notes & Errata: Squash and Ping-Pong / Pool Lap Counter / Stationmaster / Voltage/Current Reference with Touchscreen

This is only a preview of the April 2017 issue of Silicon Chip.

You can view 40 of the 96 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 "El Cheapo Modules, Part 6: Direct Digital Synthesiser":
  • AD9833 DDS module with programmable attenuator (Component, AUD $25.00)
  • AD9833 DDS module without attenuator (Component, AUD $15.00)
  • Software for El Cheapo Modules: AD9833 DDS (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)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (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)
Items relevant to "New Spring Reverberation Unit":
  • New Spring Reverberation Unit PCB [01104171] (AUD $12.50)
  • New Spring Reverberation Unit PCB pattern (PDF download) [01104171] (Free)
Items relevant to "The eFuse: never replace another blown fuse":
  • Electronic Fuse PCB [04102171] (AUD $7.50)
  • Hard-to-get parts for the Electronic Fuse (Component, AUD $25.00)
  • Electronic Fuse PCB pattern (PDF download) [04102171] (Free)
  • Electronic Fuse panel artwork (PDF download) (Free)
Items relevant to "Micromite BackPack Touchscreen DDS Signal Generator":
  • Micromite LCD BackPack PCB [2.8-inch version) [07102122] (AUD $5.00)
  • PIC32MX170F256B-50I/SP programmed for the Micromite-based DDS Signal Generator [SigGeneratorFull.HEX] (Programmed Microcontroller, AUD $15.00)
  • MCP1700 3.3V LDO (TO-92) (Component, AUD $2.00)
  • AD9833 DDS module with programmable attenuator (Component, AUD $25.00)
  • CP2102-based USB/TTL serial converter with 5-pin header and 30cm jumper cable (Component, AUD $5.00)
  • Matte/Gloss Black UB3 Lid for 2.8-inch Micromite LCD BackPack (PCB, AUD $5.00)
  • Clear UB3 Lid for 2.8-inch Micromite LCD BackPack (PCB, AUD $5.00)
  • Gloss Black UB3 Lid for 2.8-inch Micromite LCD BackPack (PCB, AUD $4.00)
  • Software for the Micromite-based Touchscreen DDS Signal Generator [SigGeneratorFull.HEX] (Free)
  • Micromite LCD BackPack PCB patterns (PDF download) [07102121/2] (Free)
  • Micromite LCD BackPack/Ultrasonic sensor lid cutting diagrams (download) (Panel Artwork, Free)

Purchase a printed copy of this issue for $10.00.

Touchscreen DDS Signal Generator It can produce sine, triangle or square waveforms from 1Hz to 10MHz, with ±0.005% frequency accuracy and it also has a sweep function. Its touchscreen LCD makes it very easy to drive and you can use it for audio or RF applications. by Geoff Graham T his project combines a low-cost DDS function generator module with our touchscreen Micromite LCD BackPack module (first described in the February 2016 issue) to create a remarkably capable signal generator for the price. It can generate sine, triangle and square wave signals from 1Hz to 10MHz and you can specify that frequency with 1Hz resolution. The Direct Digital Synthesiser (DDS) function generator module produces the actual waveforms while the Micromite controls it and provides an easyto-use graphical user interface (GUI). As well as generating the basic waveforms, this unit can also act as a sweep generator, allowing you to test the frequency response of filters, speakers, IF (intermediate frequency) stages (in superheterodyne radios) and more. Other features include an adjustable output level, selectable amplitude modulation for the sine wave output and a selectable log/linear function for the frequency sweep. Many would consider a signal generator to be the next most useful tool to have on a workbench after the multimeter and oscilloscope. While this device will not compete with a $1000 synthesised signal generator, it does 68  Silicon Chip provide the basics at a tiny fraction of the cost. The DDS function generator module is fully assembled and can be purchased for about $15 on eBay or AliExpress. Combined with the Micromite BackPack (which uses fewer than a dozen components), you can build the whole project in under an hour and without breaking the bank. other words, DDS is somewhat similar to digital audio playback from a computer or compact disc but it normally operates at a much higher frequency. We have a separate article on the AD9833 DDS IC and modules based on it elsewhere on this article, so please refer to pages 18-24 for an explanation of how it works. Analog Devices AD9833 Because the AD9833 module uses a crystal-controlled oscillator to produce the sample clock, the precision of the output frequency is determined by the precision of the crystal. With the specified module, this is better than ±50ppm (our prototype achieved about ±10ppm). This also means that calibration will not be required and the frequency will not drift with time. For example, if you set the output to 1MHz, you can expect it to typically be between about 999.999kHz and 1000.001kHz, or in the worst case, between 999.995kHz and 1000.005kHz. Another benefit of DDS is that the phase of the output will not change when the frequency register is updated and this in turn means that the output waveform will not have a glitch at the time of the change. This is vital for The AD9833 waveform generator IC is the heart of the signal generator module used in this project. It uses a DDS to generate its output. Normally, it is difficult to digitally generate a relatively pure, variable frequency sine wave. Even the best Wein bridge (analog) oscillators are notoriously difficult to stabilise and can not be controlled over anywhere near the range of frequencies that this DDS unit can produce. DDS involves a high-speed digitalto-analog converter along with a ROM lookup table, a phase accumulator and possibly digital interpolation to produce a relatively pure, variable frequency waveform. The waveform shape can be changed by using a different lookup table or using a reprogrammable lookup table. In Frequency precision siliconchip.com.au Features & Specifications General Frequency accuracy: ±50ppm Power supply: 4.5-5.5V DC at 350mA maximum Output level: 10mV to 3V peak-to-peak (~3mV to ~1V RMS), 20Hz to 1MHz Sinewave mode Frequency: 1Hz to 10MHz with 1Hz resolution Output level: as above up to 1MHz, reducing to 0.8V peak-to-peak at 10MHz Amplitude Modulation: on/off (1kHz square wave) Triangle wave mode Frequency: 1Hz to 1MHz with 1Hz resolution Square wave mode Frequency: 1Hz to 1MHz with 1Hz resolution Sweep mode Waveform: sinewave only Frequency start/stop: 1Hz to 1MHz with 1Hz resolution Sweep period: 50ms, 100ms, 500ms, 1s, 2s Sweep law: linear or exponential Trigger output: 250µs positive pulse at start of sweep generating sweeps as it allows the frequency to be changed smoothly from one end of the sweep range to the other. Because the waveform is digitally created with 1024 steps for each sinewave quadrant, the output is not perfectly smooth. The resulting harmonic distortion means that it is not quite good enough for noise or distortion measurements; its signal-to-noise ratio is about -60dB and its total harmonic distortion is typically 0.05%. Having said that, it is more than adequate for general purpose tasks and the ability to quickly and accurately set the output frequency makes it a pleasure to use. DDS module with gain control The output of the AD9833 IC is about 0.6V peak-to-peak, so the function generator module that we are using includes a high-bandwidth amplifier based on the AD8051 railto-rail op amp. This can drive lowimpedance loads (eg, 50W) and provide higher output levels (up to 3V peak-to-peak). To control the gain of the output amplifier, the module uses a Microchip MCP41010 8-bit digital potentiometer which is under control of the Micromite (along with the AD9833). siliconchip.com.au Screenshot 1: this is the screen displayed for a sinewave output. The frequency can be changed by selecting a digit to change and touching the red up/down buttons. The signal level (expressed as a percentage of full scale) can be similarly adjusted. The check box marked AM will enable a 1kHz square wave amplitude modulation. The bandwidth restrictions of the MCP41010 potentiometer result in a reduction in the output signal level above about 2MHz. The output is still good for up to 10MHz but the signal level for sinewaves will be reduced and the triangle and square waves will look more like sine waves, so we have specified both of these to only 1MHz. Micromite LCD BackPack As with a number of our recent projects, this one is based on the Micromite LCD BackPack and relies on the touchscreen interface on the LCD panel to set the frequency and output levels – there are no switches or knobs. The program is written in BASIC and because it is stored in plain text, you can see how it works and if you have the inclination, modify it to suit your personal preferences. For example, you can easily change the colours or add a special feature. The Micromite LCD BackPack was described in the February 2016 issue of Silicon Chip and uses fewer than a dozen components. If you're reasonably experienced, you can build it in around half an hour. It includes a 3.3V regulator, the 28-pin Micromite PIC32 chip and touch-sensitive LCD screen. A complete kit is available from the Silicon Chip Online Shop. The February 2016 issue (printed or online) can also be purchased from the same source. Note that if you want to try out the BASIC program for this project, you can do it on any Micromite with an ILI9341-based LCD panel connected; you do not need a DDS function generator module. This is because the Micromite only sends commands to the AD9833 and MCP41010; it does not look for a response (and neither chip provides one anyway). So it won't know the difference; you simply won't get any signal output. Driving it In operation, the signal generator is quite intuitive, with everything controlled via the colourful touchscreen LCD panel. Probably the best way to appreciate this is by looking at the screen shots. At the bottom of every screen are four touch-sensitive icons which are used to select the operating modes: sine, triangle, square wave and sweep. Touching one of these will immediately switch to that mode. Starting with the sinewave mode (shown in Screenshot 1), the frequency is adjusted by touching the red up/ down buttons on the right of the frequency display. The least significant April 2017  69 Screenshot 2: you can enter a precise frequency or signal level by touching and holding the frequency or level display. This keyboard will then appear so you can enter the value. The DEL key deletes the last number entered and the SAVE button saves the value and return to the main screen. digit that you want to change can be specified by touching that digit and it will then be highlighted in blue. A single touch on either the up or down buttons will increment or decrement the frequency but if you hold the button down, the frequency will increment or decrement with increasing speed. While you are adjusting the display in this way, the output frequency will follow in real time so it is easy to scan CON3 Screenshot 3: the screen for generating the triangle waveform output is similar to that used for sinewaves. Along the bottom of the screen, the four touch sensitive icons are used to select the four operating modes – sine, triangle, square wave and sweep. through a range of frequencies to find the one that you want. If you want to simply jump to a specific frequency, you can touch and hold a digit on the display and an onscreen numeric keypad will pop up, allowing you to directly key in the frequency that you want (see Screenshot 2). Touching the SAVE button on this keypad returns to the main screen with that frequency set while the CON1 (CONNECTIONS TO LCD) (BLACK) GND DEL button will delete the last digit entered. The process to adjust the signal level is similar although you do not need to select a digit as the up/down buttons will always change the least significant digit. Touching a digit in the level display will also take you to a numeric keypad where you can enter a specific level in the range from zero to 100% of full scale (about 3V peak-to-peak). 4 TO USB PLUGPACK (+5V) 3 2 RX (RED) TX 1 USB CONNECTOR TYPE A MALE 5V GND +5V MICROMITE LCD BACKPACK +3.3V VCC 26 GND 25 FSY 24 SCLK 22 SDATA 21 CS AD9833 BASED DDS FUNCTION GENERATOR MODULE GND 470µF SIGNAL X1 OUTPUT PGA VOUT 100nF 470Ω GND SIGNAL X0.1 OUTPUT 18 17 820Ω 56Ω 16 14 10 9 TRIGGER OUTPUT 5 4 3 RESET CON2 70  Silicon Chip Fig.1: the circuit consists of just two modules and a few components to provide the connections from the PGA output of the DDS module. This configuration provides two AC-coupled outputs, one of which is attenuated by a factor of ten (20dB). You can change the output connections if necessary for your application. siliconchip.com.au Screenshot 4: the DDS module does not allow you to change the level of the square wave output so this is fixed. Frequency selection is the same as the other modes – the frequency is changed by selecting the least significant digit to change and touching the red up/down buttons. The sinewave screen has a check box for turning on or off amplitude modulation at 1kHz. This simply modulates the output with a 1kHz square wave and is useful for signal tracing in AM radios, both broadcast and shortwave, up to 10MHz. The triangle waveform screen is similar to sine except that it does not provide an AM facility (see Screenshot 3). The square wave screen (shown in Screenshot 4) is also similar to the other two except that you cannot change the signal level (the MCP41010 digital potentiometer is not suitable for attenuating square waves). All the changes that you make, including the waveform selection, are automatically saved in non-volatile memory and are recalled on power up. This means that when you turn on the signal generator, it will start up with exactly the same settings that you were using the last time. Sinewave sweep The sweep screen (Screenshot 5) uses a different screen layout. To select the start and end frequencies, you simply touch the frequency that you need to change and enter the specific frequency on the pop-up numeric keypad. You can select any frequency that you wish so you could even sweep all the way from 1Hz to 10MHz if you wanted to. The output level is selected in a similar way, just touch the level display and a numeric keypad will pop siliconchip.com.au Screenshot 5: the sweep output screen allows you to select the start frequency, end frequency, signal level, the sweep time and whether an exponential sweep is required. Touching entries like the start frequency makes a numeric keypad appear so you can key in the value that you want. up allowing you to enter that setting. The sweep period works slightly differently; it will change every time you touch it, allowing you to step from a 50ms sweep time up to two seconds before wrapping around to 50ms again. Normally, the frequency sweep is performed in a linear manner with time but you can select an exponential (ie, inverse log) sweep with the “Log” check box. With a linear sweep, it would take twice as long to go from 200Hz to 400Hz as it would from 100Hz to 200Hz. With an exponential sweep, it takes the same amount of time to go from 200Hz to 400Hz as it does from 100Hz to 200Hz, as both require a doubling in the output frequency. This sounds more natural to human ears as doubling the frequency is equivalent to going up by one octave on a musical instrument. The swept output is always a sinewave and at the start of the sweep, the Micromite generates a 250µs positive-going pulse on its pin 16 output, which is connected to the trigger output socket. This signal can be used to trigger an oscilloscope so that it can lock onto the start of the sweep cycle for analysing the frequency response of a circuit or device. Circuit details Because the signal generator essentially consists of just two packaged modules connected together, the circuit is quite simple, as shown in Fig.1. There are six connections between the LCD BackPack and the DDS function generator module. These are for power (+3.3V and ground), the serial data lines to the DDS (DAT and CLK) and two additional signals: FSY, which when pulled low selects the AD9833 DDS chip as the recipient of serial data and CS, which similarly is pulled low when the MCP41010 digital potentiometer is being sent a command via the serial bus. The DDS module can run from 5V but we are using the regulated 3.3V supply rail from the Micromite LCD BackPack to avoid possible problems caused by potential noise from the output of a 5V USB charger. This noise can upset the AD9833 and MCP41010 ICs which need a clean power supply. There are two outputs on the DDS module. One is labelled Vout and this is a fixed direct-coupled output from AD9833 waveform generator itself (about 0.6V peak-to-peak). But we are using the PGA (programmable gain amplifier) output of the module and it is AC-coupled to two RCA sockets, one at the full output level and the second attenuated by a factor of 10. Combined with the MCP41010 digital potentiometer in the DDS module, this gives an output range from 10mV to 3V peak-to-peak (equivalent to 3.5mV to 1.06V RMS). The use of the 470µF coupling April 2017  71 capacitor means that the output is usable to below 10Hz even into a 600W load. The parallel 100nF capacitor caters for higher frequencies, essentially bypassing any internal inductance of the larger capacitor. The output from the module will swing from a little above ground to some maximum voltage determined by the MCP41010 digital potentiometer, below 3.3V. If you will be primarily using the signal generator for testing digital circuits, you might prefer to dispense with AC-coupling and use DC coupling instead. You could even install a toggle switch to switch between these modes. Similarly, you could use a switch to select different output attenuation levels if you wish. And you might consider using BNC sockets instead of the RCA sockets that we used. The trigger output has simply been connected to output pin 16 of the BackPack. You may wish to include a lowvalue series resistor (eg, 1kW or less) to protect the BackPack from static discharge or accidental application of voltage to this terminal; it should not affect the trigger signal greatly. Purchasing the right module If you search eBay or AliExpress for “AD9833”, you will find plenty of DDS modules (over 100 hits). However, you must be careful to purchase the correct module – there are a number of variations available and the firmware is written specifically to suit the module that we have pictured here. It will probably not work with other modules, even if they also use the AD9833. So, check that the photograph matches perfectly and do not purchase anything different. Here is one which should be suitable: w w w. a l i e x p r e s s . c o m / i t e m / 2 - 3 - 5 - 5 V- S i g n a l - G e n e r a t i o n M o d u l e - Tr i a n g l e - S i n e - Wa v e Signal-Source-IC-Integrated-CircuitSquare/32724505169.html Many of the photos on eBay show the module with the I/O connector and SMA output socket already soldered to the board but all the vendors that we purchased from supplied these two components separately. We did not find the SMA socket necessary in our application but you could fit it if you want to. Construction Construction mostly involves assembly of the Micromite LCD BackPack and then mounting and connecting the DDS function generator module. The BackPack PCB is silk-screened with the component placement and values so it is simply a case of populating the board and plugging it into an ILI9341-based LCD panel. We suggest you use the 2.8-inch version. The February 2016 issue of Silicon Chip, which described the Micromite LCD BackPack, fully covers this aspect. If you have a PIC32 chip that's already programmed with the MMBasic firmware then you will need to set up the LCD panel for display and touch, then load the BASIC code into the chip using a serial console.A detailed explanation of how to do this is provided in the Micromite User Manual and the February 2016 issue of Silicon Chip. However, if your PIC32 chip is blank, you can load MMBasic and the code for this project simultaneously by programming it with the file “SigGenerator.hex”, which can be downloaded from the Silicon Chip website (along with the BASIC code). You will need a PIC32 programmer such as the PICkit 3 or the cheap DIY PIC32 programmer described in the November 2015 issue. If you do not have such a device, you can simply purchase a fully programmed microcontroller from the Silicon Chip shop. Regardless, if your chip is programmed with “SigGenerator.hex”, all that you need do is plug the chip into its socket and connect the DDS module and you are ready to go. The only point that you need to be aware of is that the touch calibration in the above firmware was done with a standard LCD panel. However, yours might require re-calibration if it is significantly different from the one that we used. This can be done by connecting a USB-to-serial converter to the console, halting the program with CTRLC and running the calibration routine by issuing the “GUI CALIBRATE” command. For further information, see the February 2016 BackPack article or M3 x 10mm BLACK MACHINE SCREW ACRYLIC LID/PANEL WITH CUTOUT FOR LCD (REPLACES ORIGINAL UB3 BOX LID) TOUCH-SCREEN LCD M3 NYLON WASHER (1mm THICK) M3 x 12mm TAPPED SPACER 2.8-INCH LCD PCB MICROMITE 2.8-INCH BACKPACK PCB M3 x 6mm MACHINE SCREW The Signal Generator is based on this pre-assembled DDS function generator module which uses the Analog Devices AD9833 to generate the signal. It's amplified by an AD8051 high-speed op amp while a Microchip MCP41010 digital potentiometer controls the gain. 72  Silicon Chip M3 NYLON NUTS DDS MODULE PCB M3 x 10mm NYLON SCREWS UB3 BOX Fig.2: the DDS module is mounted in the bottom of the box using M3 machine screws, nuts and Nylon nuts as spacers. By contrast, the BackPack is attached to the underside of the laser-cut lid. The wiring is not shown in this diagram. siliconchip.com.au the Micromite User Manual (which can be downloaded from the Silicon Chip website). Putting it in a box The Micromite LCD BackPack fits neatly into a standard UB3 plastic box, as we have done with similar projects based on the BackPack. The easiest way is to use the lasercut acrylic front panel which replaces the standard lid supplied with the box and is normally supplied with the kit. This provides a neat looking assembly with the display and BackPack securely fastened. You can also purchase this panel from the Silicon Chip shop separately in a number of different colours including black and clear. Note that this panel is thicker than the lid supplied with the UB3 box so the self-tapping screws supplied with the box may not be long enough. In that case, replace them with No.4 x 10mm self-tapping screws. The first stage of assembly is to attach the LCD panel to the acrylic lid using an M3 x 10mm machine screw, a single M3 washer and an M3 x 12mm tapped spacer at each corner. This arrangement ensures that the surface of the LCD sits flush with the acrylic lid. Then, the backpack should be plugged into the LCD and fastened by M3 x 6mm machine screws to each spacer. Details of the full assembly is shown in Fig.2. The LCD and the BackPack require a 5V power supply with a minimum capacity of 300mA. For this, you can use a 5V plugpack or a USB charger. You can also find USB Type A to DC charging cables on eBay or AliExpress, which circumvents the need for cable rewiring. If you are using a plugpack, make sure that it is regulated and that its unloaded output does not rise above 5.5V as this could cause damage. Parts List 1 2.8-inch Micromite LCD BackPack module; see the February 2016 issue of Silicon Chip (kit available) 1 DDS function generator module with AD9833, AD8051 and MCP41010 ICs (see text and photos) 1 UB3 “jiffy” plastic box 1 pre-cut plastic lid to suit BackPack and UB3 box (normally included with kit) 1 USB charger plus USB cable with a male Type A connector on one end (alternatively, a USB Type A to DC connector charging cable) OR 1 5V regulated plugpack 1 matching chassis-mount DC barrel socket 6 flying leads (120mm) with single pin female headers (DuPont connectors) on each end (Jaycar WC6026, Altronics Cat P1017) 5 flying leads (120mm) with single pin female headers (DuPont connectors) on one end and bare wire on the other 1 6-pin right-angle male header 4 No.4 x 10mm self-tapping screws 4 M3 x 10mm tapped Nylon spacers 8 M3 x 10mm machine screws 4 M3 x 6mm machine screws 4 M3 Nylon washers 12 M3 Nylon nuts Capacitors 1 470µF 16V electrolytic 1 100nF multi-layer ceramic Resistors (all 0.25W, 5%) 1 820W 1 470W 1 56W For a USB charger, a suitable power cable can be made by cutting off one end of a standard USB cable (retaining the Type A connector on the other end) and soldering the free end to a suitable DC power plug. The red wire in the USB cable (+5V) should go to the centre pin of the plug and the black to the sleeve. The other two wires (the signal wires) can be cut short as they are not used. A matching DC socket for incoming power can be mounted on the side of the UB3 box. Two flying leads from this socket should be fitted with female header sockets (also known as DuPont connectors) which fit over the BackPack's power header pins (CON1). Fig.3 illustrates the complete assembly. The DDS function generator module can be mounted on the base of the UB3 box using four M3 machine screws and nuts. Use Nylon M3 nuts as spacers between the base of the box and the module. You need to select a spot for the module that will not foul the underside of the BackPack PCB, particularly CON1 and CON2 which extend close to the bottom of the box. Finally, connect flying leads from 5V 4 Tx 3 2 Rx 1 USB CONNECTOR TYPE A MALE GND DC INPUT PLUG DC INPUT SOCKET (ON END OF BOX) 4-PIN FEMALE HEADER CONNECTOR MICROMITE CON1 POWER AND CONSOLE CONNECTOR Fig.3: the Signal Generator is powered from a standard USB plugpack charger. To make a suitable power cable, cut one end off a USB cable (maintaining the type A male connector at the other end) and solder the red wire to the centre terminal pin of a DC plug and the black wire to the outer barrel connection. The matching DC socket is mounted on the side of the UB3 box and is connected to CON1 on the BackPack PCB. siliconchip.com.au April 2017  73 Interior view of the Touchscreen DDS Signal Generator showing the connections made from the Micromite BackPack to the module and internal connectors. You do not have to solder the extra through-hole components the way we did, as the UB3 jiffy box provides a fair bit of clearance. the module to the required pins on CON2 on the BackPack and from the DDS outputs to the RCA (or BNC) connectors. The most convenient method of mounting the output capacitor and resistors is to solder them directly onto the RCA/BNC connectors. Fig.4, overleaf, provides a convenient summary of all the connections to the DDS module. We suggest that you wire up the connections from the module to the BackPack using leads with female header sockets (DuPont connectors) at each end. These will simply plug onto the headers on both modules and this makes it easy to remove and/or Fig.4: an overview of all the connections to the DDS module. Flying leads can be used to connect the module to the BackPack and to the output connectors. The resistors and capacitors shown can be soldered directly between the output connectors. 74  Silicon Chip siliconchip.com.au replace the module if necessary. Altronics have suitable pre-assembled leads (Cat P1017) as do Jaycar (WC6026) or search eBay or AliExpress for "DuPont Jumper". Testing Before connecting the DDS function generator module, confirm that the Micromite LCD BackPack is working correctly and has been programmed with the BASIC code. The testing procedure is described in the Micromite User Manual and also in the February 2016 issue. Then it should simply be a matter of connecting the DDS module and checking its output. If it does not appear to be working, your first action should be to carefully re-check each connection. Then measure the volt- age across the pins marked VCC and GND on the module, which should give precisely 3.3V. Remember that the module does not provide any feedback to the Micromite so the LCD might show the frequency, level etc and look like it is working but this does not mean that the module is actually alive and reacting to these commands (it is a one-way communication path). If you have an oscilloscope or logic analyser, you can monitor the pins labelled FSY, CLK and DAT on the module. Every time you change the frequency you should see a burst of data on these pins. Similarly, the pins labelled CS, CLK and DAT will show a burst of data when the signal level is changed. If these are not present, re-check the Micromite LCD Backpack and its connections. A final test is to connect a LED with a suitable current limiting resistor or an old fashioned moving-coil multimeter directly to the output of the module and set the signal generator to a 1Hz square wave. You should see the LED or meter responding to the 1Hz output. If not, the simple option is to replace the DDS module. Scope 1-4 show waveforms that have been generated using the DDS Signal Generator. Firmware updates for the Micromite and the BASIC software for the DDS Signal Generator will be provided on the Silicon Chip website but you can also check the author's website for updates at: http://geoffg.net/micromite.html SC Scope 1-4: These scope captures show typical output waveforms. The sinewave output is reasonably smooth despite being digitally created; there is some harmonic distortion which means that you cannot use this project for precise noise and distortion measurements but it and the other outputs are quite suitable for general purpose tasks. The final scope capture shows a short sweep between 20Hz and 50Hz. siliconchip.com.au April 2017  75