Skip to content

I2S dacs config in Mozzi2 #248

@poetaster

Description

@poetaster

I had tested several with mozzi 1.x and had success with the PT8211 and the PCM5102 with mozzi. I hadn't tried the MAX9898357 yet, but it worked with pschatzmann's audio-tools.

Now, I've switched to Mozzi2 and I can't seem to get I2S working on the rp2040, pico. But, I'm probably just doing it wrong. The configuration has changed a lot, so I just tried to follow the PT8211 examble. I checked the Datasheet on the 5102 first: https://www.ti.com/lit/ds/symlink/pcm5102.pdf It states: the audio input interface format is left justified and Audio Data format, MSB First, 2’s Complement. I proceeded with:

#include "MozziConfigValues.h"  // for named option values
#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_I2S_DAC
#define MOZZI_AUDIO_CHANNELS MOZZI_STEREO
#define MOZZI_AUDIO_MODE MOZZI_OUTPUT_EXTERNAL_TIMED
// all of these are the defaults on RP2040 outputting on I2S, anyway, thus commented
#define MOZZI_AUDIO_BITS 16
#define MOZZI_I2S_PIN_BCK 20
#define MOZZI_I2S_PIN_WS (MOZZI_I2S_PIN_BCK+1) // CANNOT BE CHANGED, HAS TO BE NEXT TO pBCLK, i.e. default is 21
#define MOZZI_I2S_PIN_DATA 22
#define CONTROL_RATE 256 // Hz, powers of 2 are most reliable
#include <Mozzi.h>

My hardware designs for the rp2040 are all setup so that 20,21, 22 are free to be assigned this was (can alternately be used for sda/scl video and 22 for pwm).

This does not work. What I missing. Do I need to specify some combination of:

or

MOZZI_I2S_FORMAT_PLAIN

``` ??

I had tried LSBJ just for the hell of it, but wasn't certain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions