Dallas/Maxim’s DS1801 is an audio volume potentiometer with a basic SPI interface. This chip has two channels of volume manage that may be beneficial in a diy audio project. We previously looked at the DS1807, a similar part with an I2C interface. this week we’ll show you exactly how to utilize the SPI version.
DS1801 SPI digital audio volume potentiometer (Digikey search, Octopart search, $6.50). Datasheet (PDF).
Buspiraat
DS1801 (PIN #)
Gnd
GND (1)
Aux
RST (3)
Gnd
ZCEN (4)
Gnd
AGND (11)
Mosi
D (12)
Klok
CLK (13)
+3.3volts
VCC (14)
We linked the DS1801 to our Bus Pirate universal serial interface tool as shown in the table. We utilized the Bus Pirate to demonstrate this chip, however the exact same fundamental procedures apply to any type of microcontroller. The DS1801 power demands are flexible, it works at either 3.3volts or 5volts, we utilized a 3.3volt supply.
The DS1801 has an SPI interface. The data output pin can be utilized to cascade several DS1801s. We utilized the Bus Pirate’s SPI mode with default choices to interface this chip.
The DS1801 SPI protocol is explained in figure (a) on page 4 of the datasheet (shown above). note that the SPI allow signal, called RST on the DS1801, is really opposite common notation. data input is active when RST is high, as well as 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, setting 64 is mute. setting the volume is truly simple; just raise the RST signal, clock in the volume level for every potentiometer, as well as lower RST to enact the new settings.
SPI>A 64 64 a
AUX HIGH <–RST pin high
WRITE: 0x40 <–mute setting channel 0
WRITE: 0x40 <–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, compose the mute setting for every (64 64). Finally, lower the RST pin to enact the new settings (small ‘a’).
SPI>A 0 0 a
AUX HIGH
WRITE: 0x00
WRITE: 0x00
AUX LOW
SPI>
Now we modification both potentiometers to full volume by composing 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: 0x00
WRITE: 0x40
AUX LOW
SPI>
Finally, we set a different volume levels on each potentiometer. Pot 0 is at full volume (0), pot 1 is soft (64).
Like deze post? inspect out the parts articles you may have missed. Wilt u een onderdeelbericht aanvragen? Please leave your tips in the comments.