counting microseconds

Status
Not open for further replies.

digital

New Member
How would you go about counting the duration of a very small pulse in precision of microseconds ?
 
k7elp60 wrote: Are you wanting to measure the pulse repetition rate? or the pulse width?
Im looking to measure the pulse width


What about without using an oscilloscope, considering they are costly, are there any other reliable methods :?:
 
digital said:
How would you go about counting the duration of a very small pulse in precision of microseconds ?
How wide is the pulse, and what resolution do you need?
 
Ron H wrote: How wide is the pulse, and what resolution do you need?

0.5 to 2 miliseconds, im going to need to measure several different pulses within that range so it needs to be relatively precise.
 

Would these be radio control servo pulses?.
 
An oscilloscope is the first and most obvious tool to use, but it sounds as though you have not got one.
My next choice would be a universal counter/timer. They are expensive and I am guessing that you dont have one of those either.

You could try building a counter/timer if you need to measure the pulse width, a simple one for the times you want is not too difficult. An oscilloscope would be usefull when you are checking the timer.....
OOPS, no oscilloscope! I guess you are stuck.

JimB
 
Relatively precise means nothing. How you do this depends on a real answer.
 
I think a microcontroller in a counter would work fine. The MCU are known to be faster than most of the fast occuring events, just set to MCU to the desired (sweep) rate and have the result stored in your memory.
 

As Ron pointed out, you need to provide some quantity since the implementation method may depend on that.

For example, what is the _smallest_ width within 0.5ms to 2ms that you anticipate needing to measure? That answer will determine what minimum resolution you will need. And for all your measurments, how close to actual do you really need to be (accuracy)? a +/-1% accuracy for example would mean that if your pulse was 0.5ms long, your design would tell you it was something between 495us and 505us. Assuming you have this kind of resolution of course.
 
Nigel Goodwin wrote:
Would these be radio control servo pulses?.
eventually radio control but for now Im only treating it as a serial data communicator using PWM between one wire

Optikon wrote:
what is the _smallest_ width within 0.5ms to 2ms that you anticipate needing to measure?
The smallest pulse width will be 0.5ms, but will be in 0.5ms incriments, 15 times for 15 commands at most. Its hard to predict exactly how much resolution is actually going to be really used in the circuit but I would like an accuracy of atleast 1%

0.5ms * 1% = 0.005ms, isn't that a resolution of 5us ?

so for a value of lets say 1ms I could be off by 1.005ms to 0.995ms
 
Whats the 1st and most accurate method for measuring pulse width ?

Whats the 2nd ?

Any other reliable methods/ideas ?

What about constructing a syncronous 7 segment display clock(probably using 4029's) but clocking it faster than 60Hz, starting with values 1 sec and smaller, and connecting it with a stop/start interface to display how long a specific pulse was, do you think that this method would work :?:
 
I would suggest you use a PIC at both ends, and send digitally encoded data over the link, preferably using Manchester coding (or similar), you can buy licence free radio modules which accept standard RS232 and do the Manchester coding onboard.

Your pulse width scheme looks rather crude and unreliable?, you might like to look at my SIRC's IR tutorial, which uses various pulse widths for IR remore control. You will notice that it doesn't use specific widths, but uses a wide range of widths to represent either START, ZERO or ONE - this gives high reliability.
 

Typically, a low jitter clock from a crystal source is used for counting the number of clock cycles that occur within your pulse width. SInce the time base is known, the pulse width time can be calculated.

I dont know what you're talking about with the 4029's but all you need is a reliable clock and a counter and a means to reset the system to work on a pulse by pulse basis for measuring. As pointed out, if you have a PIC or some kind of micro controller in your system, it's a snap.

If you have to do the design with discrete logic (why?) you need a clock and a counter among other glue & reset logic. The higher the frequency of your digital counting clock, the finer the resolution will be. This comes at a price though. The higher your counting frequency, the more storage will be required to store the large counts i.e. flip flops.

Lets say you used a 1 MHz clock for counting a pulse width of 2 milliseconds. 1 single clock period counts 1 us so that determines your resolution. 2 millseconds = 2000us so this means a count of 2000. 11 flip flops can store a count of up to 2048 so that will suffice if 2ms is the longest you plan to measure.

Lets say your clock was 100MHz. 1 single clock counts 10ns of time. the 2ms pulse width now causes a count of 200,000. This requires 18 flip flops.
 
Can propagation delay affect my results significantly, when counting such small values, would propagation delay make any difference if I where to use a pic vs discrete logic :?:
 
digital said:
Can propagation delay affect my results significantly, when counting such small values, would propagation delay make any difference if I where to use a pic vs discrete logic :?:

This isn't a small value!, 0.5-2mS is a pretty wide pulse, the shortest is 2500 PIC instruction cycles running at 20MHz.

Propagation delay is only a problem at HIGH speeds, nano-seconds, not milli-seconds - it doesn't apply to a PIC as they don't work anywhere near that fast.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…