Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Extremely low-level serial port programming

Reply
Thread Tools

Extremely low-level serial port programming

 
 
rusttree@gmail.com
Guest
Posts: n/a
 
      08-10-2005
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.

 
Reply With Quote
 
 
 
 
Karl Heinz Buchegger
Guest
Posts: n/a
 
      08-10-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      08-10-2005
<(E-Mail Removed)> 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.


 
Reply With Quote
 
rusttree@gmail.com
Guest
Posts: n/a
 
      08-10-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
emulate a serial port in windows (create a virtual 'com' port) Pom Python 2 01-31-2007 07:49 PM
Serial Port programming - Reading DSR from port msalerno Perl Misc 3 07-14-2005 12:58 PM
Can I connect router Serial interface directly to a PC serial port? Faustino Dina Cisco 2 08-18-2004 02:30 AM
Re: Serial port and PS/2 port schematics OR Assistive Tech. suggestion naive.verizon@locality.net Computer Support 1 07-10-2003 11:46 AM
Re: Serial port and PS/2 port schematics °Mike° Computer Support 1 07-09-2003 10:30 PM



Advertisments