Silicon ChipSelf-Contained 3.8GHz Digital Attenuator - October 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions
  5. Back Issues: Hare & Forbes Machineryhouse
  6. Publisher's Letter
  7. Feature: Forget leaves on the line! by Mark Nelson
  8. Feature: The Fox Report by Barry Fox
  9. Feature: Net Work by Alan Winstanley
  10. Project: SMD Test Tweezers by Tim Blythman
  11. Project: Tele-com Intercom using analogue phones by Greig Sheridan and Ross Herbert
  12. Project: TOUCHSCREEN AND REMOTE DIGITAL PREAMP WITH TONE CONTROLS by NICHOLAS VINEN AND TIM BLYTHMAN
  13. Feature: Self-Contained 3.8GHz Digital Attenuator by Jim Rowe
  14. Feature: Circuit Surgery by Ian Bell
  15. Feature: Make it with Micromite by Phil Boyce
  16. Feature: Max’s Cool Beans by Max the Magnificent
  17. Feature: AUDIO OUT by Jake Rothman
  18. Feature: KickStart by Mike Tooley
  19. Feature: Electronic Building Blocks by Julian Edgar
  20. PCB Order Form
  21. Advertising Index

This is only a preview of the October 2022 issue of Practical Electronics.

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

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Using Cheap Asian Electronic Modules By Jim Rowe Self-Contained 3.8GHz Digital Attenuator This digitally programmable RF attenuator module can attenuate RF signals from 1MHz to 3.8GHz by 0-31dB in 1dB steps. It doesn’t need to be controlled by an external microcontroller; it has one built in. You control it using four small pushbutton switches, while a tiny OLED screen shows the current setting. I reviewed one of the simpler digitally programmable RF attenuator modules back in the June 2019 issue of PE. It could be configured either by a separate microcontroller unit (MCU) like a Micromite or Arduino, or a six-way DIP switch. It was based on the Peregrine Semiconductor PE4302 attenuator IC, mounted in the centre of a 33 x 24.5mm PCB without any shielding. Despite that, it turned out to have quite respectable performance up to about 1.5GHz. Above that, attenuation errors tended to grow, but the module was still quite practical for many applications. I recently noticed a new digitally programmed step attenuator for sale. It is only a little larger, but has a built-in MCU with a tiny OLED and some small pushbutton switches for easy attenuation adjustment. I ordered one from Banggood (ID number 1769385; also available from AliExpress – search for: ‘HMC472 6-bit Digital Attenuator’). At the time of writing, it is priced at about £14 plus £3 for shipping to the UK. I haven’t been able to find any information regarding its manufacturer, but like most of these modules, it is almost certainly made in China. This module measures 42 x 32 x 22mm overall, not counting the SMA connectors at each end for RF input and 38 output. The digital attenuator section is on a 33 x 22.5mm PCB inside a 42 x 32 x 10mm CNC machined aluminium block which forms the ‘case’. Most of the control section is mounted on a second PCB measuring 42 x 32mm, which forms the top of the case. The 26mm diagonal (38 x 12.5mm) OLED is mounted on top of the second PCB. The PE4302 digital attenuator chip used in the earlier attenuator module was made obsolete in 2018 and is no longer available. This new module uses the HMC472 from Hittite Microwave Corporation, a company acquired by Analog Devices in 2014. The HMC472 is similar to the PE4302 in many ways. It is described as a 6-bit digital step attenuator using GaAs MMIC technology, and can provide attenuation from 0dB to 31.5dB in 0.5dB steps for DC to 3.8GHz signals. It comes in a 24-lead Lead Frame SMD package measuring 4 x 4mm. Unlike the PE4302, it runs from 5V DC rather than 3.3V. The insertion loss at the 0dB setting is rated at 1.1-1.2dB below 350MHz, 1.5dB at 2GHz and 1.9dB at 4GHz. I wasn’t able to find a complete circuit for the new module, but I worked out a basic block diagram for it, shown in Fig.1. The HMC472’s RF1 input pin is coupled to the SMA connector via a 1nF capacitor, with its RF2 output pin configured similarly. Apart from various bypass capacitors, that is the whole attenuator section. The control section is based on an STM32F103C8T6 microcontroller. You may have noticed that it controls only five of the six programming lines of the HMC472: V1 to V5. The unused V6 line is the one that controls the 0.5dB attenuator stage inside the HMC472, which explains why this module only provides 1dB steps. Presumably, the module designers decided that given the attenuation error rating of the HMC472, ±(0.35dB + 5%), and the difficulty in avoiding further frequency-related errors due to, for example, PCB layout, there wasn’t much point in providing 0.5dB steps. The user determines the attenuation setting using the three small pushbutton switches (S1-S3), and the current attenuation setting is shown on the OLED module. The MCU drives this via a standard I2C serial interface. When power is first applied, the MCU sets the attenuation to 0dB. To increase the attenuation, you first press S2 (the OK button) and then press S1 (+) until the display shows the attenuation setting you want. Then, if you press S2 again, this will be the new setting. To Practical Electronics | October | 2022 Fig.1: block diagram for the programmable RF attenuator. This module, like many of the others we’ve discussed recently, is controlled by a popular STM32 ARM microcontroller. reduce the attenuation, you press S2 once more, then press S3 (−) until the OLED shows the new setting you want, and then press S2 again. It’s pretty straightforward, although the tiny pushbuttons used for S1-S3 do have a small amount of contact bounce. This can sometimes force you to press the + or − button again to correct any accidental ‘overshoot’ before pressing S2 to finalise the change. The CH340E USB-serial interface chip shown in Fig.1 has been provided to allow the attenuation setting to be programmed from a computer. So the mini USB socket is not just for feeding power to the module (controlled by power switch S4), but also to allow external control. There’s not a great deal of information provided on external control, but I found a very brief explanation in the ‘Customer Q&As’ section of the Banggood info on the module: The protocol is simple 9600 Baud serial: ‘wvXXYYn’ sets the attenuator to XX.YYdB. ‘rn’ returns the model number. Search GitHub using ATT6000 or emptemp for python code (https://github.com/emptemp/ att6000_control). I tried this, but I didn’t get very far. Using the serial terminal app Tera Term (V4.105) with the virtual com port driver set for 9600 baud, I tried all of the possibilities I could think of to try and get the attenuator module to ‘listen’ to a command like ‘wv1300n’. I tried sending the command in uppercase instead of lowercase, with and without the ‘n’ at the end, followed by an LF or a CR or a CR-LF, using 8-bit coding or 7-bit coding and so on. But there was no response or reaction from the module, whatever I tried. It stayed stubbornly set at 0dB of attenuation. So I’m not sure about how to control the module from a PC or MCU. Fig.2: a graph of the module’s performance at an attenuation setting of 0dB. This was measured between 100kHz and 4.4GHz, using Signal Hound’s Spike software with a USB-SA44B spectrum analyser and a matching USB-TG44A tracking generator. Practical Electronics | October | 2022 Checking it out I measured the performance of the new attenuator module using my Signal Hound USBSA44B HF-UHF spectrum analyser and its matching USB-TG44A tracking generator, both controlled by the latest version of Signal Hound’s Spike software (V3.5.15) in its SNA (scalar network analysis) mode. I checked the performance of the module at a number of different attenuation settings: 0dB (to see its insertion loss), −5dB, −10dB, −15dB, −20dB, −25dB and −30dB, to get an idea of the module’s overall performance. After examining the results I then checked the response at three further settings: −1dB, −18dB and −31dB. During each of these tests, I saved an image of Spike’s plot of the test results. The first of these (the one for a setting of 0dB) is shown in Fig.2. Spike cannot combine multiple results into a single composite plot, so I assembled one by importing them into CorelDraw and tracing each plot. The result is shown in Fig.3. The uppermost 0dB plot shows the insertion loss of the module over the entire frequency range. It is less than 2dB (as claimed) up to about 1.5GHz, but then wobbles around a bit until it reaches about −2.5dB at 2.64GHz and then −3.5dB at around 2.95GHz. Essentially, the insertion loss remains under 2.0dB over much of the frequency range, apart from some deviations between 1.5GHz and 3.8GHz. Most of the lower plots in Fig.3 have a shape almost identical to that of the top 0dB plot, just separated by the chosen attenuation setting. This is also true for the uppermost blue line, with the attenuator set at −1dB. But notice that above about 2.2GHz, the higher attenuation plots (−20dB and greater) develop a small number of minor bumps and dips. These are very apparent in the −30dB plot, for example, and also in the blue −31dB plot just below it. I suspect that many of these minor variations are due to small resonances inside the HMC472 chip and its surrounding tracks on the attenuator PCB. There might also be standing waves inside the attenuator box at specific frequencies. These plots reveal that the attenuator’s performance relative to its insertion loss is quite respectable, at least for frequencies up to about 1.5GHz and settings up to around −20dB. But the errors increase above 1.5GHz and with levels above −20dB. This attenuator would still have many practical uses above 1.5GHz and settings over −20dB, either if the exact amount of attenuation at a given frequency is not critical, or if you use the plots of Fig.3 to correct for the errors. The middle blue plot in Fig.3, for a setting of −18dB, was to see if setting the attenuator to −18dB would give an actual attenuation of −20dB over as much of the frequency range as possible. This worked for frequencies around 39 The side view of the attenuator module shows the control switches, and the very tight spacing between the RF and USB power connectors on the right. This photo is shown at approximately 150% scale for clarity. 880MHz and 3.8GHz, but the overall shape of the plot was unchanged and still gave significant deviations both less than and greater than the desired −20dB figure. Conclusions Overall, this new attenuator module is reasonably good value for money. It is suitable for a fairly wide range of applications, especially if you use the curves of Fig.3 to correct for the inevitable attenuation errors. But it does have a few shortcomings. For example, the module might not be controllable from a PC, Arduino or Micromite. Another is that the RF output SMA connector and the mini USB power connector are too close together, so you have to unplug the USB cable to connect or disconnect an SMA cable to the RF output just below it. You also have to adjust the SMA connector’s outer hex sleeve so that a flat is uppermost; otherwise, you won’t be able to reconnect the USB cable. Before I finished writing this review, I went onto the Banggood website to check on the price of this module. I was surprised to see that a larger and apparently better module had become available (ID 1648810; https://bit.ly/ pe-oct22-att). This newer attenuator module is advertised as having a frequency range of LF to 6GHz, an attenuation range of 0-31.75dB in steps of 0.25dB and an insertion loss of less than 1.5dB (but with the qualification that ‘it will be a little larger’ at the high-frequency end). Currently, they are advertising it for around £25, plus postage to the UK. So it costs nearly double that of the module I’ve reviewed here, but it might turn out to be worth it. I suspect it is based on the Analog Devices HMC1119, which has a range of 100MHz to 6.0GHz, seven control bits to give a setting range from 0 to 31.75dB in 0.25dB steps and a specified insertion loss of 1.3dB at 2.0GHz. I am planning to order one of these and write it up when it arrives. Reproduced by arrangement with SILICON CHIP magazine 2022. www.siliconchip.com.au www.poscope.com/epe - USB - Ethernet - Web server - Modbus - CNC (Mach3/4) - IO - PWM - Encoders - LCD - Analog inputs - Compact PLC - up to 256 - up to 32 microsteps microsteps - 50 V / 6 A - 30 V / 2.5 A - USB configuration - Isolated PoScope Mega1+ PoScope Mega50 Fig.3: following on from Fig.2, this is the combined plot of testing the module at various attenuation settings from 0dB to −30dB in 5dB steps, and then three extra tests at −1dB, −18dB and −31dB. 40 - up to 50MS/s - resolution up to 12bit - Lowest power consumption - Smallest and lightest - 7 in 1: Oscilloscope, FFT, X/Y, Recorder, Logic Analyzer, Protocol decoder, Signal generator Practical Electronics | October | 2022