CE016 - Interfacing to I2S Audio Codecs using dsPIC30F DCI module

by Microchip Technology

CE016 - Interfacing to I2S Audio Codecs using dsPIC30F DCI module

The dsPIC® Digital Signal Controllers feature a Data Converter Interface (DCI or Codec Interface) peripheral module on-chip. This module is useful to interface the dsPIC with high-resolution codecs, A/D and D/A converters that stream data into the dsPIC or out from the dsPIC device.

About this Code Example

The dsPIC® Digital Signal Controllers feature a Data Converter Interface (DCI or Codec Interface) peripheral module on-chip. This module is useful to interface the dsPIC with high-resolution codecs, A/D and D/A converters that stream data into the dsPIC or out from the dsPIC device.

The attached code example has 1 C source file - "DCI_master_24bit_I2S_codec_interface.c" . The code example in the DCI_master_24bit_I2S_codec_interface.c file contains functions to intialize the DCI peripheral as well as service the DCI interrupts. The DCI module is initialized for interfaceing to a 64*Fs I2S Codec. The DCI module is set up for Master mode of operation in which it provides the Frame Sync signal on the COFS pin, as well as the bit clock on the CSCK pin. The frame sync signal has a frequency of 48KHz, while the bit clock has a frequency of 64*48000=3MHz, as shown below:
                                  FIGURE 1
       _______________________________
      |                               |                               |
COFS: |                               |_______________________________|
       _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _   _
CSCK:_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_|
          |<--------Left Channel Data---->|<----Right Channel Data------->|
          |<---------32 bits------------->|<---------32 bits------------->|
          |<---TXBUF0---->|<----TXBUF1--->|<---TXBUF2---->|<----TXBUF3--->|
          |<---RXBUF0---->|<----RXBUF1--->|<---RXBUF2---->|<----RXBUF3--->|
          |<--TimeSlot0-->|<--TimeSlot1-->|<--TimeSlot0-->|<--TimeSlot1-->|
          |<--------------------1/Fs = 20.8 microseconds----------------->|

The code in the main function simply calls the initialization routine for the DCI module and then waits in a while(1) loop. From this point on the DCI interrupts transmit data out on the CSDO pin and read data in from the CSDI pin.
  • Current Version: 1.0.0
  • Updated: Aug 23, 2011
  • Downloads: 1718
  • Rating: 0/5 (0 votes cast)
  • Status: Beta
    • MPLAB Version: 8.00 or greater
    • C Compiler: C30 v3.30
    • Development Tools: dsPICDEM™ 1.1 Development Board dsPIC30F6014A Digital Signal Controller Plug-In Module
    • Supported Devices: dsPIC30F6014A

Reviews

  • There are no reviews for this Code Example.

    Write your review

    Release History

    CE016 - Interfacing to I2S Audio Codecs using dsPIC30F DCI module  (current version) August 22, 2011
    new release