I removed the DEFINE OSC so that the software thinks it is running at 4 MHz (default), but it is really running at 32MHz based on the OSCCON and OSCTUNE register settings. I think that it is actually running at this speed because my pc based interface program is set to a baud rate of 38400. So if my pic is running 8 times faster than the code thinks it is then I should set my serin2 to 4800 (38400/8=4800). Now the two will communicate correctly. However, if you noticed in the code where I have the following:
trigger1=1
trigger2=1
pauseus 1
trigger1=0
trigger2=0
When I measure the time that the triggers are actually on I am seeing about 12.6 microseconds. Looking in the pbp manual under the PAUSEUS command, I was expecting to see a pulse of about 2 usec. Not sure how long the instruction to change the state of a pin takes, but it seem like I should have better resoultion at 32 MHz.
Thoughts?