Hi, Graham

Good !

1) I wanted to wipe line about " I var " ... but timeout for editing post caught me !!! - seriously - that doesn't change anything to the produced Hex , as it's just a compiler directive ...

2) I also wanted to add
Code:
LOW Servo
just before each PULSOUT Command ... BTW ... could you tell us why ?
to understand the "why" ... just plug and unplug the servo plug for 5 or 6 times in a row ... with power ON

and 3) ... CLEAR might much better be after declaring the variables ... no ???

and ... 4) BINARY numbers must be written %01010101 ... for
Code:
TRISIO =
Everything told now !

Alain