Communications choice

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

Post by vector »

Thanks Al and Berni for your help. I have
some research to do but I like the usb2 route
so will look there first.
Thanks again.


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

Post by vector »

After a good deal of searching, I found this :

http://www.ftdichip.com/Support/Documen ... ds-v13.pdf

It seems like a neat solution for the XC-1 as it would fit on the prototype area and provide an
additional high speed usb port without the need for a custom driver. Also supports a good range of OS's.
Can shift up to 8Mbyte/sec using FIFO interface. It has many flexible modes for other uses too.
I have one on order so I will provide some feedback as to how I got on with it.
Oh, and the good news is it was only £20, a small price to pay for the convenience although admittedly
expensive compared to a 3318 stand alone chip.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

The FT232 serial mode of the XC1A will do 3mbps using D2xx.

You only need around 800kbps so that is the easiest way since it is already built into the dev board and you need to do nothing hardware wise.

I stream easily 1megabyte/sec with the FT245R or ~2.5mbps with the FT232R all day long.
vector
Member
Posts: 11
Joined: Mon Mar 29, 2010 11:39 am

Post by vector »

That's very interesting. Do you have any
Code snippets for the xmos uart side?
There are a lot of different uart techniques
Posted for xmos but would be nice to
See one that really achieves 1mb/sec.
Also if the dll is used would the same code
Achieve say 2mb/sec ?
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

1megabyte/sec=8megabits/sec

You cannot go over 12mbps with FT245r so try the FT2232H which has the same programming interface.

Most people that need higher speeds could have packed their data better or used some sort of compression.

FTDI's documentation is excellent for their D2xx and anyone with a C programming background will not have any problems.

On the XMOS side you will need to write your own RS232 receiving handler and you will need to put it on a separate thread. You will also need a hub thread to store the data once it is read so none of your operations are blocking if you want to achieve 3mpbs. Sending data at 3mbps is trivial.

To achieve high speed you will need to read the USB protocol and test it yourself. A common mistake is to write one byte at a time which of course would not work and you need to be writing packets of 4kBytes or more at a time.

You also want to put in a sliding window protocol like TCP or Zmodem if you want to have any sort of speed with data correction. Sending one packet and waiting for single byte response will take you a few ms and you will be limited to something like 230kbps.