Serial Port protocols and data streaming

Started by
2 comments, last by python_regious 22 years, 4 months ago
Hey, I require information on streaming data from a program that I create to a custom built piece of hardware. The hardware will be attached to the serial port, so that it can receive data from the computer. ( For those that are interested I''m building an embedded processor testbed for writing and debugged programs written for embedded processors ). Specifically, I need to know the protocols that are used for the serial port ( UART? ). Can anyone point me to a website about serial port access and programming? Also, will I need to write my own device drivers for this piece of hardware, or can I "cheat" it by just writing to the port, and not caring about whats there? ( I did that with the parallel port once ). This is still in the design phase, I''m just researching on what ports are viable to use. Thanks in advance, Phil.
If at first you don't succeed, redefine success.
Advertisement
The hardware protocol used is RS-232. A good place to start:
http://www.beyondlogic.org/serial/serial.htm

(note that it''s under "legacy ports"--guess I''m a legacy programmer now).

I''ve done this exact thing (serial control of embedded system) at least on 4 different projects over my career, both in DOS and Windows, so just post any questions you have.

quote:
Also, will I need to write my own device drivers for this piece of hardware, or can I "cheat" it by just writing to the port, and not caring about whats there? ( I did that with the parallel port once ).

Depends on the OS. No cheating in Windows (does not allow direct access to hardware ports), but the Win32 API does allow you total control of the windows serial driver.
Thanks for the site, it''s a gold mine

quote:Original post by Stoffel

I''ve done this exact thing (serial control of embedded system) at least on 4 different projects over my career, both in DOS and Windows, so just post any questions you have.



Cheers, I may just do that

Thanks again,

Phil.

If at first you don't succeed, redefine success.
I just finished writing a device driver for a UART chip (and I''ve written them for 2 other different chips as well).

It''s a very simple process, regardless whether your polling or using interrupts.

Basically you''ll want all you''ll need to interface the hardware is 4 functions: UARTinit(BaudRate), UARTputChar(Character), UARTpoll(), and UARTgetChar().
And those functions basically (besides init) will check a bit on a register (to see if chip is ready for read/write), then either write to a register, or read from a register.

Simple.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

This topic is closed to new replies.

Advertisement