Roadrunner technical documentation Buy on-line

Class D amplifier on RoadRunner SOM

This article illustrates how to enable the Class D amplifier integrated inside the SAMA5D27 and how to use it on Linux

The Audio Class D Amplifier (CLASSD) is a digital input, Pulse Width Modulated (PWM) output stereo Class D amplifier. It features a high-quality interpolation filter embedding a digitally-controlled gain, an equalizer and a deemphasis filter.

Embedded Characteristics

  • PWM Class D Amplifier
  • 16-bit Audio Data
  • DSP Clocks: 12.288 and 11.2896 MHz
  • Input Sampling Rates: 8, 16, 32, 48, 96, 22.05, 44.1, 88.2 kHz
  • 3-band Equalizer
  • De-emphasis Filter
  • Digital Volume Control
  • Differential or Single-ended Outputs
  • Non-overlapping Circuit to Control External MOSFETs
  • Supports DMA

Kernel setup

To enable the Class D driver laubch the kernel menuconfig (read how...) and enable these drivers:

Device Drivers > 
    Sound card support > 
        Advanced Linux Sound Architecture > 
            ALSA for SoC audio support 
                <*>   SoC Audio for the Atmel System-on-Chip
                <*>     Atmel ASoC driver for boards using CLASSD

Device tree bindings

Definition to insert inside the apb section:

classd: classd@fc048000 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_classd_default>;
    /*atmel,pwm-type = "diff";*/
    atmel,pwm-type = "single";
    atmel,non-overlap-time = <0>;
    status = "okay";
};

Definition to insert inside the pinctrl@fc038000 section if you are using the MMC1 bus to wire the MicroSD. In this case it is possible to use just the right channel:

pinctrl_classd_default: classd_default {
    pinmux = <PIN_PB1__CLASSD_R0>,
         <PIN_PB2__CLASSD_R1>,
         <PIN_PB3__CLASSD_R2>,
         <PIN_PB4__CLASSD_R3>;
    bias-pull-up;
};

Definition to insert inside the pinctrl@fc038000 section if you are using the MMC0 bus to wire the MicroSD. In this case is possible to use both channels:

pinctrl_classd_default: classd_default {
    pinmux = <PIN_PB1__CLASSD_R0>,
         <PIN_PB2__CLASSD_R1>,
         <PIN_PB3__CLASSD_R2>,
         <PIN_PB4__CLASSD_R3>,
         <PIN_PA28__CLASSD_L0>,
         <PIN_PA29__CLASSD_L1>,
         <PIN_PA30__CLASSD_L2>,
         <PIN_PA31__CLASSD_L3>;
    bias-pull-up;
};

Hardware

To know how to implements the hardware interfaces please read the Microchip Datasheet starting from page 1305:

This is the simpler solution available:

Test files

Links

Roadrunner technical documentation Buy on-line

Bruna Mandolino