?
Solved

Code to out put to a port

Posted on 1998-11-05
6
Medium Priority
?
180 Views
Last Modified: 2010-05-18
How do you output data to a serial port??
0
Comment
Question by:srapsey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1254033
What OS are you using?
0
 
LVL 1

Expert Comment

by:MatthewL
ID: 1254034
On an IBM PC Compatiblble, you can use int 14H.

If you want info on the interrupt, I can post it for you.

Matt
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1254035
use assembler...

void main()
{
  asm{
    out reg, reg
    //rest of asm code...
  }
}

Note: Is a register

Cheers,
Viktor
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Expert Comment

by:viktornet
ID: 1254036
use assembler...

void main()
{
  asm{
    out reg, reg
    //rest of asm code...
  }
}

Note: reg is a register

Cheers,
Viktor
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1254037
Sorry for double posting....
0
 
LVL 2

Accepted Solution

by:
helver earned 100 total points
ID: 1254038
It's really OS dependent.  If you're using Linux you can open /dev/ttyS? for writing and that should do it... Then just treat it as a regular file descriptor or stream.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question