Well, we don't know for sure which PIC you're using (you hinted at the 16F84, but never really specified)...but...
As far as PBC, yep, you sure did mention it... I missed it. My bad.
And PBC is limited in that respect, Pin 0 - Pin 7, that's what you get. Maybe Pin 8 will get you PortA.0. I don't know, I don't use PBC.
If you want my advice, get the upgrade to PBP. You'll be MUCH happier in the long run.
Short of that, don't use the pulsin statement ('cause PBC won't let you).
Write your own tight loop to mock pulsin.
Wait for the pin to go high (or low)
Sit in a tight loop counting the passes thru the loop while the pin is high (or low)
Exit when the pin changes again.
Take the loop count, multiply it by the # of us spent in each loop, and you've got your answer...
OR...
Use the pulsin on the PortB, and use a delay loop to send the 'pulsout' on PortA.
Bookmarks