Archived

This topic is now archived and is closed to further replies.

Serial Port protocols and data streaming

This topic is 5842 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites