UK Vintage Radio Repair and Restoration Discussion Forum

UK Vintage Radio Repair and Restoration Discussion Forum (https://www.vintage-radio.net/forum/index.php)
-   Homebrew Equipment (https://www.vintage-radio.net/forum/forumdisplay.php?f=99)
-   -   Help with RS232 needed! (https://www.vintage-radio.net/forum/showthread.php?t=176546)

mole42uk 14th Feb 2021 10:03 am

Help with RS232 needed!
 
1 Attachment(s)
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....

Station X 14th Feb 2021 10:12 am

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.

Malcolm G6ANZ 14th Feb 2021 10:34 am

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

PJL 14th Feb 2021 11:25 am

Re: Help with RS232 needed!
 
Parity bit?

mole42uk 14th Feb 2021 11:36 am

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!

Cobaltblue 14th Feb 2021 12:05 pm

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

Station X 14th Feb 2021 12:22 pm

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?

Guest 14th Feb 2021 1:54 pm

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!

mole42uk 14th Feb 2021 2:54 pm

Re: Help with RS232 needed!
 
Quote:

Originally Posted by merlinmaxwell (Post 1341799)
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

ColinB 14th Feb 2021 2:55 pm

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).

paulsherwin 14th Feb 2021 3:05 pm

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.

mole42uk 14th Feb 2021 3:12 pm

Re: Help with RS232 needed!
 
Quote:

Originally Posted by ColinB (Post 1341823)
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

kellys_eye 14th Feb 2021 3:23 pm

Re: Help with RS232 needed!
 
What equipment is the NMEA coming from? Is it NMEA183 or NMEA2k?

paulsherwin 14th Feb 2021 3:23 pm

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.

mole42uk 14th Feb 2021 3:32 pm

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....

Guest 14th Feb 2021 4:47 pm

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.

mole42uk 14th Feb 2021 5:17 pm

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,

Guest 14th Feb 2021 5:31 pm

Re: Help with RS232 needed!
 
Once some sense comes out of it... fun time!

paulsherwin 14th Feb 2021 5:56 pm

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.

majoconz 24th Feb 2021 9:59 am

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!


All times are GMT +1. The time now is 11:39 am.

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