Extremely low-level serial port programming

R

rusttree

Many moons ago, I took a class in embedded control at school. The
course focused on a micro-controller mounted on a small electric car
that was programmed using simple C code. The micro-controller chip had
several pins, some of which were for output and some were for input.
The crux of the project was to make the program set the ouput pins to
high or low to drive the servos and motors and read the input pins that
were attached to various sensory hardware on the car. It was an
extremely simple, yet powerful mechanism to accomplish the task.

So I thought it would be a neat idea to build my own projects using
standard PC hardware. Having no real computer hardware education, I
assumed the serial port would be a good place to investigate. The
serial port on my PC has 25 pins. I figured there would be some
low-level way of interfacing with the serial port hardware directly and
manually set these pins to high and low as well as read input voltages
applied to the pins. My research seems to have proved otherwise. It
looks like the serial port was designed for a very specific purpose of
transmitting pre-formatted bytes of data in predescribed ways. The
pages I have come across speak of baud rates and transfer protocols and
such. That seems interesting in it's own right, but I'm interested in
a much more fundamental control of the pins of a serial port. So
herein lies my question: Am I even close to reality thinking I can do
what I want to do? Or am I so far out in left field I look ridiculous
right now?

I realize I may not be in the correct newsgroup for this kind of
discussion. If someone knows of a better place to bring this up,
please direct me to it. Thank you.
 
K

Karl Heinz Buchegger

It
looks like the serial port was designed for a very specific purpose of
transmitting pre-formatted bytes of data in predescribed ways. The
pages I have come across speak of baud rates and transfer protocols and
such. That seems interesting in it's own right, but I'm interested in
a much more fundamental control of the pins of a serial port. So
herein lies my question: Am I even close to reality thinking I can do
what I want to do? Or am I so far out in left field I look ridiculous
right now?

The serial port is not the way you want to go.
Use the parallel port on your PC. There you can control
each pin individually.

There is lots of information on how to do this on the Web. Use
google to search for more information.

If you are running Windows:
Start with downloading a driver, that enables you to acceess the parallel
port hardware directly. Eg. http://www.driverlinx.com/DownLoad/DlPortIO.htm
provides such a thing.
 
O

osmium

Many moons ago, I took a class in embedded control at school. The
course focused on a micro-controller mounted on a small electric car
that was programmed using simple C code. The micro-controller chip had
several pins, some of which were for output and some were for input.
The crux of the project was to make the program set the ouput pins to
high or low to drive the servos and motors and read the input pins that
were attached to various sensory hardware on the car. It was an
extremely simple, yet powerful mechanism to accomplish the task.

So I thought it would be a neat idea to build my own projects using
standard PC hardware. Having no real computer hardware education, I
assumed the serial port would be a good place to investigate. The
serial port on my PC has 25 pins. I figured there would be some
low-level way of interfacing with the serial port hardware directly and
manually set these pins to high and low as well as read input voltages
applied to the pins. My research seems to have proved otherwise. It
looks like the serial port was designed for a very specific purpose of
transmitting pre-formatted bytes of data in predescribed ways. The
pages I have come across speak of baud rates and transfer protocols and
such. That seems interesting in it's own right, but I'm interested in
a much more fundamental control of the pins of a serial port. So
herein lies my question: Am I even close to reality thinking I can do
what I want to do? Or am I so far out in left field I look ridiculous
right now?

I realize I may not be in the correct newsgroup for this kind of
discussion. If someone knows of a better place to bring this up,
please direct me to it. Thank you.

Your approach sounds very logical. But. The serial port is indeed defined
with a particular interface in mind; in particular, the RS-232 interface of
an AT&T modem. There is a command "Get Port Status" and the things returned
are RS-232 signals. Signals such as "data set ready", "clear to send" and
so on. And the unit of transmission is a character, not a bit --. and the
choices are either seven or eight bits. If you want to pursue this the best
place would be a MS-DOS group of some kind. There may be a hardware group
or an embedded programming group that would be helpful too. But to make
progress, your best bet is to switch to using the parallel port as has
already been suggested.

As I see it the serial port on a PC is mis-named, it should have been called
the RS-232 port.
 
R

rusttree

Thanks all for the helpful insight. I'll begin investigating the
parallel port after I finish my mourning period for the $4.50 I wasted
on a serial cable.

-Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top