Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 30th, 2005, 6:34 PM   #21
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5 grumpy is on a distinguished road
Quote:
Originally Posted by anant_tickoo
i needed to create delay so that i can cheak the pulses arriving at LPT port( i am scaning my printer port after every 10ms for a pulse. and life of arriving pulse is 50ms. when the first pulse comes i will switch the scan to 50ms secs so that i will not read a pulse twice or so). simple serial data acquisition from printer port.
If you want to do that under windows (where you can't guarantee either the scanning interval or the length of time where you ignore the data), it won't work too well. If it's worked under linux, it's probably just good luck rather than good planning.

The inherent accuracy in timers under windows is +/- 15 msec. The accuracy you get under linux isn't typically much better (unless you're using a version of linux that supports real time extensions). If you have a lot of applications running (either foreground or background), the accuracy of timers will tend to reduce --- for both windows and linux. One consequence of this uncertainty, with your strategy of "poll then don't poll", is that if two or more pulses come in rapid succession, you have a good chance of ignoring at least one of them.

I suggest a strategy of scanning continually (at a small interval, say 10msec), but (when a pulse is received) ignore the data received until your 50ms interval is up. Depending on how you do it (and how long the gaps are between pulses) you can probably also refine the approach to recognise the inter-pulse gap and/or identify leading/trailing edges.

Quote:
Originally Posted by anant_tickoo
i am going good with it but some problems come its is one of them. the project i am making can be made soly by ICs and RS232 type comm. but i wanna make a low cost stuff, so i gotta reduce hardware and use software.
ANd i wanna make it go upto 10KBps.
You might want to think again. Hardware design you can control. Doing it in software you run into vagaries of things like the operating system you run on the software, unless you use an RTOS (which isn't cheap either).

Making hardware cheap will come with the cost of making the software more expensive. A few ICs, resistors, diodes, etc is almost certainly cheaper than a few hours of programmer time, unless you are making several thousand or several million copies of the hardware. And if you're making a lot of copies of the hardware, you will have to guarantee the software works on a wide range of systems (eg different types of PCs, different applications running on them, etc etc) --- which implies a software maintenance issue. Trying to fix bugs on software running on systems you can't control is not fun --- and requires considerable programmer effort.
grumpy is offline   Reply With Quote
Old Oct 2nd, 2005, 10:32 AM   #22
anant_tickoo
Programmer
 
Join Date: Sep 2005
Posts: 50
Rep Power: 0 anant_tickoo is an unknown quantity at this point
true

but electronics has ckts dedicated for this only like RS232 driver and may more i wanna bypass them.

basically i am doing Electronics and communication engg.


thanks for good works.
anant_tickoo is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:51 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC