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.

RTOS/PROCESSOR-SDK-AM335X: Digital mic via I2S

Part Number: PROCESSOR-SDK-AM335X

Tool/software: TI-RTOS

Hi,

I am using RTOS-AM335X 03_02_00_05 with CCS v6.1.3

Digital mic used: ICS-43432

Objective: Connect the digital mic to iceV2AM335x via I2S communication.

What I have done so far:

1) Recreated the PDK project [ MCASP_DeviceLoopback_evmAM335x_armExampleProject ]

2) I added MCASP0 to iceV2AM335x with the pinmux tool, rebuild the library file, modified the CFG file: [ Board.Settings.boardName = "icev2AM335x" ]. Compile and run OK.

3) I connected the MCASP0 ACLKR, AFSR and AXR0 to logic analyzer, and see some signals (PICTURE1 below). Below are the terminal messages:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MCASP DEVICE Loopback test
==========================

EDMA driver initialization successful.
mcaspCreateChan for mcasp0 Rx Success
Initialization complete. priming about to begin
priming complete. rx ramp check to begin

Synch Found at Sample # 52, frame_no=0, ramp_rx_value = 1
Total 100 frames sent
Deleting Rx channel
Deleting Tx channel
UnBinding Mcasp
All tests have passed

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Q1) Is the PICTURE1 the expected result?

Q2) How do I modify from here (provided what I did so far is on the right track) to read signals from the external digital mic (the hardware is connected)? Are there any document/example that I can refer to?

Thank you.

YC

PICTURE1:

  • The RTOS team have been notified. They will respond here.
  • Hi,
    Any update?
    Any info to get me moving would be very helpful here.
    Thank you.

    YC
  • Hello YC
    I apologize for the delay. We have been out on the end of the year vacation.

    Regretfully there is not an example which exactly fits what you wish to do for the AM335x and one which is implemented on the AM335x ICE V2 board. It is possible to do this and there is some practical reference material, but it will take some time for you to create.
    TheAM335 loopback example is designed for the GP EVM. This is described in the Processor SDK release notes at
    processors.wiki.ti.com/.../Processor_SDK_RTOS_Release_Notes

    You may already be familiar with this but for completeness let me start from the beginning.

    It is possible to start with an AM335x ICE V2 based example to initialize the ICE board configuration, enable just the McASP Receive signals pinmux configuration for connection to the codec, enable the McASP and modify the example McASP audio configuration to enable the just the receive section .

    In the case of the ICE board – it will be necessary to configure the following pins from GPIO to McASP mode
    MCASP0_ACLKR (and not GPIO3-18) would be configured for B12
    MCASP0_FSR (and not GPIO3-19) would be configured for C13
    MCASP0_AXR1 (and not GPIO3-20) would be configured for D13

    The application will be a modification of the AM335x loopback example. As mentioned above - it will be necessary to configure and enable just the receive portion of the McASP (the loopback implements both transmit and receive)

    To assist in understanding the driver and example applications as outlined in processors.wiki.ti.com/.../Processor_SDK_RTOS_MCASP there is in C:\ti\pdk_am335x_1_0_5\packages\ti\drv\mcasp\docs the MCASP LLD Software Design Specification (SDS).
    C:\ti\pdk_am335x_1_0_5\packages\ti\drv\mcasp\docs\doxygen\html\index.html there is the API Reference Manual

    The AM335x McASP Technical reference manual has a section which describes the McASP operation and configuration parameters.
    www.ti.com/.../technicaldocuments

    There is also a MCASP_AAudio_evmAM437x_armExampleProject which demonstrates a connection to an audio codec on the AM437x GP EVM that will provide some additional insight.

    To help with the different syntax between the codec specification and the AM335 McASP descriptions :
    It looks like you will want to configure the receive section generate the bit and frame clocks to the microphone.(sometimes referred to as McASP operating in clock master mode)
    Internal generate AHCLKR from AUXCLK and output ACLKR and AFSR. AHCLKR does not need to be output.

    The format should be I2S two channels per frame (two slots) with a 32 bit clocks per channel. The data word size will be 24 bits .

    When finished the waveform for the WS (frame clock), bit clock, and data should look similar to what is shown on page 11 of ICS-43432-data-sheet-v1.3.pdf

    David
  • Hi David,

    First of, a very Happy New Year to you.

    Thank you for your info.

    Using the AM335x loopback example, I think I have managed to get the McASP0 up with I2S comm (see attached below). I have it configured as below:

    MCASP0_ACLKR for B12

    MCASP0_FSR for C13

    MCASP0_AXR0 for D12

    Modified: 

    #define RX_NUM_SERIALIZER (1u)
    #define TX_NUM_SERIALIZER (1u)

    Disabled the Loopback mode.

    I only have 1 ICS-43432, and I have the L/R pin tie to high, which means the valid data should be Channel 2; though I have no method to verify. Do you have any suggestion?

    In the function createStreams(), the software created channels for both TX and RX based on the Channel Parameters table. If I remarked the create channel for TX, and add only set ACLKXCTL ASYNC bit to 1 (so that the FSR can start clocking), I could not get anything on AXR0 (the line is always low). The software does not call mcaspAppCallback(). Why is this so? Is there any other setting? Or both TX and RX channel must be created?

    Thank you.

    YC

  • Hi YC

    The format looks better.

    Is your desired sample rate 2500 Hz. This is set in the AHCLKRCTL and ACLKRCTL registers. I use the Technical Reference Manual register definitions when verifying settings.

    Channel 1 looks possibly like audio data, although 2 samples can be deceiving.

    Channel 2 should be low. Perhaps termination could be used to set the level. The microphone data sheet recommends a pull down resistor termination on the data line of 10k to 100k ohms.

    You are correct. The application expects both the transmit and the receive to be defined.

    Audio_echo_Task which is instantiated in audiosample.cfg calls createstreams in audioSample_io.c  which creates the stream for the tranmit case and then for the receive case. If the transmit case fails then the receive case is not executed.  

    David