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.

AM5728: Enabling McASP2 Without Codec

Part Number: AM5728

Hello, 

I'm using the TI SDK 6.02.00.81 with an evaluation board trying to get mcasp2 up and running without using a codec. Basically, I'm just interested in sending i2s data across the mcasp2 lines. 

I've made the following changes: 

U-boot snippet changes:

{MCASP2_ACLKX, (M0 | PIN_INPUT_PULLDOWN)},
{MCASP2_FSX, (M0 | PIN_INPUT_SLEW)},
{MCASP2_FSR, (M0 | PIN_INPUT_SLEW)},	
{MCASP2_AXR0, (M0 | PIN_INPUT_SLEW)},	
{MCASP2_AXR1, (M0 | PIN_INPUT_SLEW)},	
{MCASP2_ACLKR, (M0 | PIN_INPUT_PULLUP)},

I edited my u-boot uEnv.txt to select the am57xx-beagle-x15-common.dtb device tree to use. 

Device Tree Modifications to am57xx-beagle-x15-common.dtsi:

&mcasp2 {
	#sound-dai-cells = <0>;
	assigned-clocks = <&l4per_clkctrl DRA7_MCASP2_CLKCTRL 24>;
	assigned-clock-parents = <&sys_clkin2>;
	status = "okay";

	op-mode = <0>;	/* MCASP_IIS_MODE */
	tdm-slots = <2>;
	/* 16 serializers */
	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
		1 2 0 0 
		0 0 0 0 
		0 0 0 0 
		0 0 0 0
	>;
	tx-num-evt = <32>;
	rx-num-evt = <32>;
};

And for a basic test, I've changed the original sound0 node to use mcasp2 instead of mcasp3: 

sound0: sound0 {
		compatible = "simple-audio-card";
		simple-audio-card,name = "TW";
		simple-audio-card,widgets =
			"Line", "Line Out",
			"Line", "Line In";
		simple-audio-card,routing =
			"Line Out",	"LLOUT",
			"Line Out",	"RLOUT",
			"MIC2L",	"Line In",
			"MIC2R",	"Line In";
		simple-audio-card,format = "dsp_b";
		simple-audio-card,bitclock-master = <&sound0_master>;
		simple-audio-card,frame-master = <&sound0_master>;
		simple-audio-card,bitclock-inversion;

		simple-audio-card,cpu {
			sound-dai = <&mcasp2>;
		};

		sound0_master: simple-audio-card,codec {
			sound-dai = <&tlv320aic3104>;
			clocks = <&clkout2_clk>;
		};
	};

The board boots up fine, and I've loaded a basic .wav file to playback. However, I don't see any activity coming out of mcasp2. As a sanity check, if I change back to mcasp3 for the sound0 node, I do hear sound coming out from the audio jack. What could be the reason I don't see any activity happening on the mcasp2 after making my changes? 

  • David, 

    could you confirm how do you verify McASP2 activity when you mentioned:

       "I don't see any activity coming out of mcasp2"

    I have not checked the EVM schematics, but I assume you will need to scope to see the data on the lines?

    regards

    jian

  • Hello Jian, 

    I've brought out the McASP2 lines from the AM5728 dev board by soldering some wires to P17 connector.

    Since then, I have been successfully able to record and play audio stream to the following two breakout boards bought from adafruit: 

    1. Adafruit I2S MEMS Microphone Breakout - SPH0645LM4H
    2. Adafruit I2S Stereo Decoder - UDA1334A Breakout

    The device tree modifications I've made to am57xx-beagle-x15-common.dtsi

    sound0: sound0 {
    		compatible = "simple-audio-card";
    		simple-audio-card,name = "Trellisware";
    		simple-audio-card,format = "i2s";
    		simple-audio-card,bitclock-master = <&sound0_master>;
    		simple-audio-card,frame-master = <&sound0_master>;
    
    		sound0_master: simple-audio-card,cpu {
    			sound-dai = <&mcasp2>;
    			clocks = <&clkout2_clk>;
    		};
    
    		simple-audio-card,codec {
    			clocks = <&clkout2_clk>;
    			sound-dai = <&tlv320aic3104>;
    		};
    	};
    
    &mcasp2 {
    	#sound-dai-cells = <0>;
    	assigned-clocks = <&l4per_clkctrl DRA7_MCASP2_CLKCTRL 24>;
    	assigned-clock-parents = <&sys_clkin2>;
    	status = "okay";
    
    	op-mode = <0>;	/* MCASP_IIS_MODE */
    	tdm-slots = <2>;
    	/* 16 serializers */
    	serial-dir = <	/* 0: INACTIVE, 1: TX, 2: RX */
    		1 2 0 0 
    		0 0 0 0 
    		0 0 0 0 
    		0 0 0 0
    	>;
    	tx-num-evt = <32>;
    	rx-num-evt = <32>;
    };

    From experimentation, it seems McASP2 is operating in sync mode where the TX ACLKX and AFSX signal lines also act as the RX clk and frame sync.

    Is there a way to separate them out so that the RX CLK and frame sync are independent of TX?