Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to use C (say Turbo C) to send and receive ASCII from COM port

How to use C (say Turbo C) to send and receive ASCII from COM port

How to use C (say Turbo C) to send and receive ASCII from COM port

Hello.  I am a newbie to this forum.  First time user, just joined.

I want to send ASCII characters to COM port using say Turbo C.  The recipient of the ASCII character is a PIC microcontroller.

And I want to also receive ASCII characters from COM port via Turbo C.

On the PIC side, I have a program that can send and receive ASCII from PC (via Hyperterminal) and it works.

But I want the PIC to talk to Turbo C, not Hyperterminal.

Does anyone know how to use Turbo C to receive and send ASCII characters to COM port?

A small but complete program to send say "Hello world" to COM port and receive message "I am here" from COM port and display it on PC screen would be great.  Use say Baud rate of 9600.  

Thanks in advance.


RE: How to use C (say Turbo C) to send and receive ASCII from COM port

Which OS are you using?  You can only talk directly to the com port on 95,98,ME.

If you're using Nt,2K,XP,Vista, have a look at http://msdn.microsoft.com/en-us/library/ms810467.aspx.  I don't know if Turbo C has the readfile interface.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close