Hi, I'm new to the forum but have searched my question but couldn't get useful info, so here goes.
I'm trying to connect the RS232 output from my handheld Garmin 60CSx unit to the Arduino Uno. It displays NMEA data just fine when connected through an RS232 -> USB cable on Hyperterminal, so I know the GPS is receiving satelite info and transmitting at 4800baud to the PC.
My connections are as follows:
RS232 Side Arduino Side
Pin 2 (TX) Pin 0 (RX)
Pin 5 (GND) Pin GND
Using the following code:
#include <string.h>
#include <ctype.h>
// Variables
int RXpin = 0;
int TXpin = 1;
byte IncomingByte;
// Setup
void setup()
{
// Set Pins Up:
pinMode(LEDpin,OUTPUT);
pinMode(RXpin,INPUT);
pinMode(TXpin,OUTPUT);
// Initialise Serial Communication:
Serial.begin(4800);
}
// Program
void loop()
{
// Read Incoming Byte:
if (Serial.available() > 0)
{
IncomingByte = Serial.read();
Serial.print(IncomingByte, BYTE);
}
}
I get nothing but garbage on the serial monitor: i.e. ??§?§?§??§???§??§?§?§??§?§?§§??§??«?åë·q_qYS§?§?§?§?§?§???§?§?§?§??§??§
What am I doing wrong?