I am using PIC to send data via RS232 to a computer, and I am using C to program the chip. However, I don't know how to write this program. Is there any special fuction or instructions in C library? By the way, I am using HyperTerminal on the computer to receive data.
Also, do I need to worry about ASCII format when I send the data?
Can't help you with C, but my tutorials show how to do it in assembler - regardless though, I would suggest you send the data as ASCII rather than binary.
Have you check the compiler manual for examples. Many of them provide one ths shows how to setup the uart and send the data. It is only a few lines of code.
You did not tell us which compiler or PIC you are using.
Thanks for kind help. Good news, I finally got it working.
The circuit that I built is definitely working, the problem was HyperTerminal, which has some compatible issues with Vista. I searched for other serial port logging software and I found this: Free Serial Port Logger : RS232 Port Logger Software - Serial Data Logger
It is called RS232 Data Logger and it is free.
Now, for people who is new with Vista and if you are using a USB-to-Serial(DB9) cable, make sure you have the cable on Prolific brand. It provides driver on Vista system and it is definitely working.