Maybe this will help.
http://www.melabs.com/resources/samples/pbp/usart.bas