Quote Originally Posted by Byte_Butcher View Post
No, 2 seconds is too long for pulsin.

According to the manual:
"The resolution of PULSIN is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the pulse width is returned in 10us increments. If a 20MHz oscillator is used, the pulse width will have a 2us resolution. "

Since the pulsin will return a WORD, the max pulse length is 65535 x 10uS (for a 4MHz clock) which is only 0.655 seconds.

For a 20MHz osc it would only be 0.131 seconds.

steve
And what would be the problem with using a 1MHz clock?

YES--Of COURSE you can use Pulsin for a 2 second pulse! Most PIC's have internal clocks that are capable of it. Heck, if you need a faster clock for other stuff, just slow down (i.e. change osccon) right before the pulsin and put it back after.