Communications choice

Technical questions regarding the XTC tools and programming with XMOS.
vector
Member
Posts: 11
Joined: Mon Mar 29, 2010 11:39 am

Communications choice

Post by vector »

I am looking for guidance on streaming data to an XC-1 board. It has a usb port so serial comms is an obvious choice but I am not really sure if the speed will be adequate. I need to stream up to 94,480 bytes of information in 1 second. This data will be stored across 2 cores as there is 64k per core. This size and speed is a maximum. I do not know enough about comms to decide the best way of doing it. I am using visual c# as a frontend which will stream the data to the XC-1. I am not looking for help with code, just some advice as to what is possible using usb or ethernet. When I use c# I am talking to the XC-1 as a com port so it is RS232 timings, ie up to 921600 baud. Whwn you consider that the start, stop and 8 data bits divide this down to 92,160 bytes per second it falls a little short. Am i correct in this assumption ?
Any help would be greatly appreciated.


User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm

Post by Berni »

Check the particular FTDI USB to UART chip. I think they only do 115K baud but you can get versions of the chip that can do 3Mbit and then connect one externally on the I/O ports.
vector
Member
Posts: 11
Joined: Mon Mar 29, 2010 11:39 am

Post by vector »

Thanks Berni,

The spec for the FTDI FT2232D chip on board the XC-1 says it can go up to 3M baud.
Not sure that is even achievable using the VCP route so will have to discount that option.
I do not really want to mess about adding hardware unless absolutely necessary as I am
trialling out some code which may well come to nothing. I have the XC-1 programming guide and it
states that it is 'easy' to run 100Mb ethernet using the standard ports. Is this the way forward without
involving hardware mods ? If so, without buying an XC-2 to play with, is it possible to wire the 8 port
connections directly to a header of the XC-1 and run a stripped down ethernet thread ? I have NO experience of communicating with ethernet in either XC or C# so is it something that can be undertaken with no experience. Any code examples or hints would be gratefully received.
User avatar
Berni
Respected Member
Posts: 363
Joined: Thu Dec 10, 2009 10:17 pm

Post by Berni »

You could of curse connect a ethernet PHY but to make it talk to a computer you need to also use a network protocol that might bottle neck your speed.

The simplest way of doing it is a FTDI UART since it takes like 20 lines of code to run a uart port inside a xmos chip. You can also use a FTDI to a parallel bus so that way you can clock trough 8bits at a time (But i guess the same 3Mbit limit is there too)
vector
Member
Posts: 11
Joined: Mon Mar 29, 2010 11:39 am

Post by vector »

I have been reading through the spec of the FT2232D chip on board the XC-1 and noticed the following :

Data transfer rate up to 1M Byte/second (Parallel FIFO)
USB 2.0 Full Speed (12M bits/second) compatible

I am not sure if the pins will be mapped to the xmos device to allow parallel mode. Is there any way of finding out ? The chip can be programmed through a DLL to allow mode change so I think the PC side will
be well documented.
It would be nice to increase the comms speed of this board for data logging etc.
I have included the spec link if anyone is interested.

http://www.ftdichip.com/Products/ICs/FT2232D.htm
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

I am not sure if the pins will be mapped to the xmos device to allow parallel mode. Is there any way of finding out ? ..
From memory I think that one port of the ftdi chip is used foir jtag to the xmos, the other port is configured as a UART. The remaining pins are not connected through to the Xmos chip so this idea would not work unless you added your own ftdi chip using the headers or prototyping area.

If you wish to go the Ethernet route it may be worth purchashing an XC-2 which has onbaord 100baseT Ethernet. You could then use a sockets library on windows and Ethernet+tcp/ip stack on the Xmos side using a simple crossover cable or over a network.

regards
Al
vector
Member
Posts: 11
Joined: Mon Mar 29, 2010 11:39 am

Post by vector »

Thanks for the reply. I want to avoid the expense of the
XC-2 if possible. I take it that the Ethernet protocol can
Be done in software on the xc-1. The xc-2 has it on chip ?
I would go with whatever is most reliable for streaming bytes
With the 1 mbyte/sec bandwidth. I would need to keep it simple
As my experience of these techniques is basic.
I may be interested in any freelancers who can help as
I have everything else working nicely except the
Comms.
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

Thanks for the reply. I want to avoid the expense of the
XC-2 if possible. I take it that the Ethernet protocol can
Be done in software on the xc-1. The xc-2 has it on chip ?
The Ethernet (Mac etc..) is mostly software but one has to add a PHY and the magnetics, which is what the XC-2 has. You could add the PHY + magnetics as a plugin board to the XC-1 but that would mean building a PCB ( also extending supply and a 25Mhz oscilator) you need 2 * 4 bit ports and 6 1bit ports although 3 of those could be on another core so its probably possible.
I would go with whatever is most reliable for streaming bytes
With the 1 mbyte/sec bandwidth. I would need to keep it simple
As my experience of these techniques is basic.
It should be possible over simple tcp/udp sockets but you would need someone to try it. Alternatively you could go down into the Ethernet layer and transfer directly perhaps on the back of more direct protocols Ethercat or the layers underneath AVB but you would need to talk to others that have more experience with these lower level Ethernet protocols etc..
I may be interested in any freelancers who can help as
I have everything else working nicely except the
Comms.
This will depend on what level you choose/need to work at, basically the lower level you go the fewer folk there are that understand it (more specialised).

One other alternatives is Xmos's USB implementation which can shift 50-60MBytes ovber a USB 2.0 High Speed link (Using a USB3318 PHY). This will give plenty of bandwidth and there are libraries for the Xmos side. The downside is you have to write a windows usb driver for your application and add the usb hardware.

regards
Al
vector
Member
Posts: 11
Joined: Mon Mar 29, 2010 11:39 am

Post by vector »

Thanks Al, the usb2 is interesting. How much
Hardware is required to implement it on the
Xmos ? I note on the ftdi site that they have
Chips that have windows drivers or dll's. Is this
The type of hardware you had in mind ?
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm

Post by Folknology »

I'm not an expert on the usb side but the Xmos usb 2.0 solution is based on adding an external USB3318 PHY chip. Internally the Xmos handles the UTMI/ULPI interface to the PHY (part built in hardware and part software). There is a library for using it on the Xmos side but I am not aware of what is available on the host side. Most often it is used for Audio applications and thus Audio drivers for Windows and Mac already exist. That's how I understand it on the L1/L2 series from Xmos, it's operation on the Xmos G4 devices may be different but its not really my area so you would need to get some feedback from others here on the forum regarding USB usage and or Windows drivers etc..

regards
Al