I have been programming and soldering for a while on a digital compass for my boat. When I added a serial chip and an instance called NMEA to the program, it crashes every time I write a sentence to the NMEA port. I have been using hardware serial upto now, and it writes my nmea sentences beautifully, but the same sentence causes a crash in NMEA. Any idea what might cause this?
#include <Wire.h> //For the compass
#include <SparkFun_SerLCD.h> //for the display
#include <EEPROM.h> //for writing brightness value to EEPROM
#include <string.h> //These two are for Checksum calculatino for the NMEA output
sf_LCD lcd = sf_LCD(7); // desired LCD pin
NewSoftSerial NMEA(0,9); //rx,tx
value = EEPROM.read(addr);
bright = value;
NMEA.begin(4800); //Opens NewSoftSerial port to send NMEA data through pin 9
Now the Serial.print works well, but once I expose NMEA.print, it crashes and restarts void setup().
The rest of the code is not really that important. It's a 2009 with 168 chip, and the code is abt 13K. I don't think RAM is the issue. Any suggestions?