Bruce,
Thanks for the help! The CMCON = 7 I think is what did the trick (i.e. it works). However, it works only intermittently. It seems that the microchip is only executing the full program when I have my finger on the +5V lead (and then only sometimes). I'm wondering what's causing this? I'm using the INTRC (IN) configuration option. I am also using the same PS for the servo and the chip (wall wart to a 1A, 5V regulator). Is the cause of this most likely due to sharing of the power source, a touchy internal oscillator, or something else?

Thanks again for the help.

Dave

Quote Originally Posted by Bruce
Turn off analog comparators so your pins can be used for digital I/O.

CMCON = 7

PULSOUT toggles the pin twice, so the initial state of the pin determines
the logic of the pulse.

LOW 0 ' We want a high-going pulse or low-high-low with pulsout.

Code:
@ DEVICE MCLR_OFF,INTRC_OSC,WDT_OFF,PROTECT_OFF

Define	OSCCAL_1K 1  ' Load factory value into OSCCAL
CMCON = 7                  ' Turn analog comparators off

X VAR BYTE
LOW 0        ' Setup GPIO,0 to output a high-going pulse with pulsout

Main:
    FOR X = 1 to 50
    pulsout 0, 100
    pause 15
    NEXT X
    
    pause 1000
    
    FOR X = 1 to 50
    pulsout 0, 200
    pause 15
    NEXT X
    
    pause 1000
    
    goto Main

    end
You may want to tweak the pulsout periods, but that should get you started.

Make sure you use a separate power supply for your servo. Using the same PS as the PIC will cause problems.