Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: RM9200 serial port latency on 2.6.14
PostPosted: Sun Jul 20, 2008 2:08 pm 
Offline

Joined: Sun Jul 20, 2008 1:35 pm
Posts: 1
Location: Krakow, Poland
Hi,

I'm writing an application that sends a lot of short (about 10 bytes each) frames over serial line (there would be a maximum of 300 frames/second), and after each query it collects the answer of similar length.
Asked devices are replying almost immediately (about 1 ms max).
However, despite the baud rate (the same is in 19200 bps and 230400 bps), there's always a ~20ms latency between the end of write() and first received bytes.
When using tcdrain() all this delay is exactly on this function, and when I don't use tcdrain, but start waiting for answer immediately after write(), the delay also occurs.
I've tried waiting for answer with both select() syscall and looped non-blocking read()s.
The second method with gettimeofday() measuring also revealed that linux doesn't switch the task:
write() takes about 200µs, and subsequent reads always take 0 or 30 µs, and until there's some bytes received, all this numbers sum up to the total of about ~20ms.
So I suppose that the latency is because of serial driver but in kernel sources I can't find anything that may be connected with this.

Do you have any ideas how to minimize this latency on 2.6.14 linux kernel?

I'm using Artila M501 with AT91RM9200 @180 MHz, internal AT91 USART.

Thanks,
Adrian Matoga


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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

Search for:
Jump to: