What type of pulse are you measuring?
What type of pulse are you measuring?
It is a PWM signal 0 to 5 volts. Rather than setup an RC circuit to get an analog voltage I am measuring the low time and high time and then finding the duty cycle from there. Just curious if the command waits for a transition to start the timer, or if it starts whenever the pin is in the desired state even if it has been there for some time. It actually works very well. I just wanted to understand the command a little better. The manual says that it turns off on a transition, but it doesn't say if the timer turns on on a transition.
I have no clue. Sounds like a Melanie or Bruce question. I think that it starts at the zero axis and stops on the turn down or turn up, but I am not for sure.
Sorry,
Travin
Never test it but i hope it wait for a rising or falling edge. Usually i prefer to use the internal Timer or the PIC CCP module.
As it works.. you may stick to PULSIN or read the CCP tips and trick document of microchip bellow.
http://ww1.microchip.com/downloads/e...Doc/41214a.pdf
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
It actually works great. I put two of the same pulsin commands next to eachother. That way if the first one only catches part of the pulse, the second one will get the whole one. Not very efficient, but I am not making anything real complicated and I have the resources to spare. I will keep it that way until I know for sure how the command works. When I compare my calculated duty signal to a DVM, the two are the same.
Bookmarks