I'm using an Arduino Micro and the Ultimate GPS Breakout v3
Arduino 1.0.5
RX on GPS connected to Pin 2 on Micro
TX on GPS connected to Pin 3 on Micro
When I run the "parsing" sketch it compiles and uploads fine but the Serial Monitor only gives me:
Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
Even when the GPS has a fix! (the LED only blinks once every 15 seconds)
When I try to compile the "echo" sketch I get
echo.pde: In function 'void __vector_21()':
echo:96: error: 'UDR0' was not declared in this scope
I noticed that if I changed Tools>Board from Arduino Micro to Arduino Uno it compiles fine.
And I know these sketches work with an Arduino Uno.
What changes do I need to make in order to run these sketches with a Micro?
Thanks.
Ultimate GPS plus Arduino Micro?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Ultimate GPS plus Arduino Micro?
You will probably have to modify the GPS code to run on a micro. It seems the registers are not all implemented on the micro but since I don't use one that is just a guess.
-
- Posts: 564
- Joined: Wed Jun 19, 2013 3:35 am
Re: Ultimate GPS plus Arduino Micro?
Arduino Micro is an ATmega32u4 chip, the same as on a Leonardo.
Are you using the "Leo" example sketches?
Are you using the "Leo" example sketches?
- xykobas3rd
- Posts: 7
- Joined: Sat Mar 10, 2012 7:40 pm
Re: Ultimate GPS plus Arduino Micro?
Interesting.....I was using the default "echo" and "parsing" code.
So I tried "leo_parsing" and changed it from HardwareSerial
to SoftwareSerial with my pin configuration (3 to GPS TX, 2 to GPS RX)
but I kept getting
"Adafruit GPS library basic test!"
I opened "leo_echo" and just changed
to
(to match my original pin configuration)
Upload, and all I got was:
So I tried "leo_parsing" and changed it from HardwareSerial
Code: Select all
// If using software serial, keep these lines enabled
// (you can change the pin numbers to match your wiring):
//SoftwareSerial mySerial(8, 7);
//Adafruit_GPS GPS(&mySerial);
// If using hardware serial, comment
// out the above two lines and enable these two lines instead:
Adafruit_GPS GPS(&Serial1);
HardwareSerial mySerial = Serial1;
Code: Select all
// If using software serial, keep these lines enabled
// (you can change the pin numbers to match your wiring):
SoftwareSerial mySerial(3, 2);
Adafruit_GPS GPS(&mySerial);
// If using hardware serial, comment
// out the above two lines and enable these two lines instead:
//Adafruit_GPS GPS(&Serial1);
//HardwareSerial mySerial = Serial1;
without the usualTime: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
Time: 0:0:0.0
Date: 0/0/200
Fix: 0 quality: 0
"Adafruit GPS library basic test!"
I opened "leo_echo" and just changed
Code: Select all
SoftwareSerial mySerial(8, 7);
Code: Select all
SoftwareSerial mySerial(3, 2);
(to match my original pin configuration)
Upload, and all I got was:
I'm so confused.Get version!
-
- Posts: 564
- Joined: Wed Jun 19, 2013 3:35 am
Re: Ultimate GPS plus Arduino Micro?
Due to the way SoftwareSerial operates, pin 2 cannot be used for RX with Leonardo (32u4).
http://arduino.cc/en/Reference/SoftwareSerial
http://learn.adafruit.com/adafruit-ulti ... n-leonardo
http://arduino.cc/en/Reference/SoftwareSerial
Also, because of the differences between UNO & Leonardo, when attempting the "direct connection" with Leo_echo sketch....you must connect to the pins labelled "RX" & "TX" on the Arduino board.Not all pins on the Leonardo support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
http://learn.adafruit.com/adafruit-ulti ... n-leonardo
- xykobas3rd
- Posts: 7
- Joined: Sat Mar 10, 2012 7:40 pm
Re: Ultimate GPS plus Arduino Micro?
Thank you very much!
I should have realized the Micro was based on the Leonardo and therefore would have different specs than the Uno.
Another quick question:
If I'm not using the serial monitor on a project with this GPS, can I remove the following to speed things up?
And just skip to
Thanks again!
I should have realized the Micro was based on the Leonardo and therefore would have different specs than the Uno.
Another quick question:
If I'm not using the serial monitor on a project with this GPS, can I remove the following to speed things up?
Code: Select all
// if millis() or timer wraps around, we'll just reset it
if (timer > millis()) timer = millis();
// approximately every 2 seconds or so, print out the current stats
if (millis() - timer > 1000) {
timer = millis(); // reset the timer
Code: Select all
if (GPS.fix) {
Thanks again!
Please be positive and constructive with your questions and comments.