There is some code on my website and also on the Piclist for generating timing periods - look for Bresenham algorithm - my code is taken from the Piclist one. Colin -- cdb, colin@btech-online.co.uk on 21/01/2009 Web presence: www.btech-online.co.uk Hosted by: www.1and1.co.uk/?k_id=7988359 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist