Interfacing 2.048MHz master PCM with XE216 or similar?

New to XMOS and XCore? Get started here.
dpenev
Junior Member
Posts: 4
Joined: Mon Dec 14, 2020 2:43 pm

Interfacing 2.048MHz master PCM with XE216 or similar?

Post by dpenev »

Hello,

I am very new to xmos audio solution.
I have some limited experience with the XE216-512-TQ128 for motor control though

I need to interface a multichannel PCM audio bus (data_in, data_out, clock, frame) into an embedded i7 based PC
Now I consider a possibility to use a chip from xmos and I2S library.
I found out that it may be a typical application for XE216. Let me describe my constrains:

PCM/TDM bus:
clock = 2.048Mhz
I need one or maximum two 8 bit timeslots (up to two 8bit full duplex channels) for both directions.
The external audio codec provides the clock (so clock will be an input for the xmos chip)
Audio sample rate is 8KHz.

From the PC I have both USB2.0 and USB3.0 interfaces.
The PC will run a latest Linux.

I am wondering if xmos solution will be OK for me?
I tried to investigate more but I saw PCM slave is currently not supported by the I2S library.
Somewhere I saw someone said this can be fixed easily. Is this the case?
I tried to find in the XE216-512-TQ128 datasheet a section about a dedicated serial audio interface.
I wanted to make sure I can interface my custom PCM. I found nothing.
Is the I2S/PCM implemented using general purpose I/Os?

Before me digging in more details probably someone can comment if I am no the right track?

Thank you
Dimitar


User avatar
CousinItt
Respected Member
Posts: 275
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

Hi Demetar,

How are you planning to connect your device to the PC? Are you planning to use ethernet? Otherwise there's no particular reason to use the XE216 as opposed to an XL216. You mention USB, so perhaps an XU device would be more suitable.

The sample rate is quite low, so that shouldn't be a problem. I don't fully understand what you mean by 8-bit full duplex channels. Are you referring to 8-bit samples (which seems a bit small) or do you mean you mean eight parallel data lines?

Currently the I2S library only supports TDM master (I checked the latest version on xmos github). I don't think there would be any particular problems in producing a slave instead, but I've not tried this - I'm more familiar with I2S than TDM.

You're right about the general purpose I/O. Most of the I2S/TDM interfaces are implemented in software, but they rely on features provided to all general purpose ports on these devices: shift-registers and clock assignment in particular.
dpenev
Junior Member
Posts: 4
Joined: Mon Dec 14, 2020 2:43 pm

Post by dpenev »

Hi CousinItt,

Thank you for the answer.
Yes I plan to use USB so I will consider using XL216.
I have development KIT with XE216 and that's why I mentioned it.

Let me try to explain my PCM/TDM bus in more details.

I have 2.048MHz stable clock. It should be external input signal for the XL216.
I have my frame sync with frequency 8KHz and it is high 1/256 part of the period, so it is high one clock period
My system uses either 8bits or 16bits which are serially shifted just after the frame sync. I need to support those two modes.
8bit is indeed low but is ok for speech telephony. Same for the 8KHz sample rate.
During the rest of the time slots my interface does not care any useful data.
I have data_in and data_out line in my PCM bus, so audio data are going in the both directions.
My throughput is maximum of 16*8KHz = 128kbit/s

I need to use synchronous isochronous USB transfer from Linux PC.
I am new to USB so I guess I will have to learn.

Any thoughts on this subject are very welcome!
Dimitar
dpenev
Junior Member
Posts: 4
Joined: Mon Dec 14, 2020 2:43 pm

Post by dpenev »

Hi CousinItt,

Thank you for the explanation.
I have evaluation kit based on XE216 so that's why I said XE216. Indeed I don't need Ethernet so it will be XE216 on the product.

Let me try to explain in more details about our TDM bus
clock independent 2048KHz stable, it should be an external input for the XE216 IC
frame sync is 8Khz (as the speech sampling rate is 8KHz) and is high 1/256 part of the period (one clock period)
data_in, data_out pins- so we have data going in both directions serially starting after the frame_sync
The data in our application are 8bits or 16bits shifted serially using a single wire.
We have useful data only 1/16 of the whole frame (we use maximum one from the 16 16bit time slots available)
So basically our traffic is 16*8KHz = 128Kbit/s or 64Kbit/s if 8 bits data are used.

As far as I studied what I need from the PC side is an Isochronous transfer mode with asynchronous feedback
Both UAC 1 and UAC 2 should be supported by the Linux.
Can you confirm that your implementation is supporting this?
User avatar
CousinItt
Respected Member
Posts: 275
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

Hi Dimitar,

take a look at XU216 (or XUF) parts with built-in USB. If I understand your application correctly it should be trivial to implement the PCM/TDM side with an xmos device. If your device is receiving the frame sync pulse then you can synchronise with that and just clock in/out a single word. If your device is producing the frame sync then it's slightly more complicated but not much.

I don't know enough about USB to be able to say whether there might be any problems with your proposal, but the data rate is small and shouldn't be a problem.
dpenev
Junior Member
Posts: 4
Joined: Mon Dec 14, 2020 2:43 pm

Post by dpenev »

Hi CousinItt,

Both XU216 and XUF216 seems hardly available in Europe and North America quantity 100pc.
Where should I source it?
User avatar
CousinItt
Respected Member
Posts: 275
Joined: Wed May 31, 2017 6:55 pm

Post by CousinItt »

Try EPS Global
User avatar
mon2
XCore Legend
Posts: 1912
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

Came across the attached document. Perhaps the reason for the low inventory levels.


PCN-014218_xmos.pdf
You do not have the required permissions to view the files attached to this post.