serial pin 0(rx) and 1(tx) help!

Hi, I'm trying to get this little program to work with the pin 0 and 1 of the digital out but is not working. It works with the usb serial port on the board. But when I try to communicate through the serial port using pin 0 and 1, connecting to a RS232 female connector and connect it to the PC, using hyperterminal to monitor the data from the arduino, it doesn't send anything to the hyperterminal. Is there any pin or jumper I need to set to use the pin 0 and 1 for serial communication? Any help would be greatly appreciated. Thanks

int potPin = 1; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor

void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
Serial.begin(9600); // use the serial port to send the values back to the computer
}

void loop() {
val = analogRead(potPin); // read the value from the sensor
Serial.print(val);
Serial.print("\t"); // print the value to the serial port -->204 is the ratio per Volts
digitalWrite(ledPin, HIGH); // turn the ledPin on
delay(val); // stop the program for some time
digitalWrite(ledPin, LOW); // turn the ledPin off
delay(val); // stop the program for some time
}

hi

it won't work the way you're doing it because:

  • pins 0 and 1 are already connected to the FTDI chip, and at least in the case of the FTDI>ArduinoRX conection, the FTDI may influence the serial levels; - more importantly, the levels directly at pin 0/1 are not RS232 levels, they're TTL serial. You need an RS232 driver circuit (MAX232 is the most common) to connect to your Pc's serial port plug.

hope this helps

D

Hi Daniel or anyone that have some inputs into this topic,

So from what I understand, I should have the MAX232 between the PC and pin0(rx) and pin1(tx) of the digital out of the Arduino board?

If I want to get serial RS232 connector working with pin0 and pin1, I should have the following configuration??
pin0 and pin1 --> max232 IC --> PC

that's exactly right. You could also look at the old DB9 Arduino Schematics too, they do the same thing with transistors instead of a MAX232 chip.

You will probably want to build this on a breadboard or something, as you can't have the FTDI chip connected to the MAx232 at the same time, as it will confuse things.

D

Hi Daniel,

Thank-you very much!! I got it working now, took me forever, I hate soldering, but I made one, a max232 chip with a db9 one end and a 4 pin connector in the other end. Try it with the Arduino board and it works perfectly! Thanks again for the help.

P.S. For those that want to build a TTL serial --> RS232 converter, here is a helpful site.

Enjoy