Parts: DS1801 SPI audio volume potentiometer

posted Mar 16th 2009 8:30am by Ian
filed under: digital audio hacks, parts

ds1801

Dallas/Maxim’s DS1801 is an audio volume potentiometer with a simple SPI interface. This chip has two channels of volume control that might be useful in a DIY audio project. We previously looked at the DS1807, a similar part with an I2C interface. This week we’ll show you how to use the SPI version.

DS1801 SPI digital audio volume potentiometer (Digikey search, Octopart search, $6.50). Datasheet (PDF).

Bus Pirate DS1801 (pin #)
GND GND (1)
AUX RST (3)
GND ZCEN (4)
GND AGND (11)
MOSI D (12)
Clock CLK (13)
+3.3volts VCC (14)

We connected the DS1801 to our Bus Pirate universal serial interface tool as shown in the table. We used the Bus Pirate to demonstrate this chip, but the same basic procedures apply to any microcontroller. The DS1801 power requirements are flexible, it works at either 3.3volts or 5volts, we used a 3.3volt supply.

The DS1801 has an SPI interface. The data output pin can be used to cascade multiple DS1801s. We used the Bus Pirate’s SPI mode with default options to interface this chip.

1801-spi

The DS1801 SPI protocol is described in figure (a) on page 4 of the datasheet (shown above). Note that the SPI enable signal, called RST on the DS1801, is actually opposite standard notation. Data input is active when RST is high, and inactive when it’s low.

Each DS1801 has two audio potentiometers with 64 steps of volume control. 0 is full volume, 63 is the lowest volume, position 64 is mute. Setting the volume is really simple; just raise the RST signal, clock in the volume level for each potentiometer, and lower RST to enact the new settings.

SPI>A 64 64 a
AUX HIGH <–RST pin high
WRITE: 0×40 <–mute setting channel 0
WRITE: 0×40 <–mute setting channel 1
AUX LOW <–RST pin low
SPI>

Here, we set both potentiometers to mute (64). First, raise the RST pin to 3.3volts (capital ‘A’, silly CSS). Next, write the mute setting for each (64 64). Finally, lower the RST pin to enact the new settings (small ‘a’).

SPI>A 0 0 a
AUX HIGH
WRITE: 0×00
WRITE: 0×00
AUX LOW
SPI>

Now we change both potentiometers to full volume by writing a 0 to each. The sets a resistance level of 0, or 100% of the input volume.

SPI>A 0 64 a
AUX HIGH
WRITE: 0×00
WRITE: 0×40
AUX LOW
SPI>

Finally, we set a different volume levels on each potentiometer. Pot 0 is at full volume (0), pot 1 is muted (64).

Like this post? Check out the parts posts you may have missed. Want to request a part post? Please leave your suggestions in the comments.

Recent Posts



Reader Comments

Leave a Reply

Hack a Day serves up fresh hacks each day, every day from around the web and a special How-To hack each week.

Send us your hacks











Hacks

Resources

RSS newsfeeds

Powered by WordPress

Most commented on (30 days)

Recent comments