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.

Closed Thread
 
Thread Tools
Old 14th Feb 2021, 10:03 am   #1
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
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:	148
Size:	140.7 KB
ID:	226686  
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is offline  
Old 14th Feb 2021, 10:12 am   #2
Station X
Moderator
 
Station X's Avatar
 
Join Date: Jan 2003
Location: Ipswich, Suffolk, IP4, UK.
Posts: 21,192
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

Reach for your meter before you reach for your soldering iron.
Station X is online now  
Old 14th Feb 2021, 10:34 am   #3
Malcolm G6ANZ
Octode
 
Malcolm G6ANZ's Avatar
 
Join Date: Feb 2006
Location: Bristol, UK.
Posts: 1,030
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  
Old 14th Feb 2021, 11:25 am   #4
PJL
Dekatron
 
Join Date: Sep 2005
Location: Seaford, East Sussex, UK.
Posts: 5,997
Default Re: Help with RS232 needed!

Parity bit?
PJL is offline  
Old 14th Feb 2021, 11:36 am   #5
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
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  
Old 14th Feb 2021, 12:05 pm   #6
Cobaltblue
Moderator
 
Cobaltblue's Avatar
 
Join Date: Dec 2010
Location: Exeter, Devon and Poole, Dorset UK.
Posts: 6,823
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
__________________
Invisible airwaves crackle with life or at least they used to
Mike T BVWS member.
www.cossor.co.uk
Cobaltblue is online now  
Old 14th Feb 2021, 12:22 pm   #7
Station X
Moderator
 
Station X's Avatar
 
Join Date: Jan 2003
Location: Ipswich, Suffolk, IP4, UK.
Posts: 21,192
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

Reach for your meter before you reach for your soldering iron.
Station X is online now  
Old 14th Feb 2021, 1:54 pm   #8
Guest
Guest
 
Posts: n/a
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!
 
Old 14th Feb 2021, 2:54 pm   #9
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
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  
Old 14th Feb 2021, 2:55 pm   #10
ColinB
Heptode
 
ColinB's Avatar
 
Join Date: Apr 2003
Location: Newton Abbot, Devon, UK.
Posts: 759
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 online now  
Old 14th Feb 2021, 3:05 pm   #11
paulsherwin
Moderator
 
paulsherwin's Avatar
 
Join Date: Jun 2003
Location: Oxford, UK
Posts: 27,788
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  
Old 14th Feb 2021, 3:12 pm   #12
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
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  
Old 14th Feb 2021, 3:23 pm   #13
kellys_eye
Octode
 
Join Date: Jan 2014
Location: Oban, Scotland, UK.
Posts: 1,118
Default Re: Help with RS232 needed!

What equipment is the NMEA coming from? Is it NMEA183 or NMEA2k?
kellys_eye is offline  
Old 14th Feb 2021, 3:23 pm   #14
paulsherwin
Moderator
 
paulsherwin's Avatar
 
Join Date: Jun 2003
Location: Oxford, UK
Posts: 27,788
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  
Old 14th Feb 2021, 3:32 pm   #15
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
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 4:00 pm.
mole42uk is offline  
Old 14th Feb 2021, 4:47 pm   #16
Guest
Guest
 
Posts: n/a
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.

Last edited by Guest; 14th Feb 2021 at 4:48 pm. Reason: Added a bit
 
Old 14th Feb 2021, 5:17 pm   #17
mole42uk
Nonode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Resolfen, Wales; and Bristol, England
Posts: 2,588
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  
Old 14th Feb 2021, 5:31 pm   #18
Guest
Guest
 
Posts: n/a
Default Re: Help with RS232 needed!

Once some sense comes out of it... fun time!
 
Old 14th Feb 2021, 5:56 pm   #19
paulsherwin
Moderator
 
paulsherwin's Avatar
 
Join Date: Jun 2003
Location: Oxford, UK
Posts: 27,788
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  
Old 24th Feb 2021, 9:59 am   #20
majoconz
Heptode
 
majoconz's Avatar
 
Join Date: Jan 2008
Location: Ashhurst, Manawatu, New Zealand
Posts: 570
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  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 9:43 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 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.