you should find some hints in the following
http://www.picbasic.co.uk/forum/show...44&postcount=2

look the 2 lasts examples

HTH