Hello.
Have anyone experience, or knowledge, to tell if it should be easy to interface a 4 wire (clock, sync, Tx, Rx) PCM to AM335x? The device which I have in mind has both clock and sync output.
Br Peter
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.
Hello.
Have anyone experience, or knowledge, to tell if it should be easy to interface a 4 wire (clock, sync, Tx, Rx) PCM to AM335x? The device which I have in mind has both clock and sync output.
Br Peter
The McASP module in AM335x supports 2 - 32 TDM channels that can be used to transfer PCM data. There should not be any issue with connecting the device you described. Please refer to the McASP section of the TRM for more details.
Regards,
Paul
HI Paul,
I am trying to directly interface an AM335X processor to a cellular module with a digital audio PCM interface. Is the process to call the ALSA PCM libraries like
What hardware pins would I use? Ideally, I'd like to first test using a stock Beagle Bone Black running Debian/Ubuntu and the modem EVM board before a custom build. Would the hardware need to be configured by a device tree overlay? Any examples of how this might be done?
I've found the McASP documentation rather detailed so something practical would be extremely useful.
Best Regards
Evan
You can find detailed instructions on how to interface an audio device (like the one you are using) to the McASP in linux at the Sitara Linux Audio Page. I recommend reading all the of the sections in the Overview if you are not experienced with audio in linux. After that, look at the Porting Section, specifically the Audio DAC Example; it will guide you through the complete process of connecting an audio device to McASP.
So I have been digging into this a little deeper using the AM335X starter board as an example
Here the WLAN/BT module (LBEE5ZSTNC-523) has a 4 pin interface to the processor MCASP0 where ACLKXX = MCLK, AXR0 = DOUT, AXR1 = DIN and FXS = WCLK (page 8 of the schematic).
Where I am now getting lost is finding where the processor is configured in the device tree overlays to talk to this module. I've looked at the TI SDK inside arch/arm/boot/dts/am335x-evmsk.dts but can't find anything obvious in there, am I looking in the right place?
One thing you might want to review is that ACLK is equivalent to the Bit Clock (BCLK), and AHCLK is equivalent to the Master Clock (MCLK), which is the clock source from which BCLK and WCLK are derived. This diagram gives a simple example.
As far as how to configure the processor side (McASP), it has to be done in both in the DTS and the davinci-evm.c in the ALSA SoC source. This page has a short overview. Also, this section of the Audio DAC guide gives an example of how to set up the McASP for a new device, with respect to davinci-evm.c and the dts.
Btw, here's a link for the am335x-evmsk dts that at which I'm looking. The "sound", "mcasp1", and "tlv320aic3106: tlv320aic3106@1b" entries are the ones that are used to set up mcasp -> aic3106, as well as the relevant pinmuxing blocks.
I should add that I have looked here: www.kernel.org/.../davinci-mcasp-audio.txt but trying to understand that. For example, I don't get what the serial-dir list is actually referring to, or why I would set tx-num-evt to a particular value.
Is the serial-dir related to the pin mix?
mcasp1_pins: mcasp1_pins {
pinctrl-single,pins = <
0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */
0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */
0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */
0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */
>;
};
Since this has been defined then we have 4 possible pins, and pin 3 is TX and pin 4 is rx?
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
0 0 1 2
>;
The serial-dir is seperate from the pinmux--it controls whether the McASP will use a specific serial line (AXRn) as an input or an output.
Evan Davey said:Since this has been defined then we have 4 possible pins, and pin 3 is TX and pin 4 is rx?
Yup, that's correct.
Evan Davey said:I assume tdm-slots = 2 means two channels i.e. left and right for stereo?
Yup.
Evan Davey said:or what tx[rx]-num-evt mean.
Here's some info: http://processors.wiki.ti.com/index.php/Linux_Core_Audio_User%27s_Guide#If_there.27s_an_issue
As far as the audio routing, unfortunately I am not too knowledgeable about that, so there's not much help I can offer.
No problem at all. Let me know if you have any other questions and I'll do my best to help. I have been wanting to look into the dapm audio routing stuff, so if I get some time I'll dig into and let you know anything valuable I learn.