You might download the arduino IDE and look at the source to see howthey do it. I have been playing with the Uno board and found the serialcommunication quite good.