Results 1 to 3 of 3
Im writing a driver for a wieght device connected through the serial port. It's locked at baud rate 4800. The old driver under DOS comletes can do about 4000 reads ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-06-2005 #1Just Joined!
- Join Date
- Feb 2005
- Posts
- 7
Slow serial port! Please help
Im writing a driver for a wieght device connected through the serial port. It's locked at baud rate 4800. The old driver under DOS comletes can do about 4000 reads per minute from the device. That is:
1. 2 command bytes are sent to the device.
2. Device answers with 3 data bytes.
Takes about ~15ms for one read.
In the new linux driver i only get about 2000 reads per minute. So there's got to be a delay somewhere that slows down the process, and it's not my code that slows down the process. I have written on driver in Forth user mode and one driver as a kernel module but i get the same result anyway.
I'm using kernel 2.6.11 and i've tried a bunch of different things to make it faster without any result at all, among those are the low_latency flag that can be set through setserial or the tty struct. Please help me out! Thanks
- 04-07-2005 #2Just Joined!
- Join Date
- Feb 2005
- Location
- Delft, Holland
- Posts
- 95
I'v only heard a few times of Forth, so I don't know anything of its speed, but are you sure Forth is the right language to use?
- 04-08-2005 #3Just Joined!
- Join Date
- Feb 2005
- Posts
- 7
yea the forth driver is the same speed as the kernel driver...
but i've managed to get things a little faster now. the default trigger interrupt in linux is after 8 bytes in the uart buffer. so there's going to be a timeout delay since i only send 2 bytes to the device. i've set the trigger interrupt to 1 instead and it speed up things quite alot. however, it's still not as fast as the old dos driver which is about 15ms.. i get around 20ms now.. so it's still not quite fast enough.. dunno where the hell those 5ms comes from..


Reply With Quote
