UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Other Discussions > Homebrew Equipment

Notices

Homebrew Equipment A place to show, design and discuss the weird and wonderful electronic creations from the hands of individual members.

Reply
 
Thread Tools
Old 14th Feb 2021, 9:03 am   #1
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Bristol, UK
Posts: 2,142
Default Help with RS232 needed!

I have a device that talks RS-232 to the rest of the world but it is talking gibberish... I've set up my terminal 4800 8-N-1 as directed, I've tried various forms of flow control but I always get the output shown below. It is a USB - serial interface based on a PL-2303 chip by Prolific.

I'm expecting NMEA-0183 messages like this:

$PRWIRID,12,01.80,11/26/97,0003,*42
$GPGGA,,,,,,0,00,,,,,,,*66
$GPGSA,,,,,,*42
..... etc. ....

Can anyone shed any light? I'm afraid that RS-232 isn't a protocol I'm very familiar with....
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2021-02-14 at 08.36.08.png
Views:	111
Size:	140.7 KB
ID:	226686  
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is offline   Reply With Quote
Old 14th Feb 2021, 9:12 am   #2
Station X
Moderator
 
Station X's Avatar
 
Join Date: Jan 2003
Location: Ipswich, Suffolk, IP4, UK.
Posts: 17,985
Default Re: Help with RS232 needed!

Well at least the two devices are communicating, which is generally the most difficult bit.

I'd try changing the speed at the PC end, the sending device's speed may have been changed.
__________________
Graham. Forum Moderator

Keep the soldering iron hot.
Station X is offline   Reply With Quote
Old 14th Feb 2021, 9:34 am   #3
Malcolm G6ANZ
Heptode
 
Malcolm G6ANZ's Avatar
 
Join Date: Feb 2006
Location: Bristol, UK.
Posts: 836
Default Re: Help with RS232 needed!

I agree with Graham, looks like the baud rate is incorrect. That or the number of data bits is wrong
Malcolm G6ANZ is offline   Reply With Quote
Old 14th Feb 2021, 10:25 am   #4
PJL
Dekatron
 
Join Date: Sep 2005
Location: Seaford, East Sussex, UK.
Posts: 4,896
Default Re: Help with RS232 needed!

Parity bit?
PJL is offline   Reply With Quote
Old 14th Feb 2021, 10:36 am   #5
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Bristol, UK
Posts: 2,142
Default Re: Help with RS232 needed!

I have just now tried every selectable baud rate from 300 up to 57600, I've tried 5,6,7 & 8 data bits; stop bits 1, 1.5 & 2; and even or odd parity. None of that makes the data intelligible!
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is offline   Reply With Quote
Old 14th Feb 2021, 11:05 am   #6
Cobaltblue
Moderator
 
Cobaltblue's Avatar
 
Join Date: Dec 2010
Location: Exeter, Devon and Poole, Dorset UK.
Posts: 4,770
Default Re: Help with RS232 needed!

He have had a lot of trouble with RS232 devices in recent years.

The trouble came down to the drive software being used in modern machines.

Newer machines were simply too fast ISTR it wasn't the bit rate so much as the UART getting hit too often and too fast.

In much older machines there was a physical UART modern PC's its a software UART and that is where the trouble lay.

As the machines have got faster the code that delayed the read and write cycles became increasingly not slow enough.

In our case the code had to be re-written to give the serial device more time and voila problem gone.

Due to legacy requirements in our industry we still support serial coms even on our latest equipment its was an HA now TOPAS requirement.

We mostly use the Lindy RS232 to USB converter.

Cheers

Mike T
__________________
Don't care if it was a bargain why's it in my kitchen
Mike T BVWS member.
www.cossor.co.uk
Cobaltblue is online now   Reply With Quote
Old 14th Feb 2021, 11:22 am   #7
Station X
Moderator
 
Station X's Avatar
 
Join Date: Jan 2003
Location: Ipswich, Suffolk, IP4, UK.
Posts: 17,985
Default Re: Help with RS232 needed!

I have a CNC machine tool dating from the mid eighties which is controlled using RS232 from a PC running windows 7 and I've never seen any problems. I can't remember what the physical interface is at the PC end, but I have an idea it's a card with a couple of serial ports rather than a USB to serial convertor. I'll check.

How about scoping the output from the GPS device to get an idea of speed although syncing might be difficult?
__________________
Graham. Forum Moderator

Keep the soldering iron hot.
Station X is offline   Reply With Quote
Old 14th Feb 2021, 12:54 pm   #8
merlinmaxwell
Dekatron
 
merlinmaxwell's Avatar
 
Join Date: Jul 2008
Location: Maidenhead, Berkshire, UK.
Posts: 10,653
Default Re: Help with RS232 needed!

As it looks like it is a GPS device I reckon the polarity is upside down, 0 to 5V TTL (could be 3.3V, still TTL levels). I have a GPS module in my meter clock connected to a PIC micro without RS232 conversion either end, works a treat. RS232 converters invert the signal, two cancel out and one mucks* it all up. Is there an "invert" function in your terminal software?

*One way of spelling it!
__________________
Cats have staff, it's dogs that have owners.
merlinmaxwell is offline   Reply With Quote
Old 14th Feb 2021, 1:54 pm   #9
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Bristol, UK
Posts: 2,142
Default Re: Help with RS232 needed!

Quote:
Originally Posted by merlinmaxwell View Post
As it looks like it is a GPS device I reckon the polarity is upside down, 0 to 5V TTL (could be 3.3V, still TTL levels). I have a GPS module in my meter clock connected to a PIC micro without RS232 conversion either end, works a treat. RS232 converters invert the signal, two cancel out and one mucks* it all up. Is there an "invert" function in your terminal software?
Terminal doesn't have an invert function!

Looking at the signal on the 'scope, it appears to be negative-going - in other words, the display has a line at the top (+5V) and short pulses downwards towards 0V
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is offline   Reply With Quote
Old 14th Feb 2021, 1:55 pm   #10
ColinB
Heptode
 
ColinB's Avatar
 
Join Date: Apr 2003
Location: Newton Abbot, Devon, UK.
Posts: 694
Default Re: Help with RS232 needed!

Link the TX and RX pins of the USB to serial cable (with the cable disconnected from the far-end device!) This is pins 2 and 3 on a DB9 cable, from memory.

In the terminal program can you type characters and see them echoed back to the screen? If so, the USB to serial cable, the OS and the driver are working (assuming no hardware handshaking etc).
ColinB is offline   Reply With Quote
Old 14th Feb 2021, 2:05 pm   #11
paulsherwin
Moderator
 
paulsherwin's Avatar
 
Join Date: Jun 2003
Location: Oxford, UK
Posts: 21,519
Default Re: Help with RS232 needed!

Colin's advice is good.

I reckon you definitely have a speed / parity / byte length mismatch. From the examples given it looks as if the device data rate is lower than the terminal data rate.
paulsherwin is online now   Reply With Quote
Old 14th Feb 2021, 2:12 pm   #12
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Bristol, UK
Posts: 2,142
Default Re: Help with RS232 needed!

Quote:
Originally Posted by ColinB View Post
Link the TX and RX pins of the USB to serial cable (with the cable disconnected from the far-end device!) This is pins 2 and 3 on a DB9 cable, from memory.

In the terminal program can you type characters and see them echoed back to the screen? If so, the USB to serial cable, the OS and the driver are working (assuming no hardware handshaking etc).
That works! I get characters echoed back but with two rubbish characters on the end - that must be the CR & LF characters.
So, if the cable and adapter is okay, then the output from the GPS must be awry.
Perhaps I'll put an inverter in the signal.

I wonder if the TXD and RXD pins in the GPS device are wrong way around, would that have this effect? Data Out from the GPS receiver is connected via a MAX233 to RXD, Data In is connected to TXD
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is offline   Reply With Quote
Old 14th Feb 2021, 2:23 pm   #13
kellys_eye
Heptode
 
Join Date: Jan 2014
Location: Oban, Scotland, UK.
Posts: 810
Default Re: Help with RS232 needed!

What equipment is the NMEA coming from? Is it NMEA183 or NMEA2k?
kellys_eye is offline   Reply With Quote
Old 14th Feb 2021, 2:23 pm   #14
paulsherwin
Moderator
 
paulsherwin's Avatar
 
Join Date: Jun 2003
Location: Oxford, UK
Posts: 21,519
Default Re: Help with RS232 needed!

I don't think swapping TXD and RXD would have this effect, but it's easy enough to try. Professionals would use a breakout box / line analyser when trying to resolve these sorts of problems, which makes life easier, but for a simple 3 wire connection without modem control you can just use two plugs with wires going to the TXD, RXD and GND pins.
paulsherwin is online now   Reply With Quote
Old 14th Feb 2021, 2:32 pm   #15
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Bristol, UK
Posts: 2,142
Default Re: Help with RS232 needed!

It's NMEA-183, a Navman GPS receiver

I just tried swapping the TX & RX pins, there's no output at all, no characters received at the terminal.

I suppose I'm going to have to try an inverter now :-(

But, wait, I've just read that maybe I can simply take the MAX233 out of the circuit and have the GPS directly drive the RS-232 adapter. It's only on a short cable and it's only running 4800 baud, so there shouldn't be any signal issues....
__________________
Richard

Index:
recursive loop: see recursive loop

Last edited by mole42uk; 14th Feb 2021 at 3:00 pm.
mole42uk is offline   Reply With Quote
Old 14th Feb 2021, 3:47 pm   #16
merlinmaxwell
Dekatron
 
merlinmaxwell's Avatar
 
Join Date: Jul 2008
Location: Maidenhead, Berkshire, UK.
Posts: 10,653
Default Re: Help with RS232 needed!

RS232 has mark as the default state, this is LOW for RS232 and HIGH for TTL serial, so it is inverted (or not inverted if you think about it).

Quote:
But, wait, I've just read that maybe I can simply take the MAX233 out of the circuit and have the GPS directly drive the RS-232 adapter.
Yes, go for it... You only need to lift the output pin and add a jumper, easy.
__________________
Cats have staff, it's dogs that have owners.

Last edited by merlinmaxwell; 14th Feb 2021 at 3:48 pm. Reason: Added a bit
merlinmaxwell is offline   Reply With Quote
Old 14th Feb 2021, 4:17 pm   #17
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Bristol, UK
Posts: 2,142
Default Re: Help with RS232 needed!

Hurrah!
Thanks for all your help, everyone. I've finally achieved two things:

1. I've learned a lot about RS-232 today and how easy it is to understand.

2. I've got the correct output from my GPS receiver. Going back to RTFM, I discovered that the outoput can either talk NMEA-0183 or some other message protocol that isn't defined. Of course, to ensure the receiver starts up in NMEA, a pin has to be held low at start-up.

Now I may start to check that the system is working properly!

Thank you again,
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is offline   Reply With Quote
Old 14th Feb 2021, 4:31 pm   #18
merlinmaxwell
Dekatron
 
merlinmaxwell's Avatar
 
Join Date: Jul 2008
Location: Maidenhead, Berkshire, UK.
Posts: 10,653
Default Re: Help with RS232 needed!

Once some sense comes out of it... fun time!
__________________
Cats have staff, it's dogs that have owners.
merlinmaxwell is offline   Reply With Quote
Old 14th Feb 2021, 4:56 pm   #19
paulsherwin
Moderator
 
paulsherwin's Avatar
 
Join Date: Jun 2003
Location: Oxford, UK
Posts: 21,519
Default Re: Help with RS232 needed!

Quote:
Originally Posted by mole42uk
But, wait, I've just read that maybe I can simply take the MAX233 out of the circuit and have the GPS directly drive the RS-232 adapter. It's only on a short cable and it's only running 4800 baud, so there shouldn't be any signal issues....
It's so long since I did this sort of thing for a living that I've forgotten the specs, but TTL serial comms will go a long way with a screened cable or in an electrically quiet environment. I've certainly run cables to terminals running at 192,000 baud for over 50 metres with no problems at all.
paulsherwin is online now   Reply With Quote
Old 24th Feb 2021, 8:59 am   #20
majoconz
Hexode
 
majoconz's Avatar
 
Join Date: Jan 2008
Location: Palmerston North, New Zealand
Posts: 324
Default Re: Help with RS232 needed!

I have a Navman 1220A marine GPS antenna/receiver that outputs RS232 NMEA183 that is very picky on how you start it up. It wants the 5volt power applied first but without the COM port connected. My receiver COM port goes via a COM to USB adapter which probably has a MAX233 inside of it. Once the receiver has had a few minutes, then I can plug the adapter into another USB port and it works a treat. It doesn't matter whether it goes into cold or warm start, it's always the same. If I don't wait long enough, it takes charge of the mouse which then zooms all over the screen with occasional button presses!
__________________
Cheers - Martin ZL2MC
majoconz is offline   Reply With Quote
Reply

Thread Tools



All times are GMT. The time now is 11:16 pm.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright ©2002 - 2021, Paul Stenning.