Have a look at this thread by Darell: http://www.picbasic.co.uk/forum/showthread.php?t=12433