STM32F103C8 and NEO-M6N gps module

What are you developing?
jxid
Posts: 17
Joined: Sun Apr 05, 2020 12:27 pm
Answers: 1

STM32F103C8 and NEO-M6N gps module

Post by jxid »

Hi to all
i am working on a project with an STM32F103C8 and a GPS Module M6N.
I am using Arduino IDE and the code below:

Code: Select all

#include <TinyGPS++.h>

TinyGPSPlus gps;  

void setup() {
    Serial1.begin(9600);
    Serial.begin(115200);
}

void loop() {
  while (Serial1.available()>0)
  gps.encode(Serial1.read());
  unsigned long start;
  double lat_val, lng_val;
  bool loc_valid;
  lat_val = gps.location.lat();
  loc_valid = gps.location.isValid(); 
  lng_val = gps.location.lng();

  if (!loc_valid)
  {
    Serial.println("No Valid GPS Data");
    delay(5000);
  }
  else                             
  {    
    Serial.println("GPS READING: ");
    Serial.print("Latitude : ");
    Serial.println(lat_val, 3); 
    Serial.print("Longitude : ");
    Serial.println(lng_val, 3);
    delay(2000);   

}
}
My connections are:

GPS Module----STM32
=====================
VCC-----------5V
GND-----------GND
TX-------------PA10
RX-------------PA9

The problem is that i can not get any data in my Serial monitor.
Can anyone help me?
Thank you,
Yannis
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: STM32F103C8 and NEO-M6N gps module

Post by stevestrong »

Do you have the USB serial driver installed?
jxid
Posts: 17
Joined: Sun Apr 05, 2020 12:27 pm
Answers: 1

Re: STM32F103C8 and NEO-M6N gps module

Post by jxid »

What driver do you mean?
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: STM32F103C8 and NEO-M6N gps module

Post by Pito »

Add the test for Serial (usb)..

Code: Select all

void setup() {
    Serial1.begin(9600);
    Serial.begin(115200);
    delay(2000);
    Serial.println("GPS NEO6N starts..");
}
What do you get now?
Pukao Hats Cleaning Services Ltd.
jxid
Posts: 17
Joined: Sun Apr 05, 2020 12:27 pm
Answers: 1

Re: STM32F103C8 and NEO-M6N gps module

Post by jxid »

I get:

Code: Select all

GPS NEO6N starts..
No Valid GPS Data
No Valid GPS Data
No Valid GPS Data
That means that the Serial works fine and prints everything.
But as i can understand i don't get the Serial1 (TX,RX) data to the serial monitor.
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: STM32F103C8 and NEO-M6N gps module

Post by Pito »

Doublecheck Rx/Tx lines (I always put 470ohm resistors in series with both rx/tx in case I messed up the wiring, btw).
Also doubleckeck whether Neo6 is in binary mode (there are two modes afaik, text and binary).
Pukao Hats Cleaning Services Ltd.
jxid
Posts: 17
Joined: Sun Apr 05, 2020 12:27 pm
Answers: 1

Re: STM32F103C8 and NEO-M6N gps module

Post by jxid »

Thanks for the interest and your help Pito.
Rx and Tx lines are OK.
But how to check if the Neo6 is in binary mode?
Also is there any way to see what i get in Serial1 port?
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: STM32F103C8 and NEO-M6N gps module

Post by Pito »

Fastest way - you may add LEDs (via 1k resistors) on the RX and TX lines of the Serial1.
Active is low with serial.
Vcc--[1k]--|>|----RX/TX
You will see blinks when data on Rx or Tx

Btw is your NEO6 5V or 3.3V??
Last edited by Pito on Sun Apr 05, 2020 4:16 pm, edited 1 time in total.
Pukao Hats Cleaning Services Ltd.
jxid
Posts: 17
Joined: Sun Apr 05, 2020 12:27 pm
Answers: 1

Re: STM32F103C8 and NEO-M6N gps module

Post by jxid »

Pito wrote: Sun Apr 05, 2020 3:57 pm Doublecheck Rx/Tx lines (I always put 470ohm resistors in series with both rx/tx in case I messed up the wiring, btw).
Also doubleckeck whether Neo6 is in binary mode (there are two modes afaik, text and binary).
By the way Pito have you ever manage to make Neo-M6N to get work with STM32 board?
I have manage to get work M6N,M7N,M8N modules with Arduino UNO, ESP32, and ESP8266 in the past but never with STM32 board.
I would apreciate if you can post a working code for STM32 and M6N module.
jxid
Posts: 17
Joined: Sun Apr 05, 2020 12:27 pm
Answers: 1

Re: STM32F103C8 and NEO-M6N gps module

Post by jxid »

Pito wrote: Sun Apr 05, 2020 4:11 pm Fastest way - you may add LEDs (via 1k resistors) on the RX and TX lines of the Serial1.
Active is low with serial.
Vcc--[1k]--|>|----RX/TX

Btw is your NEO6 5V or 3.3V??
Thanks for the tip.
My module is a 5V.
Post Reply

Return to “Projects”