How long is the on time of the pulse?

by (no login)

The rate is 1kHz but how long is the pulse on and off?
If the on time is too short maybe you are missing the odd one.
If the on time is too long you are maybe the program is going back through the loop with the pin still high so you are getting two outputs per pulse.

I would have on time of the pulses long enough not to be missed and then check the pin has gone low before starting through the loop again.
It may be also a good idea to cut out all unnecessary calculations within the main loop.
BTW what is the speed of your computer?

Posted on Apr 1, 2008, 5:21 AM
from IP address 64.28.135.2

Respond to this message   

Goto Forum Home


Response TitleAuthor and Date
Pulse timeJack C. on Apr 1
 That seems a bit shortDavid on Apr 1
 If you can just use the 1Khz pulse to count then on Apr 1
  Why not set the timer to 1msDavid on Apr 1
   Try it with some "output" code on Apr 1