I am moving a program from a Mega2560 to Teensy 3.5 and have discovered a very very strange issue to do with serial comms - specifically the behaviour when trying to make changes to the Ublox GPS chip through U-center. (I had problems writing the direct commands first, but have removed all my code completely from the situation and have replicated the problem with just this code and U-center.
When this code runs using hardwareserial1 on the Mega2560, it works fine and I can send commands through U-center to the GPS chip.
When the very same code runs on the Teensy 3.5 it looks ok to start with - U-center gets a connection, reads alll the NMEA just fine, viewing the serial direct shows complete sentences etc... However I cannot successfully make any config changes to the GPS through U-center. The binary view in U-center shows the command going out, but I can't see any acknowledgements from the GPS, not even an error. I have triple checked the RX is connected and working - both continuity from the pin on the GPS to the pin on the Teensy, and serial to another arduino.
I'm utterly stumped. It looks like the Serial on the Teensy is behaving differently enough from that of the Mega2560 to break transmit somehow _ I know that sounds stupid!
I am using 115200 from the arduino to PC (USBserial), and have replicated the issue at 9600, 19200 and 115200 on the GPS comms on HWserial1. (changes made through the mega2560)
Merry Xmas!!!
Cheers - N
Code:
void setup()
{
Serial.begin(115200); // communication with the host computer
Serial1.begin(9600);
}
void loop()
{
if ( Serial1.available() ) {
Serial.write( Serial1.read() );
}
if ( Serial.available() ) {
Serial1.write( Serial.read() );
}
}
When this code runs using hardwareserial1 on the Mega2560, it works fine and I can send commands through U-center to the GPS chip.
When the very same code runs on the Teensy 3.5 it looks ok to start with - U-center gets a connection, reads alll the NMEA just fine, viewing the serial direct shows complete sentences etc... However I cannot successfully make any config changes to the GPS through U-center. The binary view in U-center shows the command going out, but I can't see any acknowledgements from the GPS, not even an error. I have triple checked the RX is connected and working - both continuity from the pin on the GPS to the pin on the Teensy, and serial to another arduino.
I'm utterly stumped. It looks like the Serial on the Teensy is behaving differently enough from that of the Mega2560 to break transmit somehow _ I know that sounds stupid!
I am using 115200 from the arduino to PC (USBserial), and have replicated the issue at 9600, 19200 and 115200 on the GPS comms on HWserial1. (changes made through the mega2560)
Merry Xmas!!!
Cheers - N