I used an Arduino Uno and ublox gps neo 8m. The code works and I get every second my location via serial monitor. For finishing the project I bought a Nano every. I uploaded the code but I get once in the ~3 min my location via serial monitor. The Tx lights on the Nano doesnt blink also.
#include <AD9850.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = 0, TXPin = 1;
static const uint32_t GPSBaud = 9600;
const int W_CLK_PIN = 8;
const int FQ_UD_PIN = 9;
const int DATA_PIN = 10;
const int RESET_PIN = 11;
double freq = 1;
double trimFreq = 124999500;
int phase = 0;
unsigned int speed = 0;
TinyGPSPlus gps;
SoftwareSerial ss(RXPin, TXPin);
void setup()
{
Serial.begin(115200);
ss.begin(GPSBaud);
DDS.begin(W_CLK_PIN, FQ_UD_PIN, DATA_PIN, RESET_PIN);
DDS.calibrate(trimFreq);
}
void loop()
{
// Dispatch incoming characters
while (ss.available() > 0)
gps.encode(ss.read());
if (gps.speed.isUpdated())
{
Serial.print(F("SPEED Fix Age="));
Serial.print(gps.speed.age());
Serial.print(F("ms Raw="));
Serial.print(gps.speed.value());
Serial.print(F(" km/h="));
Serial.println(gps.speed.kmph());
speed=gps.speed.kmph();
//calculate the frequency with map()
freq = map(speed, 0, 100, 0, 160);
DDS.setfreq(freq, phase);
}
}
Check your wiring closely for the serial pins. It looks like tx and RX are switched in location from the nano to the Uno. It’s still RX 0 and tx 1 however.
One would have thought Arduino would have picked a better product name than to reuse the word "Nano..."
Combining intelligent hardware peripherals along with the low-power capability of the AVR® core, megaAVR® microcontrollers (MCUs) broaden the effectiveness of your real-time control systems. Devices like the ATmega4809, ATmega4808, ATmega3209 and ATmega3208 offer individualized options for larger memory, pin counts and packages, while devices such as the ATmega1609, ATmega1608, ATmega809 and ATmega808 offer lower memory and pin-count variants. In addition to their easy-to-configure Core Independent Peripherals, all of these devices include a high-speed Analog-to-Digital Converter (ADC) that enables efficient noise reduction. This makes devices in the ATmega4809 family optimal as companion MCUs for complex microprocessor-based systems, or as stand-alone processors in command-and-control environments.
You don't need SoftwareSerial. Pins 0 and 1 are Serial1 on a Nano Every.
This might solve the problem.
Your topic has been moved to the dedicated Nano Every section of the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project.