Thanks to all those who made suggestions. In the end I unrolled the loop and used straight ... PORTB = 8 PORTB = 9 etc etc Goto beginning and the frequency shot up by almost a factor of ten !. So I have included a delay of 1 uS at each point and fine tuned the frequency by adjusting the number of points in each cycle. I am well pleased with the results for the price of half a 628 port and five resistors. Thanks again chaps ...... John Kent -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body