BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Tue Jan 23, 2018 12:50 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Slow writing
PostPosted: Sun Dec 23, 2012 6:21 am 
Offline
Citizen

Joined: Sat May 07, 2011 9:52 pm
Posts: 30
I finally upgraded from an XP laptop to one with Win7 (64 bit). I'm using a 4 port Digi Edgeport USB to serial box. I have no problems communicating with any other RS232 devices. I have both Basic Micro Studio and IDE (for some older modules). Both programs are very slow to write to the Basic Atoms. They verify fast, but the write takes about 2 minutes. It was never this slow on the XP machine. I've tried changing various options with the edgeport configuration utility, but none of the settings make a difference. The edgeport monitor shows Tx of 64 CPS and Rx of 128 CPS during the write. Any ideas?


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Sun Dec 23, 2012 3:38 pm 
Offline
Citizen

Joined: Sat May 07, 2011 9:52 pm
Posts: 30
I tried a different USB to serial adapter and it works fine with that one. So it must be something related to the Edgeport. However, I'm still puzzled at to why eveything else I use with the Edgeport works fine.


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Sun Dec 23, 2012 4:38 pm 
Offline
Master

Joined: Tue Nov 21, 2006 5:34 pm
Posts: 662
I will assume this is probably an FTDI based adapter. If so, bring up the device properties for the comm port and go to the Advanced settings and verify that the Latency TImer value is 1

There are several threads that discuss this and show step by step.

Kurt


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Sun Dec 23, 2012 4:52 pm 
Offline
Citizen

Joined: Sat May 07, 2011 9:52 pm
Posts: 30
KurtEck wrote:
I will assume this is probably an FTDI based adapter. If so, bring up the device properties for the comm port and go to the Advanced settings and verify that the Latency TImer value is 1

There are several threads that discuss this and show step by step.

Kurt


I've done some searching and saw those threads. There is no latency timer setting for the Edgeport. There is a latency option box in the Edgeport configuration utility, but it makes no difference whether it's checked or not.


Attachments:
edgeport.jpg
edgeport.jpg [ 96.28 KiB | Viewed 4400 times ]
Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Wed Dec 26, 2012 8:55 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
You will need to contact the company to see if they have a way of adjusting the latency. Latency is the time it takes to switch from sending to receiving. USB to serial adapters do not do both at the same time like a real serial port so there is a delay during the switch. Every FTDI adapter I've used lets you adjust this but other USB to Serial adapters may not.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Wed Dec 26, 2012 10:54 pm 
Offline
Citizen

Joined: Sat May 07, 2011 9:52 pm
Posts: 30
Acidtech wrote:
You will need to contact the company to see if they have a way of adjusting the latency. Latency is the time it takes to switch from sending to receiving. USB to serial adapters do not do both at the same time like a real serial port so there is a delay during the switch. Every FTDI adapter I've used lets you adjust this but other USB to Serial adapters may not.


Well, I can work around it with another USB to serial adapter that works faster (like 9 seconds instead of 2 minutes). Just odd that this is the only application that has a problem with this adapter (since is is a relatively high end unit).

The only latency adjustment is the one in the picture above. Here is what the docs say about that flag (but it does not help).

"Low Latency:
Normally the UART will interrupt when the receiver has been idle for 4 character times. (For example 4ms at 9600) As long as data is being received the UART will continue to buffer them until its internal FIFO is full (~56 bytes).

This flag causes the Edgeport to poll the RX FIFO for received bytes. If any bytes are available they will be sent to the driver without any delay."


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Fri Jan 04, 2013 6:55 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
The problem is inherant to USB to serial adapters. USB is a half duplex system. It only sends or only receives at any given time. So to emulate a serial port it has to switch back and forth. This takes time and it doesn't know when data is going to be coming so the driver writers have added a latency value. This is basically a timeout. When transmittting data the USB drvier will wait for more data to be given to it to send for that timeout period. If nothing is given to it then it will switch direction and receive any data thats queued up from the other end. So with FTDI you have a 16ms latency. This means even if you only send 1 byte it still takes 16ms for you to receive a reply from that byte no matter the baud rate. Add that up over 8kybtes and you add a significant amount of time. Even with FTDIs 1ms setting it is still about half the speed of a real serial port because of this timeout period between bytes.

On adapters that dont let you adjust the latency there is nothing you can do to fix the problem.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Fri Jan 04, 2013 7:06 pm 
Offline
Citizen

Joined: Sat May 07, 2011 9:52 pm
Posts: 30
Thanks for the explanation. The adapter that works better (9 seconds) I believe is a Prolific unit, as that is the driver it loaded. I can live with 9 seconds. But waiting 2 minutes every time you need to make a minor code change can be frustrating. I sure do miss having a "real" serial port like on my old laptop. :(


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Wed Jan 09, 2013 10:52 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 7:00 pm
Posts: 1316
Location: Temecula, CA
I beleive Prolific has an even shorter latency by default than FTDI allows(eg shorter than 1ms) so they are a good alternative. The only problem with Prolific is finding the correct drivers sometimes. We switched to recommending FTDI based adapters several years ago because of the large numbers of driver issues we had with Prolific adapters. Hoefully this means that is no longer an issue.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Slow writing
PostPosted: Wed Jan 09, 2013 11:22 pm 
Offline
Citizen

Joined: Sat May 07, 2011 9:52 pm
Posts: 30
Acidtech wrote:
The only problem with Prolific is finding the correct drivers sometimes. We switched to recommending FTDI based adapters several years ago because of the large numbers of driver issues we had with Prolific adapters. Hoefully this means that is no longer an issue.


From what I know based on issues with using Prolific adapters for another use (radio programming), apparently there are a lot of China made Prolific clones floating around (ebay). So Prolific updated the driver to only work properly with the real deal. Using an older Prolific driver version (i.e. 3.2.0.0) will still work with the clones. Not sure if that is the issue here, but it is with the radios.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO