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? from IP address 64.28.135.2 |
| Response Title | Author and Date |
| Pulse time | Jack C. on Apr 1 |
| That seems a bit short | David on Apr 1 |
| If you can just use the 1Khz pulse to count then | on Apr 1 |
| Why not set the timer to 1ms | David on Apr 1 |
| Try it with some "output" code | on Apr 1 |