467,102 Members | 1,141 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,102 developers. It's quick & easy.

Extremely low-level serial port programming

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.

Aug 10 '05 #1
  • viewed: 4248
Share:
3 Replies
ru******@gmail.com wrote:

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.

--
Karl Heinz Buchegger
kb******@gascad.at
Aug 10 '05 #2
<ru******@gmail.com> wrote:
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.
Aug 10 '05 #3
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

Aug 10 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Andrew | last post: by
19 posts views Thread by Lorenzo J. Lucchini | last post: by
26 posts views Thread by Bruno Jouhier [MVP] | last post: by
14 posts views Thread by Steve McLellan | last post: by
6 posts views Thread by DCC-700 | last post: by
5 posts views Thread by coldpizza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.