Troubleshooting USB to Serial adapters...
bill190
Posts: 769
I bought a Staples USB to Serial adapter and it did not work with the Stamp. Of course I wanted to know why... (I've ordered a known working adapter from Parallax.)
I found the technical documentation for the stamp identify and programming (Run) specifications. It is called "BASIC Stamp Programming Protocol" and can be found here...
http://forums.parallax.com/attachment.php?attachmentid=56837
The above document shows that the DTR signal needs to be pulsed and at the same time a Break signal sent...
Then I found a NIFTY serial terminal program (for free) called RealTerm. And I mean NIFTY! This terminal program shows all the signals including Break. You can also set the terminal to·see the data in hex (see all the·control codes sent).
Get that here...
http://realterm.sourceforge.net
Break is a hardware thing. From the above Stamp document...
"A “break” condition is a feature of the RS-232c serial protocol where the transmit pin (TX) is set high for a duration longer than the byte-period of the selected baudrate. This is an exception case to the normal use of the transmit pin. The break condition cannot be emulated! It may seem that transmitting a series of binary 0s will achieve the same effect, however, doing so will still result in each byte being followed by a stop bit; effectively dropping the line low every 1.04 ms."
Anyway my USB to Serial adapter is not sending the break signal like it should! Everything else seemed to be working as it should.
I tested this by installing RealTerm on the laptop with the USB to serial adapter and on a desktop computer. Then connected both computers with a fully wired null serial cable. This has all 9 pins connected. (Some serial cables do not have all pins connected, thus you can't see all the signals like RTS, CTS, DTR, DSR, etc.)
Break could be sent from my desktop, but not received by the laptop. And the laptop could not send a break.
I also tested this between two desktop PC's. These worked fine. I could send a break signal either direction.
And I ran the Stamp identify function from the Stamp Editor and sent that to RealTerm on the other desktop PC. It sent the break as discussed in the above Stamp document.
If you only have a laptop and a USB to serial adapter and want to test it, click on the "Pins" tab of the RealTerm terminal program, then click on the "500ms Break" button. Then if the break is working, the BREAK light in the far right column should light up for a moment. (This did not light up on my laptop with the non-working USB to serial adapter.)
So it can tell if the break signal is being sent or not! Nifty!
Additional reading...
On RS-232 serial signals...
http://en.wikipedia.org/wiki/RS-232
Serial cable wiring...
http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html
·
I found the technical documentation for the stamp identify and programming (Run) specifications. It is called "BASIC Stamp Programming Protocol" and can be found here...
http://forums.parallax.com/attachment.php?attachmentid=56837
The above document shows that the DTR signal needs to be pulsed and at the same time a Break signal sent...
Then I found a NIFTY serial terminal program (for free) called RealTerm. And I mean NIFTY! This terminal program shows all the signals including Break. You can also set the terminal to·see the data in hex (see all the·control codes sent).
Get that here...
http://realterm.sourceforge.net
Break is a hardware thing. From the above Stamp document...
"A “break” condition is a feature of the RS-232c serial protocol where the transmit pin (TX) is set high for a duration longer than the byte-period of the selected baudrate. This is an exception case to the normal use of the transmit pin. The break condition cannot be emulated! It may seem that transmitting a series of binary 0s will achieve the same effect, however, doing so will still result in each byte being followed by a stop bit; effectively dropping the line low every 1.04 ms."
Anyway my USB to Serial adapter is not sending the break signal like it should! Everything else seemed to be working as it should.
I tested this by installing RealTerm on the laptop with the USB to serial adapter and on a desktop computer. Then connected both computers with a fully wired null serial cable. This has all 9 pins connected. (Some serial cables do not have all pins connected, thus you can't see all the signals like RTS, CTS, DTR, DSR, etc.)
Break could be sent from my desktop, but not received by the laptop. And the laptop could not send a break.
I also tested this between two desktop PC's. These worked fine. I could send a break signal either direction.
And I ran the Stamp identify function from the Stamp Editor and sent that to RealTerm on the other desktop PC. It sent the break as discussed in the above Stamp document.
If you only have a laptop and a USB to serial adapter and want to test it, click on the "Pins" tab of the RealTerm terminal program, then click on the "500ms Break" button. Then if the break is working, the BREAK light in the far right column should light up for a moment. (This did not light up on my laptop with the non-working USB to serial adapter.)
So it can tell if the break signal is being sent or not! Nifty!
Additional reading...
On RS-232 serial signals...
http://en.wikipedia.org/wiki/RS-232
Serial cable wiring...
http://www.camiresearch.com/Data_Com_Basics/RS232_standard.html
·
Comments
Yeah, right. It'll still be in my drawer (or bulldozed under LA earthquake rubble) unused 10 years from now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
...and when I returned home, my new Parallax USB to serial adapter was waiting in my mail box!
So I tried that and much better results this time!
The break function works like it should. And it identifies and runs programs on the Stamp like it should. RealTerm shows the break signal now working when I click on the RealTerm break button.
Also another program which I want to use the laptop for (WinALDL) also now can see the serial port (once I moved it to COM 1 via the driver settings). WinALDL can read live data from pre 1996 General Motors vehicles via the OBD 1 ALDL connector located under the steering wheel. So let's see what is going on with my truck computer....
http://technet.microsoft.com/en-us/sysinternals/bb896644.aspx
It is also a great tool for showing serial port activity on a host PC.
Robert
Although I have not done anything with serial·stuff for years... I seem to recall something for this for the old DOS systems? And was it stty for UNIX? (From a LONG time ago...)
Actually when I first had the problem,·I was looking for my "break out box"!
My how things have progressed. No more break out boxes for me!
·