Author Topic: PCM to I2S audio and vice versa  (Read 4561 times)

0 Members and 1 Guest are viewing this topic.

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
PCM to I2S audio and vice versa
« on: May 06, 2019, 03:29:56 pm »
Hi

I have some SIM (Simcom) modules(various models) with PCM audio input and output (short sync pulse mode), and on the other side I have a ESP32 module with I2S ports.
I'm trying to connect the two without making it too complicated. I though about using the SPI in slave mode, but the short sync pulse can't be used as the CS signal, so that wont work.
Also I don't think the transmit side clock/data polarity would be correct.
All I can think about is putting in a little CPLD/FPGA to reformat the data, but that sounds as a bit of an overkill, and a MCU won't cut it since the data is too fast to bitbang.
I could do it in TTL, but at that point the logic would be so complex I might as well do it with a FPGA...
I found that there is a TI audio system IC in BGA, but that's too big and too complex for what I need here.

Does anyone have an idea for a simpler workaround?
 

Offline OwO

  • Super Contributor
  • ***
  • Posts: 1250
  • Country: cn
  • RF Engineer.
Re: PCM to I2S audio and vice versa
« Reply #1 on: May 06, 2019, 03:44:09 pm »
Post a timing diagram of said "PCM audio interface"? As long as it has a clock signal at the same rate as the data then the I2S peripheral can be used.
Email: OwOwOwOwO123@outlook.com
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: PCM to I2S audio and vice versa
« Reply #2 on: May 07, 2019, 08:32:34 am »
PCM:


I2S:


As you can see the PCM format has a frame sync pulse, then goes the data. In the case of the SIM module, it sends only one word of audio, with the rest being a long sequence of zeroes, while in I2S there is the WSL/LCK line going high and low depending on the channel selected.
 

Offline DajgoroTopic starter

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: hr
    • hackaday.io
Re: PCM to I2S audio and vice versa
« Reply #3 on: May 07, 2019, 02:21:52 pm »
Run i2s in 32 bit mode, discard "right" channel, then split true left and right channels from upper word and lower word from "left" channel.
How?
I don't have the WSL signal do frame the words/channels, besides there are 128 bits in each frame as it is now.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: PCM to I2S audio and vice versa
« Reply #4 on: May 07, 2019, 02:36:03 pm »
Does anyone have an idea for a simpler workaround?

One of possible workarounds: use LM49370 as PCM-I2S bridge. Appnote: http://www.ti.com/lit/an/snaa039a/snaa039a.pdf

That's *after* manufacturer confirmation that they do not offer solution for I2S audio.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf