as a start http://www.mcselec.com/download/appnotes/gp2d02.pdf

based on BasicStamp... easy to translate now.