• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

C program on PIC to send data via RS232

Status
Not open for further replies.

HiJack

New Member
Greetings guys,

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?

Any help will be most appreciated. Thanks guys.

Best regards,
HiJack
 

Nigel Goodwin

Super Moderator
Most Helpful Member
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.
 

3v0

Coop Build Coordinator
Forum Supporter
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.

3v0
 

HiJack

New Member
Hi guys,

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.

Regards,
HiJack
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top