Talk:Serial Programming

Scope
First, all of the items in the table of contents are good topics-- but this book would be HUGE. I'm going to create a Serial communications bookshelf, because I think we need to create several volumes; among them:

Basic Serial Communications
This volume should contain only the basics of serial data communications (and I mean the BASICS-- synchronous, asynchronous, parity, basic RS-232 protocol, and that's it) along with some demo code that will work between two PCs with a null modem cable. The goal should be to avoid overwhelming a novice C programmer who suddenly has to talk to "something on a serial port".

Advanced Serial Communications
This volume should contain stuff that's going to come up for anything beyond simple applications. Cabling limitations should be discussed (why only 50 ft. at 19.2Kbps? capacitance! etc.) Baud rate detection and other advanced concepts go here.

Practical Modem Communications
Should contain that gigantic Hayes AT command set reference we've come up with, along with descriptions and specs for XModem, YModem, YModem-G, ZModem, and, of course, Kermit. Should also cover ASCII/ANSI translation issues. Basically, BBS nostalgia time!

Serial Communications for Microcontrollers
This should cover the implementation of serial communications facilities on microcontrollers that are taken for granted on PCs-- UARTS, FIFOs, etc.-- and should try not to re-cover ground from the previous books. I suggest the PIC16F84 as a micro with a UART, and another Microchip part without a UART to cover implementing one, as reference source code for both cases is available from Microchip.

There is obviously potential overlap here with, say, "Advanced Microcontroller Programming" or "PIC Microcontroller Programming" or whatever we have/will have. ll

Universal Serial Bus Technical Manual
This will take a while, but there's more than enough source material. Should cover cabling, protocol, building small devices around USB "glue" chips and micros, writing basic host-computer drivers, etc. I suggest a simple USB-based LCD controller as the demo project.

I have started writing about the USB technology. It may take a while and I need help. --Grich 09:48, 22 March 2007 (UTC)

Serial ATA Technical Manual
Ouch. Not very many people on the planet have the background to discuss implementing both sides of a Serial ATA chain-- the controller and the drives. We need contacts at Seagate or SerialATA.org for this one...

I'll modify this more soon, no doubt...

-- Breakpoint 26OCT2004

--

Breakpoint (and others),

I have not "abandoned" this book... I've just had some real life issues come up that have pulled me away. Also, I was working on the 8250 UART programming section where it just wasn't flowing the way I wanted it to work. Instead I'm going to try and rewrite that section almost from scratch or try to see what I can get fixed on it. This is the fundimentals of modem communication as well, so really does fall into a major subsection.

I had an original outline that was more to what I originally wanted to accomplish here, but it appears as though there are some others who want to add more to general serial programming in other areas. Much of this added material sort of broke up my outline, so the general structure of this book is suffering right now. That is fine, and certainly I feel that these other topics need to be added, it is just that the book needs to be reorganized a little bit as well.

A direction I wanted to get more into was serial packet communication as well. This was the "core" of what I really wanted to write about, but there is some preliminary information I wanted to get in first, such as raw RS-232 serial communicaion. Eventually I want this to move on to general low-level network communications done over serial data links, as a teaching tool to explain network concepts that normally get taken care of by a Network Interface Card, but can be done "manually" by software that can be written by an undergraduate or even high school student. Perhaps a modified version of this original book I intended should be on the serial data "bookshelf" as one of several books available.

Rob Horning 14:50, 13 Dec 2004 (UTC)

Microcontroller reference?
I am interested in very simple communication schemes -- ones that will run on the tiny microcontrollers that I can buy for less than US$ 2.

I hope that this WikiBook becomes a reference for people who are developing new protocols -- so they can understand *why* previous protocols do it that way, so they can (a) keep the good parts of those protocols, things that turn out to be the best possible way of doing something, while (b) avoiding the icky things in current protocols that turned out, in retrospect, to be bad ideas. Everyone who designs a new ad hoc protocol seems to slam into the same sorts of pitfalls.

A nice reference on RS-232 and RS-485 might be nice; perhaps even extend to USB and FireWire and EtherNet.

-- DavidCary 05:42, 19 Jun 2004 (UTC)

Serial Reference Data sheets
There are some reference materials available for RS-232 communication, but they are both proprietary (involve copyrights) and are reference orientated, which is a lousy way to try and learn a subject. I would like to add an appendix section to this Wiki book that goes over the items discussed as more of a reference work, as that also has value once you learn the information.

Other things I think would be useful would be the 8250 software specs (the typical UART chip on PCs), 8259 programming (the PIC controller and more info about what goes into it), and a similified explaination of TCP/IP packets, compared to the packet systems I'll be showing in these articles.

Right now I'm trying to find a few images that I can use legitimately to show DB-9 and DB-23 male and female plugs.

Rob Horning

other mechanical connectors
I see you've added pictures to Serial Programming:RS-232 Connections. Very nice. Would it be OK to add other mechanical connectors to that page, or should we use a different page ?

Other mechanical connectors:
 * Last week I saw a cable with the standard 9 pin RS-232 plug on one end, and what looked like a stereo jack on the other end to plug into a digital camera.
 * Many people use 2 pins (usually the outer 2 pins) of 4 pin RJ-11 telephone plugs for RS-485 serial communication (AppleTalk)
 * Is there a standard for connecting the TX, RX, GND of RS-232 to the 4 pins of a RJ-11 connector ? Paul Campbell says "I wired the GND to the yellow line, TXD to the black line and RXD to the red line." http://www.taniwha.com/~paul/fc/ass2.0.html
 * I have a cable with the standard 9 pin RS-232 plug on one end, and a tiny connector (2 mm pitch) to plug into my HP calculator on the other end. (Exactly like http://www.engr.uvic.ca/~aschoorl/faq/48faq-12.html and http://www.area48.com/makeacable.html ... not the http://net.supereva.it/enrico.freeweb/cable49g.htm version).

--DavidCary 03:26, 12 Jul 2004 (UTC)

I don't have any problem with trying to add any other connectors. I believe a "DB-15" connector may also have some value.

--Rob Horning

RS-232 on RJ11
The #1 problem with the RJ-11 connector is that it is not even remotely standardized regarding what wires are used for what RS-232 pin values. There are some interesting problems with hooking up an RS-232 line through a home phone network, however. The suggestion that you are making here to connect using a two-wire serial connection (transmit and ground, or ignoring ground altogether) would have some interesting value, as most homes (at least in the USA) are wired with a 4 wire phone system, but usually only two wires are in use with the other two "reserved" for a second phone line. With FCC regulation changes basically granting control of the phone system to the home owner, you are pretty free to do what you want on your phone system, as long as it stays within your home. If it goes on to another building, it starts to get a little more messy in a legal sense. Even more outside the USA.

I would like to propose that we "establish" an RJ-11 wiring standard, if we can't get one that even looks remotely common. This group of wiki pages could even get something simple going that could even be submitted as an RFC, and we could demonstrate that this does have an affect on the internet, so it would be a legitimate fourm for submitting a standard. Much sillier standards are submitted as RFCs, such as IP over carrier pidgeon or the Twelve Nights of the Enterprise (like the Twelve Days of Christmas). This has some real value because it is something that is openly useful and has practical applications. I especially like RJ-11 for RS-232 because it is a very easy wiring system to implement for a home hobbist, and can be used as a "backup network" for normal RS-232 systems. Even better, wouldn't it be nice to have an RJ-11 connector act as a serial connector for a laptop or PDA? Certainly it would be easier to implement than using a traditional male DB-9 connector.

--Rob Horning

The #1 problem with the RJ-11 connector is that it is not even remotely standardized

Not for RS-232. However, it *is* standardized for RS-485 -- The AppleTalk / LonTalk standard.

RS-485 is a small improvement on RS-232 -- most RS-232 equipment (such as my Hayes modem) can directly connect to most RS-485 equipment (such as my Apple Macintosh), with the right adapter cable.

I agree that discussing and proposing standard for RS-232 on RJ11, here in this wikibook, could be useful.

Should we make an article listing the various ways to connect RS-232 to a RJ11 connector ?

--DavidCary 02:46, 15 Aug 2004 (UTC)


 * The "8051 Board" at http://www.ustr.net/offers/index.shtml uses a RJ11 for its RS-232 connector. (Unfortunately I can't tell from the schematic http://www.ustr.net/offers/board1diags.shtml which pin connects to RX, which pin connects to TX, which pin connects to GND, and to what, if anything, the other pin is connected).


 * RJ-11 connector: Paul Campbell says "I wired the GND to the yellow line, TXD to the black line and RXD to the red line." http://www.taniwha.com/~paul/fc/ass2.0.html

it *is* standardized -- how does the w:LonTalk standard compare to the w:LocalTalk standard ? ... See w:RJ-11 for the exact pins used by LocalTalk ... --DavidCary 02:12, 19 May 2005 (UTC)

I just discovered that there *is* a EIA/TIA standard for RS232 on RJ45. Added it to Serial Programming:RS-232 Connections. --65.70.89.241 18:17, 3 July 2006 (UTC)

TODO

 * First thing to do: Create a real list of things to do.


 * http://johnscloset.net/ has some good stuff about Ethernet networking. It says "Copyleft: This site was created to be useful to people, and I have no commercial interests in it. Feel free to take what you need from this site. I'd appreciate being credited." Should I copy it here, or is there a better wikibook or other wiki more appropriate for basic home networking ?


 * http://hardwarebook.net/ has many obscure serial cable and other cable information. It says "Copyright © The Hardware Book Team 1996-2004. May be copied and redistributed, partially or in whole, as appropriate." Has anyone contacted these people for permission to copy big chunks of it here? --DavidCary 02:12, 19 May 2005 (UTC)

related Wikibooks
(Moved from the main page and placed there anonymously):

The difference between is ... um ...
 * Serial Programming:RS-232 Technical Manual
 * Programming:Serial Data Communications

---

I'm going to remark that this difference is mainly because of the following:


 * The two "wikibooks" were written (or at least started) by different authors.
 * They have differnet goals in mind (reference vs. tutorial)
 * Would be complimentary.

This wikibook is a mess right now, partly because there have been a bunch of "cooks" trying to go at this with no coherant strategy. I'm going to try and push forward now that I have a little bit of time on my hands, and get a couple more chapters done. Rob Horning 11:10, 28 May 2005 (UTC)
 * As one of the 'crocks' who contributed a lot of stuff I have just decided that I will leave you and your wikibook alone. You don't want contributes, you won't get contributions from me. Follow your coherent strategy and vision as much as you like. Hint: If you don't want to be disturbed, don't place your oh-so-coherent stuff on a wiki. 85.72.167.26 10:01, 12 Jun 2005 (UTC)
 * I did not suggest that nobody should contribute. The point here was that modules have been added that don't fit in with the flow of the book itself.  It is never my intention anyway to delete anything unless it is obvious spam (subjective, I know) or a substantial rework is done to expand what is said or to fix grammar issue.  That is called editing.  If something is added here that I don't like, I may move it to the serial programming bookshelf directly, but keep in mind that my opinion is as valid as anybody else's.  I am suggesting that before you start a completely new module, to at least read through what has already been done, read the introduction and goals of this wikibook (this is rather substantial), and try to make it fit in with this as a book you might see published in a dead tree format.  Not all of the added content to this wikibook so far meets that standard, IMHO (and that is my opinion).  BTW, I would consider that to be good guidelines for editing just about any Wiki module/article, and try to tread lightly before understanding the community that is putting the content together.Rob Horning 16:31, 24 Jun 2005 (UTC)

I think it might be a good idea to try to merge a couple of half-finished wikibooks, ending up with a three-quarters-finished wikibook. I agree that it's a good idea to distinguish "reference" from "tutorial". But perhaps that would be easier done by breaking the list of chapters on the index page into "introduction", "tutorial", and "advanced reference" sections. I stuck in some "merge" suggestions. If no one objects, I'll start merging them together. (It will be easy enough to split them back apart if we decide it's really too big for a single wikibook, right ?) --DavidCary 16:54, 23 Jun 2005 (UTC)
 * Thanks DavidCary. I came up with this wikibook as an initial concept and started to write content, but it appears as though there is a need to develop more kinds of material for serial data programming.  I love the more general serial data communication bookshelf idea (started by Breakpoint) and I think it could be used better.  The question as I see it is what should be put into the bookshelf as separate items and what could be used in this tutorial?  If this main page is going to be the jumping off point, perhaps it needs to be reworked a bit more.  As a book, I would like this to be (at least as a possibility) something you can thumb through in a dead-tree format as well.  Wikibooks is not Wikipedia, even if the interface looks largly the same. Rob Horning 16:31, 24 Jun 2005 (UTC)

Removing "Stub" Status for the main page
I know that Breakpoint was "concerned" that this set of pages was abandoned, but I hope that the idea of this being abaondoned has been dispelled for at least the moment. My concern at the moment by advertising that this is a work in progress is that it tends to attract vandals and others who are merely intent on random changes rather than trying to read the structure and trying to make something that fits into this book.

For this reason I have removed the stub warning and call for articles. Users can still edit here, and I am encouraging others to help participate, but don't rub in my face (as well as all the other contributors here) that this is a tough, complex, and very technical subject that is going to take time to write material for. I expect that this will take another year or two before it is completely written, and even then there are going to be some changes.

In addition, calling this front page a "stub" is totally wrong. While some sub-modules can correctly be called a stub, as an introduction and table of contents it shows exactly what it is, the introduction to a large wikibook. I feel that this introduction is complete with the vision I have for this book, and while there are some changes that can be made, this is more style than substance.

I do like the % completed remarks that show off how much of the module has been written. I want to keep those marks on the page, and keep them updated as parts of this wikibook get completed.

If there are contributions that you (who are reading this talk page) or anybody else wants to make, please feel free to add to them here. I've tried very hard not to edit or remove anything on here... even obvious vandalism, without reviewing it first and seeing if it is appropriate to be placed here. I may do some moving around of content in the future as I get some more modules completed, particularly when they don't fit into the overall motif of this book I've been trying to work toward. Even then, I'm going to try and keep that content here on Wikibooks in some manner, although it may be moved to another collection of pages.

Rob Horning 13:33, 31 May 2005 (UTC)

Merging with Serial Bookshelf
I think it is a simply stupid idea all around. This is a book, not a bookshelf. I actually supported the idea of a full bookshelf for serial programming, and this book is cluttered with a number of topics like the USB technology and serial ATA hard drives that really merit their own seperate Wikibooks.

I have a roadmap and plan for this book, and that roadmap can be disputed and changed. That is fine. Just don't turn this into a Wikiproject conglomeration and a dumping ground for a bunch of stubs that a bunch of deletionists want to get rid of. Besides, I'm still writing more content even now, and it is progressing along on a snails pace, but I am adding a little bit of content everyday.

IMHO, this move to dump the content is going to destroy the flow and feel of this Wikibook. I don't mind other people working on the stuff I'm writing, but please read the introduction, title page, and a couple of completed chapters before you start dumping other stuff here. Try to harmonize any other additions with the rest of this book and not just throw random stubs around that seem like they need a home.

In short, if the Serial Bookshelf gets merged into this Wikibook, I'm going to have no choice but to make another bookshelf or dump the contents onto the Computer Science bookshelf where perhaps they really do belong. --Rob Horning 04:13, 5 November 2005 (UTC)


 * I have removed the merge notices. See Talk:Serial communications bookshelf. --Kernigh 03:22, 6 November 2005 (UTC)

Book renaming
I am proposing that this book be renamed from its present Programming:Serial Data Communications name to simply Serial Data Communications, with the rest of the modules having a similar renaming occur. If there aren't any objections to this, I'm going to perform this change within a week. Most of this is to conform to the spirt of WB:NP, but there may be other directions we can go as well. I do propose to keep the colon naming convention between modules, and as this is a "grandfathered" book as per the naming policy, it is not against policy to keep this naming format. --Rob Horning 11:33, 5 March 2006 (UTC)


 * Since there has been no major objection, I'm going to go ahead and do some page renaming. I'm still going to preserve the colon naming convention, as it is "grandfathered" in as per WB:NP.  That and I fail to see why the colon naming convention is "illegal" on Wikibooks.  --Rob Horning 14:22, 21 March 2006 (UTC)

Windows ?
There isn't a section on serial port communications using the Windows API.. I'm curious why.


 * Time. Only time and effort.  I plan on writing it fairly soon to be honest.  --Rob Horning 16:02, 27 August 2006 (UTC)

DE9F
I'm amused to see that the connector picture is labled DE9F. I understand the historical context: I'm just not sure about the relevance of that label to this article. Is this the right place for the re-definition of reality on historical lines?

Is that picture actually of a DE9F (a particular part number), or it it really an anonymous '9 pin serial female' connector? If it really is a DE9F, it needs to have a company name associated with the part number. If it has been discontinued under that part number, it needs to have dates. Arcane part numbers are meaningless without a company name.

I tried briefly to look it up: http://www.arrownac.com/ has lots of components described as DB9F, but none described as DE9F. I'm sure that if I looked hard enough, I could find someone willing to sell me a 'DE9F', but that's not really the point is it?.

(david)218.214.148.10


 * There is generally a dash: DE-9. The 'F' means female. Many people erroneously call it a "female DB-9" which is technically incorrect, but since nobody ever puts just 9 pins in the larger DB-size shell it doesn't cause confusion. --66.215.203.188 00:31, 26 November 2006 (UTC)

yet another serial protocol
I thought I was pretty up-to-date on the variety of serial protocols in use, so I was stunned to stumble across yet another serial protocol that I'd never heard of: http://locobuffer.com/ mentions the "LocoNet" system used in some model railroads. --DavidCary 07:44, 3 July 2007 (UTC)