This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCM3060: full-duplex, DAC works, ADC not

Part Number: PCM3060

hello, i tried to submit this months ago, when i registered my TI account, but i never got the activation email

today i tried one last time, and the activation email arrived immediately, so here i am

i've made a board with an ARM Cortex-M4F-based MCU and the PCM3060 audio codec

i need full-duplex, input (2 channels) and output (2 channels)

i also want the audio to be DC-coupled

the MCU is running at 3.3V, the PCM3060 i've tried my best to set it up as the datasheet recommends (5V and 3.3V)

the MCU generates the I2S signals (including clocks) and drives the audio codec, there is nothing else on the I2S

the MCU also controls the audio codec over SPI, there are no other SPI devices

i tried to get the audio output working first, since that was supposed to be easier and once that worked i could use it to test if the audio input is working by feeding the input data as output data in software

the audio output worked

the audio input, i could never get it to work - the CODEC_SDO (DOUT from the codec) is flat out 0V

mainMCUaudio codec

PCB

i'm using a 24.576MHz crystal, and then all the I2S clocks are derived from that via the MCU's I2S peripheral

trying to set the codec up for full-duplex slave operation, at Fs=96kHz

  • here's the code:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // pcm3060 header -------------------------------
    #include "as_bitfield.hpp"
    namespace pcm3060
    {
    template
    <
    typename T, // this should be an integer type
    size_t Offset,
    size_t Bits = 1,
    typename TV = T // this may be an enum
    >
    using BitField = asacmp::BitField<T, Offset, Bits, TV>;
    enum _fmt : uint8_t
    {
    // all formats are MSB-First, 2s complement (i think that means signed int)
    fmt_i2s_24bit = 0b00, // default, I2S 24bit (left-justified, one bit delay)
    fmt_lj_24bit = 0b01, // left-justified 24bit
    fmt_rj_24bit = 0b10, // right-justified 24bit
    fmt_rj_16bit = 0b11, // right-justified 16bit
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    and here's the serial output from the MCU:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ::: same54_audio :::
    Built: Sep 4 2021 15:45:00
    Initializing...
    USART bitrate: 115173
    ------
    audio codec reset
    r64: 81
    r65: 00
    r66: 00
    r67: 80
    r68: 40
    r69: 00
    r70: D7
    r71: D7
    r72: 80
    r73: 18
    audio codec configured
    setting up MIDI
    MIDI bitrate: 31250
    - Tests: 120083, 120738
    setting up I2S
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    the PCB was partially populated because there was no firmware for it yet, so when i wrote the initial SPI / PCM3060 code, i populated the PCM3060 and its related components

    after that i spent quite some time where i was writing and adjusting the I2S+DMA code, untill eventually i started getting the first sounds from the analog output

    eventually i got smooth, glitch-free audio output on both audio channels

    that's when looked into the audio input, and it just wasn't working, no matter what i tried

    then i thought, perhaps, since the DOUT is the only output signal from the PCM (all other signals are inputs), maybe i might have had some periods of time of unintended bad electrical configuration, like, my MCU's SDI pin (PinB10) might have been set to output and then the only thing in the middle would be the 33R resistor which is too low to prevent damage (i'd think)

    so i thought maybe while my firmware was "under construction" i might have fried the PCM3060's DOUT pin... so i desoldered R85 (the 33R resistor) and the PCM3060, then very carefully soldered a brand new PCM3060, and powered the thing on

    i was still getting flat 0V on the DOUT side of the (now missing) resistor

    since then i've actually still not soldered R85 back in

  • Hi,

    Can you take the following signals with a logic analyzer/scope showing the relevant clock and data?

    -. /RST, SCK1, LRCK1, BCK1 and DOUT

    You have checked there is an input on VINR and VINL - correct?

    Have you tried looping your working DAC analog output back into the VINL/R and check the DOUT?

    Regards.

  • not at the moment, no

    i could oscilloscope it in the coming days

    during the period where i was working on the I2S+DMA code, i scoped the I2S signals, and they looked right (on a 50MHz scope)

    - given that analog output on both channels was working glitch-free (i am generating/synthesizing the audio in software on the MCU), that means that the codec SPI initialization can't be completely wrong, and at least the framesync/bitclock/systemclock and DIN (on the codec) are working

    - DOUT (from the codec) is giving flat 0V as i already said, yes there's audio on the codec's analog input, but i think even a "noisy silence" would turn into some "1" bits on the DOUT, wouldn't it?

    right now i actually don't even have the analog output working.. no idea what happened.. this board just sat here gathering dust for the past months

    I2S_SDO (from the MCU) keeps working since i can hear the digital data bits (and can distinguish my software oscillator's pitch changing) when probing thru a resistor with a soundcard, but nothing comes out of the audio codec's analog outputs

    i think i have a 3rd chip but this doesn't feel right

    i was also websearching about PCM3060 before this, and i found a few different people reporting inability to get audio input working (they only got audio output working, like me), and these did not report a success at the end, which seems discouraging

  • Hi,

    Ya, let's start with the loopback once you have the DAC working again, at least we know all the clocks are correct.

    DOUT will be forced to ZERO in reset state, so might be good to check that as well.

    Regards.