Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:51 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Serial Comms woes...

Author Message
vk5la
Newbie

Joined: 05/03/2017
Location: Australia
Posts: 13
Posted: 10:22am 13 Jan 2019
Copy link to clipboard 
Print this post

Hi all,
Complete beginner alert!
I’m trying to read the output from a Garmin GPS18x LVS into a micromite plus.
This device is NMEA sentences at 4800 baud 5v TTL level out of the box, I’ve not changed it.
I gave up with the micromite so I thought I’d see if the gPS was actually working.
I connected it to terra term via a couple of different USB to serial converters...
I can see the data coming out, but it’s garbage. Unreadable. At any baud. Tried Different data bits, parity, ya da ya da tried it all nothing appears to work. Should se a readable sentence but I just get garbage.
Started at the beginning with a loopback test on the USB to serial converter, that works.
I know I’m connected to the right pin because I can see the garbled data spewing out.

Any suggestions greatly appreciated.
I suppose my next step is to try another GPS unit...?

Cheers
Andy
VK5LA
Andy (VK5LA)
Winkie, S.A.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10572
Posted: 10:33am 13 Jan 2019
Copy link to clipboard 
Print this post

Sounds like the output may be inverted. Get a copy of realterm and use this to invert the data to see if it then makes sense.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 10:36am 13 Jan 2019
Copy link to clipboard 
Print this post

The Garmin GPS18x LVS uses RS232 signalling which is the inverse of the normal TTL signal. See page 88 of the latest Micromite User Manual for an explanation.

You need to open COM1: with the invert option. For example: OPEN "COM1: 4800, INV" AS #1

Geoff
Geoff Graham - http://geoffg.net
 
vk5la
Newbie

Joined: 05/03/2017
Location: Australia
Posts: 13
Posted: 11:30am 13 Jan 2019
Copy link to clipboard 
Print this post

Ok, but does not this code check for inverted data with ",INV"?

For i = 1 To 5
WatchDog 4000
Open "COM1:" + baud(i) As #1
Pause 1000
If Instr(Input$(255, #1), "$GP") > 0 Then Exit Do
Close #1
WatchDog 4000
Open "COM1:" + baud(i) + ",INV" As #1
Pause 1000
If Instr(Input$(255, #1), "$GP") > 0 Then Exit Do
Close #1
Next i

this is from the GPS boat computer V6
of whic I'm trying to connect the Garmin GPS

cheers

Andy (VK5LA)
Winkie, S.A.
 
vk5la
Newbie

Joined: 05/03/2017
Location: Australia
Posts: 13
Posted: 11:55am 13 Jan 2019
Copy link to clipboard 
Print this post

I have also tried Realterm and inverting the data, still garbage at any baud, any setting.

Thanks for the suggestion,
Andy VK5LA
Andy (VK5LA)
Winkie, S.A.
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 12:45pm 13 Jan 2019
Copy link to clipboard 
Print this post

Hi vk5la

with gps, I think that you can't use "instr" instruction. Don't forget that Micromite is an interpreted language, not compiled, and for that each instruction spend more time

The best is to buffered your sentence before you receive CRLF, and after only you can process your buffer
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 02:25pm 13 Jan 2019
Copy link to clipboard 
Print this post

To check the output from the GPS it would be best to simplify the code. The following will echo anything from the GPS to the console. With this you can easily test variations of INV or not, baudrates, stop bits, etc.

OPEN "COM1: 4800, INV" AS #1
DO
PRINT INPUT$(1, #1);
LOOP

Geoff Graham - http://geoffg.net
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 398
Posted: 06:59pm 13 Jan 2019
Copy link to clipboard 
Print this post

I had problems with some cheap chinese GPS modules (based on UBLOX) some days ago.
The problem was that the TX-signal from the module never came down low enough for Micromite Plus to recognize that it was at a low level. Did some experimenting and found that by pulling the TX (on the GPS module) down to ground with a 10k resistor helped. ( 1k resistor was too small. 10k is probably not optimal, but works OK).

It has been running now for 3-4 days w/o problems.

If you have an oscilloscope, check the levels of the signals when the Garmin is connected to Micromite Plus.

I had never any problems like this earlier, when I used standard MicroMites. (Maybe there are some pull-ups active in the Micromite Plus???)

Anyhow, the solution was so simple that I did not bother to investigate further.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 11:04pm 13 Jan 2019
Copy link to clipboard 
Print this post

  Pluto said  Maybe there are some pull-ups active in the Micromite Plus???

Yes, a pullup is enabled (to stop the input from floating).

You can use the CSub CHANGEPIN (included in the MMBasic ZIP) to turn it off.
Geoff Graham - http://geoffg.net
 
vk5la
Newbie

Joined: 05/03/2017
Location: Australia
Posts: 13
Posted: 03:30am 19 Jan 2019
Copy link to clipboard 
Print this post

Hi all,
*Update*

So I tried (thanks Geoff!)this with the GPS connected to the Micromite

OPEN "COM1: 4800, INV" AS #1
DO
PRINT INPUT$(1, #1);
LOOP
and got readable NMEA sentences out - great! My Garmin GPS is obviously working.

Downloaded the SuperClock program, got that to go but it told me that no RTC or GPS was found...Hmmm

But, now it's working?

The only thing I can think of is, is the COM1 port used by the USB connection to the console?
Maybe I had the Micromite connected to the console at the time when it was looking for a GPS...then a reset and not connecting let it get the GPS?

Anyway, thanks for steering me in the right direction, I'm slowly beginning to get a bit of a grasp on these Micromites.
Andy (VK5LA)
Winkie, S.A.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 01:48pm 19 Jan 2019
Copy link to clipboard 
Print this post

  vk5la said  The only thing I can think of is, is the COM1 port used by the USB connection to the console?

No, they are completely separate and independent.
Geoff Graham - http://geoffg.net
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025