PDA

View Full Version : PULSIN and RCTIME



Dwayne
- 7th October 2004, 20:52
Hello Folks,

Through a recent discussion, some questions came up that was confusing to me.

the manual says the RCTIME is *basically* 1/2 of the PULSIN time.

This tells me that PULSIN measures one complete cycle and returns a value. Whether you measure that cycle on the negative end, positive end... the answer is the same.

There is also a *threshold* and PULSIN AND RCTIME will not be activated until that votage is at that threshold.

Now lets take a hypothetical situation, and apply my understanding (or what I think I understand), and see what both PULSIN and RCTIME will return ok??? if i am wrong PLEASE correct my thinking!

1. A wave...(not square wave)

2. 3.5 volts high...it takes exactly 35 units(whatever measurement you want here) for one complete wave cycle.
3. Threshold of the pin is 3.4 volts.

Using pulsin, you will have the following:

case A: PULSIN pin, positive value
Value = 35

case B: PULSIN pin, negative value
Value =35

Using RCTIME, you will have the following:

case A: RCTIME pin, positive, value
VALUE = 2

case B: RCTIME pin negative value
Value = 33


Am I thinking correctly on this situation? Please correct my errors on my thinking.....if Ia m not correct, then what IS the difference between RCTIME and PULSIN?

Dwayne (thanks in advance!)

Acetronics2
- 4th November 2004, 13:48
Hi, Dwayne ...

Pulsin measures between 2 transitions on an input ( low to high and high to low i.e )

RCTime measures from the moment when order "RCTIME" is executed by CPU, to the next transition on the input ...

so, in your example it's right for pulsin measure, as max voltage is very close to input trigger level ( sawtooth waveform ??? )

BUT, for RCTIME, it is the sum Pos+neg value wich stays constant.
pos value can take every value from 1 to 34 ...depending on the moment RCTIME is executed in your program . Add one or two lines before RCtime, and you'll see what happens.

Little stupid light turned Green, at this time ???

Alain

Dwayne
- 4th November 2004, 14:45
Hell Alain,

Alain>>Little stupid light turned Green, at this time ???<<

Yes!... that stupid light finally came on <g>. Thanks for explaining it. Its one of those crazy lifetime comments I make. <g>.

Dwayne