Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:56 02 Aug 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 : COM port problems_PICO

Author Message
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 09:26pm 19 Sep 2021
Copy link to clipboard 
Print this post

OK, loaded beta 19.  I have two Picos, the main one is receiving GPS data as well as WIFI from a HC-12 module. The HC-12 is getting weather information from the second Pico. I have the GPS on COM2 Pins 6,7 and the WIFI on COM1 Pins 1,2
Problem is COM1 is receiving data meant for COM2.
I'll see if I can come up with a short piece of code to demonstrate.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7938
Posted: 09:34pm 19 Sep 2021
Copy link to clipboard 
Print this post

It might be an idea to cross connect the ports, COM1 TX to COM2 RX and vice versa then send from one to the other. That would test from the hardware upwards.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 09:52pm 19 Sep 2021
Copy link to clipboard 
Print this post

Is the reverse happening? COM1 data (WIFI) appearing on COM2.

Can you just connect the GPS and test to see if there is activity on both sets of pins with a CRO to eliminate physical crosstalk?

Software people always blame the hardware (and visa-versus)
Its a bugger when you try to be both...

Jim
VK7JH
MMedit
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 10:13pm 19 Sep 2021
Copy link to clipboard 
Print this post

COM2 was working OK.
I had both Com ports open at the same time, I have now altered the code to OPEN and CLOSE as they are needed.
but a different problem
I have
SetPin GP4, GP5, COM2
SetPin GP0, GP1, COM1

and when I run I get
  Quote  > run
[44] Open "COM2:9600" As #1               ' open the GPS serial interface
Error : Pins not set for UART0

Edited 2021-09-20 08:18 by palcal
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1993
Posted: 06:09am 20 Sep 2021
Copy link to clipboard 
Print this post

Well it turned out to be another stupid mistake on my part. I have used two different lots of code one was for GPS the other for weather. Both originally used 'COM1 as #1'. I changed one of them to 'COM2 as #2' but didn't go through the code and change all the instances of #1 to #2.
All now running as it should.
I must also say a big thanks to Geoff and especially Peter for all the hard work.
I'm in my twilight years and without the MM and Pico to play with I don't know where I would be.
Edited 2021-09-20 16:12 by palcal
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7938
Posted: 06:29am 20 Sep 2021
Copy link to clipboard 
Print this post

No need to apologize. :)  These things are certainly good brain exercise and in this case it's doing its job well!

Peter: It would be nice if the error message referred to COM1 rather than UART0. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 07:14am 20 Sep 2021
Copy link to clipboard 
Print this post

Glad its all working now. Following discussion with Geoff we agreed for compatibility with other MMBasic variants to move from COM0/COM1 to COM1/COM2 so making the change was always going to cause a bit of disruption and it wasn't impossible I'd missed something. NO FURTHER CHANGES - PROMISE

  Quote  Peter: It would be nice if the error message referred to COM1 rather than UART0


Will do
 
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