Try looking in the NXT hardware developer kit. (it's a PDF)
I was going to give you a link, but I couldn't find it. I thought it was somewhere on the LEGO site.
Here's a pdf-javascript version hosted on another site:
http://www.docstoc.com/docs/20929335...-Developer-Kit