Can pulsein() "read" the same Arduino's PWM?

For diagnostic purposes, I am considering using pulsein() to check what the PWM (really PPM, I think) for my 2 motors are currently set at. IOW, when this diagnostic is enabled, I would read pulsein() on a couple of of pins and display their current (no pun intended ::) ) values on the LCD, actually writing only when they changed from the last time. Then instead of connecting the PWM outputs to the ESCs for the motors, I would just connect them to the input pins used for pulsein(). Please let me know if I shouldn't do this, either because it could damage hardware or because it just won't work.

Connecting an output pin to an input pin is safe. I did something similar to validate the tone function.

There are reasons what you're trying to do will not work but trying will not damage anything. You may want to include a current-limiting resistor between the output pin and input pin just in case of a software mistake.

Good luck.

There are reasons what you're trying to do will not work

If that is the case, then I won't do it. The reason I asked was due to my experience with trying to do a loop back on an emulated NewSoftSerial "port". That didn't work, and I understand why from an explanation given. I didn't know if a similar issue existed with PWM. I had assumed not, since PWM levels are maintained while other things are being done. I can put in diagnostics that will show me everywhere I set the PWM level by calling the servo library and that will show me if I have a logic error that causes me to explicitly set it to something other than I expect at some point. What that would not show me is if the pin was changed as a side effect of something unrelated (or not purposefully related).

This isn't Microsoft Windows or the Mac OS, or Linux, etc. There are no separate, independent processes running in the background implementing all the overhead.

It's been a while, but I used to do a lot of this sort of stuff - firmware that was executed as the very first instruction when the computer powered on, the last when it was powered off and everything in between. Sometimes I miss those days; I was never confused about whose problem any bugs were...

Arduino does seem to be middle ground. It lets you at the metal but sometimes it is emulated in code that I am glad I didn't have to write.

There are reasons what you're trying to do will not work

That was poorly worded. Please allow me to rephrase...

There are reasons what you're trying to do [u]may[/u] not work. It is entirely possible that what you're trying to do will work flawlessly. It all depends on how the output is generated. If you're just calling analogWrite, I suspect it will work. If you're generating a waveform in an interrupt service routine then you're probably out of luck.

Sorry about the confusion.

I confess to being puzzled by some comments here. PWM, once established (i.e after the "analogWrite" is complete), is effectively a separate "thread", albeit one run solely in hardware. I see no reason why running a "pulseIn" on a looped-back output pin should not work.

I'm willing to hear why it should not give good results.

Actually one reason did occur to me that it could be a bad idea. If I use the default timeout for pulsein, then anytime both motors were turned off I would incur a 2 second delay. If I didn't use the default but instead supplied a somewhat reasonable timeout value, I run the risk of not realizing that it did somehow get set to a really low value.

But it sounds like something I should be able to do if I am looking for more information. Making motors run is pretty easy, but motor control tweaking is not trivial.