Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
cellcon
PostPosted: Feb 28, 2012 - 12:53 AM
Newbie


Joined: Apr 05, 2010
Posts: 15


Hi!

I'm using a FTDI ft232h to connect my XMEGA A1 to the PC.

I tried several common and uncommon baud rates from 9600 to 4M baud. All baud rate work pretty well, up to 3M baud.

The theoretical limit of the XMEGA USART is 4M baud, but I can't make it work.

After reading several FTDI App Notes, I can't see why the FTDI should be the problem.

Has anyone here any experience with 4M baud from / to the XMEGA? Maybe even in combination with an ft232h?

cellcon
 
 View user's profile Send private message  
Reply with quote Back to top
nleahcim
PostPosted: Feb 28, 2012 - 02:24 AM
Raving lunatic


Joined: Feb 19, 2003
Posts: 2233
Location: Seattle, WA

I'm going to ask a super obvious question: Have you looked at the signals with an oscilloscope?
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Kartman
PostPosted: Feb 28, 2012 - 02:58 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8773
Location: Melbourne,Australia

USB places a limit on the throughput, so i do wonder if it is useful to run super high baudrates?
 
 View user's profile Send private message  
Reply with quote Back to top
angelu
PostPosted: Feb 28, 2012 - 05:38 AM
Resident


Joined: May 28, 2006
Posts: 716
Location: Toronto, Canada

I tested CP2104 with Xmega32A4 (XME board) at 2Mbps. It is working but at high traffic (I mean to send for example 40kbytes in one chunk) it loses some bytes. I am sure it is not Xmega at fault. Something between CP2104 and PC. I gave up and lowered at 1Mbps and it is working reliably.
On the scope I see there is some delay in between bytes when send from PC to Xmega, so I suppose for high volume of data this delay is accumulating.
I will move to Ethernet for this application. Not worth to investigate further.
George.

_________________
www.sofgel.ro bootloader for mega and xmega
www.elsofgel.com XME development board
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
angelu
PostPosted: Feb 28, 2012 - 05:39 AM
Resident


Joined: May 28, 2006
Posts: 716
Location: Toronto, Canada

Quote:
USB places a limit on the throughput, so i do wonder if it is useful to run super high baudrates?

I am not an expert on USB, but then how memory sticks transfer data much faster that we are talking here ?
George.

_________________
www.sofgel.ro bootloader for mega and xmega
www.elsofgel.com XME development board
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Kartman
PostPosted: Feb 28, 2012 - 06:56 AM
Raving lunatic


Joined: Dec 30, 2004
Posts: 8773
Location: Melbourne,Australia

Most of the current usb/serial chips only do 12Mbit/s USB. USB sends data in frames of 1ms, so that is 12000 bits per frame. The usb/serial chips have a fifo of limited length, I think it is 128bytes for the ftdi. On top of that is the control overhead and various other driver and operating system overheads, so you wont be able to get anywhere near the full 12mbit/s of USB.

If you run your memory stick on an old USB port only capable of 12mbit/s you probably won't think it is too fast, since most computers these days have USB2.0 at 480mbit/s, the speed is much better. USB3.0 is much better still, but only if the device supports it.
 
 View user's profile Send private message  
Reply with quote Back to top
barnacle
PostPosted: Feb 28, 2012 - 07:20 AM
Raving lunatic


Joined: Jan 03, 2006
Posts: 4417
Location: Hemel Hemsptead, UK

From memory, the datasheet for the FTDI series chips indicates that 3Mb/s is the peak speed.

If you think about it, the FTDI has to have a 'normal' internal uart to talk to your uart. That will require clocking at least four times the bit rate - and more likely eight or sixteen times - to ensure it can reliably find the middle of the bit to detect overflow and do majority voting.

The PLL clock on the USB side will be 24MHz, which is (tada!) 8 * 3MHz...

At a guess it will go no faster simply because the internal divider/counter has got down to 'one'.

_________________
Neil Barnes
www.nailed-barnacle.co.uk
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
John_A_Brown
PostPosted: Feb 28, 2012 - 09:17 AM
Raving lunatic


Joined: Sep 20, 2003
Posts: 4077
Location: Surrey, England

For my bootloader purposes I tested at 1Mb/s, then at 2Mb/s. There was no discernable improvement, simply because the Flash page erasing/writing was now the major time consumer, so I went back to 1Mb/s, because I like to have a bit of slack.

However, it seems to me that Neil's answer is probably correct. If you need faster comms you might have to use the parallel version(FT245?) or an AVR with built-in USB(latest XMega silcon revisions?).
 
 View user's profile Send private message  
Reply with quote Back to top
cellcon
PostPosted: Feb 28, 2012 - 10:42 AM
Newbie


Joined: Apr 05, 2010
Posts: 15


Thank you for your answers.

The ft232h is actual capable of UART Speeds "Up to 12Mbaud". It has a 120 MHz reference clock.

Has anyone any experience with the ft232h at 4M baud?
 
 View user's profile Send private message  
Reply with quote Back to top
barnacle
PostPosted: Feb 28, 2012 - 12:08 PM
Raving lunatic


Joined: Jan 03, 2006
Posts: 4417
Location: Hemel Hemsptead, UK

cellcon wrote:
ft232h


Ah, I was thinking of the 232r series. Sorry!

_________________
Neil Barnes
www.nailed-barnacle.co.uk
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
hugoboss
PostPosted: Feb 28, 2012 - 05:29 PM
Resident


Joined: Feb 19, 2010
Posts: 507
Location: Montreal, QC, CA

angelu wrote:
Quote:
USB places a limit on the throughput, so i do wonder if it is useful to run super high baudrates?

I am not an expert on USB, but then how memory sticks transfer data much faster that we are talking here ?
George.


There are many different kinds of USB. Typically cheap USB to serial dongles use two interrupt endpoints, which limits the total speed to 2 x (1ms x 64Bytes) so 1Mbps for the vast majority... Whereas a USB HDD or memory stick uses multiple endpoints in bulk transfer mode to saturate the USB bus where possible.
 
 View user's profile Send private message  
Reply with quote Back to top
NaKLocutus
PostPosted: Mar 06, 2012 - 03:08 PM
Newbie


Joined: Feb 22, 2012
Posts: 16


Hello everybody, i've connected an ft232h to an avr32 uc3c0512 via Usart and i'am encouterig the same problem here. If i put baudrates of up tp 2 Megabaud there is no problem. If i put the double the value to (4096000) Baud in the register (which should work since the AVR runs with 64Mhz (perfect match no error in baud rate calculation)) nothing works anymore. I was wondering if anyone of you has made any progress in this matter.

Best regards
Locutus
 
 View user's profile Send private message  
Reply with quote Back to top
angelu
PostPosted: Mar 07, 2012 - 04:13 AM
Resident


Joined: May 28, 2006
Posts: 716
Location: Toronto, Canada

Higher baud rates, above 1MHz tend to be multiple of MHz. Try 4Mbps.
George.

_________________
www.sofgel.ro bootloader for mega and xmega
www.elsofgel.com XME development board
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
NaKLocutus
PostPosted: Mar 07, 2012 - 09:57 AM
Newbie


Joined: Feb 22, 2012
Posts: 16


I used an oscilliscope, to check the output of the AVR, with Baudrates 2M, 4M and 6MBaud. The waveform is clearly visible. The shortest puls-width is (168ns @6M, 240ns@ 4M, 500ns @2M), so the FTDI seems to be the problem. I'am using Windows with the VCP driver. I used different Terminal programs like HTerm and Terminal, both don't work. Has anyone tried the device on linux?

Best regards
Locutus
 
 View user's profile Send private message  
Reply with quote Back to top
cellcon
PostPosted: Mar 10, 2012 - 10:34 PM
Newbie


Joined: Apr 05, 2010
Posts: 15


After testing and calculating lots of possibilities, I reported the problem to ftdi, but I did not receive any response. Thats frustating, may be I will remember this, while designing the next high volume device.
 
 View user's profile Send private message  
Reply with quote Back to top
smaslan
PostPosted: Mar 11, 2012 - 09:41 AM
Hangaround


Joined: Sep 22, 2006
Posts: 146
Location: Czech Republic

cellcon: Wait a month or two, that should do it.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
NaKLocutus
PostPosted: Mar 12, 2012 - 05:56 PM
Newbie


Joined: Feb 22, 2012
Posts: 16


push and update:
the support of ftdi responded to my inquery. they told me to update the driver Smile. No sucsess. i cut open the connection to the avr and connected rx to tx (loopback) and no more problem (baudrates of up to 12Mbaud possible). So the problem is the µC any thouhgts or ideas..?

Best regards
Locutus
 
 View user's profile Send private message  
Reply with quote Back to top
hugoboss
PostPosted: Mar 12, 2012 - 07:38 PM
Resident


Joined: Feb 19, 2010
Posts: 507
Location: Montreal, QC, CA

The problem is most likely the connection between the AVR and the FTDI. At 6MHz you have to take some special care with the tracks. If the signals look fine at the AVR output, and the FTDI works fine in loopback mode, then the problem is obviously in between the two.
 
 View user's profile Send private message  
Reply with quote Back to top
hugoboss
PostPosted: Mar 12, 2012 - 07:44 PM
Resident


Joined: Feb 19, 2010
Posts: 507
Location: Montreal, QC, CA

And BTW no AVR runs at 64MHz.
 
 View user's profile Send private message  
Reply with quote Back to top
NaKLocutus
PostPosted: Mar 13, 2012 - 12:06 PM
Newbie


Joined: Feb 22, 2012
Posts: 16


Solved!! It was the driver. These Steps will help
-> Get the BETA driver from the FTDI-Page (Currently 2.8.23.0)
-> Get the CDMUninstaller Tool
-> Run the CDMUninstaller Tool: VendorID 0403 PID blank
-> Remove the driver
-> Disable your Network connection (to prevent windows to load the driver from windows update imidiatelly afer the reboot)
-> Reboot!
-> In the Device Manager is a device called single RS232 (or something like the name...)
-> Install the Beta driver, reboot!

This actually works (8MBaud without problem).

Best regards
Locutus
 
 View user's profile Send private message  
Reply with quote Back to top
cellcon
PostPosted: Mar 20, 2012 - 10:29 PM
Newbie


Joined: Apr 05, 2010
Posts: 15


@NaKLocutus:
Thanks a lot! Your procedure worked perfectly! I can now use the 4MBaud to / from the XMEGA.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits