Quickest Comm

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am
Contact:

Quickest Comm

Post by rp181 »

Whats the fastest way to get data from the XC-1A to the host? I am streaming info from a Camera (trying to get it to work), and right now, the Data is coming at about 8bits every 84 ns (according to datasheet).

When doing everything but printf, the program completes in less than a second. After adding printf("%i",yData), The data comes out at maybe 2 Hz.


User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Using printf to the console is painfully slow.
The UART on the FTDI chip can transfer data at 115kbit/s, and you can see it as a virtual COM port on the host with a driver from TDFI. (Windows often enumerates automatically)
But if you are locking for 12 MB/s you need to use USB 2.0.

Have you considered some simple video-compression to decrease the bandwidth?
Like store one picture and thereafter store the difference from the earlier frame during 1 s.
Thereafter use a lookup-table (an array) and translate the difference to variable-lenght code with something like Huffman coding. The less difference from picture to picture - the less bandwith is required.
The above example would be lossless compression. Lossy compression would be decrease the bandwith further.

PS. Video DSP is really not my area DS.

Edit to FTDI
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am
Contact:

Post by rp181 »

Thanks for replying.

What is TDFI?

For USB 2.0, Can I use the USB cable already connected? Or would I have to make another cable, and put it into the correct format? Are there libraries for this? Going to go look now.

I plant to do compression later, but still testing. I dont even know if the data I am getting is correct, I need to display it on the PC.
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

Sorry, I mean FTDI as http://www.ftdichip.com/FTDrivers.htm

Your card has an JTAG+UART chip from FTDI. The nice thing with using a FTDI chip is that they often provide driver for all different OS.
For an example the XTAG2 from XMOS, does provide a much higher transfer rate in HW, but there is no OS driver set yet for that. To provide driver for all OS is a very heavy task for a small company.
I havn't checked, maybe they have a full speed USB 2.0 chip with interface drivers to the OS. "Expensive in production but a fast solution"
Actually I do not know why we cannot speed up things, the
http://www.ftdichip.com/Documents/DataS ... T2232D.pdf on the XC-1 seems to be able to provide much higher speed than 115k. Maybe I am wrong, at least I can choose 922 kbit/s in Windows for the COM port.
Edit: I was wrong http://www.xmos.com/applications/comms/uart

The "most ready" XMOS SW solution for hi speed USB traffic is for USB Audio at the moment. It's probably easier to use 100 Mbit Ethernet instead.
Probably not the most confused programmer anymore on the XCORE forum.
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am
Contact:

Post by rp181 »

So the FTDI is used when i declare

Code: Select all

out port tx = PORT_UART_TX;
and just use that with a UART class? For Ethernet, Can i just connect the Ethernet to the computer and XMOS? Is external hardware needed?
User avatar
lilltroll
XCore Expert
Posts: 956
Joined: Fri Dec 11, 2009 3:53 am
Location: Sweden, Eskilstuna

Post by lilltroll »

rp181 wrote:So the FTDI is used when i declare

Code: Select all

out port tx = PORT_UART_TX;
and just use that with a UART class? For Ethernet, Can i just connect the Ethernet to the computer and XMOS? Is external hardware needed?
It's very easy to use the UART module. Open a hyperterminal or simlair on your OS, and test to write some data to the UART port on the XMOS side, and you will see the data in the terminal.
Myself I'm using MATLAB. MATLAB can read COM ports, and easily do almost any possible DSP with the data including visualisation. But so many host languages has support for COM ports, use any that you are familiar with.

Ethernet, I would go for the XC-2 card. Be adviced, the distance between the 16-pins ports are not the same on the XC-1 and the XC-2. Very good to know if you are planning to do an add on PCB module.
Probably not the most confused programmer anymore on the XCORE forum.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

I usually use the onboard FTDI chip of the xc-1a at 2 mbits/sec. You can get 3 mbps with some tricky programming.

My new board has an FTDI 245r but I can still only get about 1 megabyte/sec out of a 245r.

I'd like to try the 2232H in 245r mode which gives 12megabytes/sec but never got around to it.

FTDI drivers are much better than other options especially if you are planning an end product. I recommend against using VCP. D2xx has much better stability at high speeds.
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am
Contact:

Post by rp181 »

Im confused. Does UART = FTDI? If not, how do i use FTDI?
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

D2xx is on the PC side:
http://www.ftdichip.com/Documents/Progr ... 00071).pdf

Look at the datasheet of the FT2232D for the XMOS side.
User avatar
rp181
Respected Member
Posts: 395
Joined: Tue May 18, 2010 12:25 am
Contact:

Post by rp181 »

What baud do i use the UART port?
Post Reply