Digital Control of Attenuation – Repository for DIY

Member
Joined 2017
I’m starting this thread in the Pass Labs sub-forum, because I think there is a need for this information here, and because the idea for a digital attenuator came while building the excellent Iron Pre by Zen Mod.

There seems to be interest in a repository for free information pertaining to digital attenuation systems, in particular the Muses family of chips: 72320 and 72323.

Over the years, there have been a number of attenuators available using the Muses products. Some are commercial, but most were developed in-house by DIYers. Therefore, there is likely to exist quite a lot of knowledge in the community about implementing Muses chips.

If it weren't for generous people like Nelson Pass, Wayne Colburn, Zen Mod, Mark Johnson, XRK, 6L6, AKSA, Salas, and many others, our DIY efforts would have looked very different. And since this forum is called diyAudio, we should embrace the culture of sharing. So, in the spirit of DIY, I encourage everyone who can contribute, to share information about digital attenuation, no matter how small.

In this thread we can collaborate and share information for building our own Muses attenuators. Feel free to share your microcontroller code, libraries, schematics, tips, experiences, etc. as well as questions.

I’ll kick off by listing an Arduino library for the Muses72320 by Christoffer Hjalmarsson: github.com/qhris/Muses72320

Muses72320 datasheet
Muses72323 datasheet

Arduino libraries & code (generously supplied by @Nikon1975) - added 23 Sep 2023
Muses72320 Library
Muses72323 Library
Arduino code (full preamp code, including Muses72323) - added 26 Sep 2023
Arduino code for Muses72323 (Muses72323 code only. It compiles, but not tested)
Muses 72323 library for calculating the 16-bit address by @d00dz1
(Also see this thread for more information)

ESP32 code
Muses72320 on ESP

Library for Muses72323 using Soft-SPI as well as Hard-SPI by jpk73 - added 4 May 2024


MUSES72320.jpg


SSOP32 adapter board. Mouser# 854-AB-SOIC32/SSOP
SSOP32_Breakout_board_500.png
 

Attachments

  • Muses72320.zip
    5.6 KB · Views: 125
  • Muses72323.zip
    6.1 KB · Views: 121
  • Code_for_Muses72323_only.zip
    1.4 KB · Views: 221
  • Pre_Amplifier.zip
    4.4 KB · Views: 243
  • Muses72320_on_ESP.zip
    2 KB · Views: 201
Last edited:
  • Like
Reactions: 6 users
Member
Joined 2017
Wow, very neat build. Well done!

It's great to hear that the Meldano boards are working well. Is there some kind of display to show the volume?

If it's still available, the Meldano attenuators are certainly good options for Europeans. It's a bit out of the way for me and therefore, difficult and costly to import. Well, in my case, most countries are difficult to get stuff from. That's one of the reasons I'm into DIY. But I have to admit that I love it.

Dank je wel. (I have fond memories of visiting Bokrijk)
 
Last edited:
Member
Joined 2003
Thanks
To make it clear, I designed my own PCB’s, based on Meldano’s circuit. But, I purchased the microcontroller from him.
 
  • Like
Reactions: 1 user
Member
Joined 2017
That's great, I missed that part. Congratulations. I hope you're willing to share some information. Which microcontroller? There are so many questions...

I've looked at the Meldano circuits and it's one of the most logical ones I've seen so far.
 
Member
Joined 2017
If anyone has working Arduino code for any of the the Muses chips, please feel free to share it here.

Code for any other MCU is welcome too.
 
  • Like
Reactions: 1 user
Member
Joined 2017
I'm going to
Which microcontroller?

I've since noticed (in the PDF) that @meldano uses STM32 MCUs. That's interesting. The added power, speed and memory of Cortex and similar processors makes it possible to drive decent displays.

There is a lot to be said for Arduino, but it's unfortunately not powerful enough to drive anything but the most basic displays, hence the crude fonts.

The system that I'm busy working on uses an ESP32 together with a TFT LCD screen. The ESP32 has enough memory and speed to use any TrueType font and display nice, smooth characters. I would take a font file from my Windows computer and convert it into a format that can be used with the display. Easy. I can document the process if anyone wants to know how to do it.
 
Last edited:
  • Like
Reactions: 3 users
Member
Joined 2017
If it weren't for generous people like Nelson Pass, Wayne Colburn, Zen Mod, Mark Johnson, XRK, 6L6, AKSA, Salas, and many others, our DIY efforts would have looked very different. And since this forum is called diyAudio, we should embrace the culture of sharing. So, in the spirit of DIY, I encourage everyone who can contribute, to share information about digital attenuation, no matter how small.

Hopefully in time, there will be enough information here to enable anyone with a basic knowledge of development boards (microprocessors), like Arduino, Teensy, ESP32, etc. to build and program their own digital attenuator - and to their own taste. Whether that includes a nice display or not. The beauty of doing it yourself is that you're in control (pun intended) and can make the attenuator as basic or as feature-rich as you want.

Note: From time to time, I'll update post #1 with information and links to important information. So, check back often.
 
Member
Joined 2017
The Muses chips are really tiny with only 0.65mm pin spacing and it's SMD, not through-hole. This undoubtedly discourages probably most people from experimenting and making boards for the Muses. One needs to be sure that your circuit works before committing a design to a fab house, and the surest way is to build the circuit on breadboard first.

There is a way around that hurdle, in the form of an adapter board. Mouser# 854-AB-SOIC32/SSOP

Here is my Muses72032 chip soldered to such an adapter board, ready to be plugged into a breadboard.

ssop32_breakout_board_500-png.1225277
 
Last edited:
Member
Joined 2021
This one is linear analog pot digitaly controled, uses I2C & one gpio, have 8 steps but can be redesigned to 256 step log pot : )
u19 is to keep status of the pot until mcu is alive, and also to prevent clicks and pops, in our case I'm used u19 for that thing in lin pot project but can be removed in log pot configuration. Vertical mount pcb.
 

Attachments

  • 8_step.jpg
    8_step.jpg
    245.3 KB · Views: 350
  • 2023-10-19_171740.jpg
    2023-10-19_171740.jpg
    76.7 KB · Views: 337
Last edited:
Member
Joined 2017
Interesting. Would the 256 step version need a relay for each resistor x 2 for stereo?

Talking about I2C, it would have been so much easier if Muses used that instead of SPI.
 
Member
Joined 2021
Pcb above is mono version, earlier I have not used any relay, used only MAX ic but I was not satisfied with sound 100%, later figured out in d.s. that MAX have 90db thd and decided to add relays. For 256 step (see link in earlier post) you need only 8 relays, speaking about mono configuration. Pcb is small 50x30, verticaly mounted use small area, that's my next project : ) Max ic can be replaced with an stm8 3x3mm programed in i2c slave mode with programed logic for 256 steps for example... I'm expecting good sound using this type of analog attenuator in my revised project! Concretly I have configured it as a lin pot for tone control, 8 steps is good enought for me for tone control. I am thinked to use ts5a or some even better but definitelly the good pot must be fully analog for best result so relays and resistors in my opinion is the best for this type of pot.
 
Last edited:
  • Thank You
Reactions: 1 user
Official Court Jester
Joined 2003
Paid Member
2^(relay's number)=steps

so, 2^6=64 steps

2&7=128

etc.

everything explained on page linked by savan

for SE iteration, regular two section relays are good for 2 channels

meaning - 6 relays covering stereo 64 step attenuator
 
Member
Joined 2011
I think you should change the thread title to avoid misunderstanding.
Digital control of attenuation.
The thread content is not about ADC - attenuation in the digital domain - DAC.
 
Official Court Jester
Joined 2003
Paid Member
But would not allow for balance control. Like a dual-gang pot.

one relay group covers 2 phases or two channels

if bal, you need to double number of relays

how you're to control 2 groups and make balance control - if you're able to make code for simplest, adding function or two is trivial

anyhow- decide - is this MUSE thread, or whatever as long it works proper?
 
Top