Microchip® Advanced Software Framework

Quick start guide for the SAM WM8731 module

This is the quick start guide for the WM8731 Audio Codec, with step-by-step instructions on how to configure and use the driver in a selection of use cases.

The use cases contain several code fragments. The code fragments in the steps for setup can be copied into a custom initialization function, while the steps for usage can be copied into, e.g., the main application function.

WM8731 use cases

Basic use case - Configurate the WM8731 to

DAC mode In this use case, the WM8731 module is configured to DAC mode with I2S audio interface.

Setup

Prerequisites

  1. General Purpose I/O Management (gpio)

Code

The following function needs to be added to the user application, to configurate the TWI interface.

static void init_twi_wm8731(void)
{
opt.speed = TWI_WM8731_CLK;
}

Workflow

  1. reset the WM8731:
  2. Select the WM8731 DAC:
  3. Set the WM8731 to usb mode and 48K DAC:
  4. Set the WM8731 audio interface to I2S mode:
  5. Set the WM8731 audio data bit length to 16bit:
  6. Disable the WM8731 DAC soft mute:
  7. Power up the WM8731 DAC:
  8. Active the WM8731: