The WM8960 Audio Board, manufactured by Waveshare, is a high-performance audio codec designed for portable and multimedia applications. It features low-power stereo audio processing capabilities, supporting high-quality audio playback and recording. The board integrates advanced features such as digital signal processing (DSP), integrated amplifiers, and multiple input/output options, making it ideal for use in devices like smartphones, tablets, and other audio-centric systems.
The WM8960 Audio Board has a set of pins for power, control, and audio data communication. Below is the pin configuration:
Pin Name | Type | Description |
---|---|---|
VCC | Power Input | Power supply input (3.3V recommended). |
GND | Ground | Ground connection. |
SCL | I2C Clock | I2C clock line for control communication. |
SDA | I2C Data | I2C data line for control communication. |
BCLK | Audio Clock | Bit clock for I2S/PCM audio data communication. |
LRCLK | Audio Clock | Left/Right clock for I2S/PCM audio data communication. |
DIN | Data Input | Audio data input for I2S/PCM communication. |
DOUT | Data Output | Audio data output for I2S/PCM communication. |
MIC_IN | Analog Input | Microphone input with biasing support. |
HP_OUT_L | Analog Output | Left channel headphone output. |
HP_OUT_R | Analog Output | Right channel headphone output. |
SPK_OUT_L | Analog Output | Left channel speaker output. |
SPK_OUT_R | Analog Output | Right channel speaker output. |
0x1A
. Ensure no address conflicts if multiple I2C devices are connected.The Arduino UNO does not natively support I2S communication. However, you can use an external I2S module or switch to a microcontroller like the ESP32, which has built-in I2S support. Below is an example code snippet for configuring the WM8960 using I2C:
#include <Wire.h> // Include the I2C library
#define WM8960_I2C_ADDR 0x1A // Default I2C address of WM8960
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Initialize serial communication for debugging
// Configure WM8960 registers
configureWM8960();
}
void loop() {
// Main loop does nothing in this example
}
void configureWM8960() {
// Example: Set the WM8960 to power up and enable DAC
writeWM8960Register(0x0F, 0x000); // Reset the device
writeWM8960Register(0x19, 0x1F0); // Enable DAC and headphone output
writeWM8960Register(0x1A, 0x1F0); // Enable speaker output
Serial.println("WM8960 configured successfully!");
}
void writeWM8960Register(uint8_t reg, uint16_t value) {
Wire.beginTransmission(WM8960_I2C_ADDR);
Wire.write((reg << 1) | ((value >> 8) & 0x01)); // Send register address
Wire.write(value & 0xFF); // Send register value
Wire.endTransmission();
}
No Audio Output:
Distorted Audio:
I2C Communication Failure:
0x1A
) matches the device configuration. Can the WM8960 work with 5V microcontrollers?
No, the WM8960 operates at 3.3V. Use a level shifter if interfacing with a 5V microcontroller.
What is the maximum sampling rate supported?
The WM8960 supports sampling rates up to 48 kHz.
Can I use the WM8960 with Raspberry Pi?
Yes, the WM8960 is compatible with Raspberry Pi via the I2C and I2S interfaces. Use appropriate drivers or libraries for configuration.
Does the WM8960 support stereo recording?
Yes, the WM8960 supports stereo recording through its ADC and microphone input.