Questions about RS232 and arduino.

HI

i have some questions on RS232 communication (acoarding to this http://www.arduino.cc/en/Tutorial/ArduinoSoftwareRS232)

1) can i use arduino's 0rx/1tx pins for this communication? (or even from stand alone atmega328 chip) 2) can i use arduino's analog pins for this communication?

  1. Yes. D0/D1 are TTL level signals, 0 to +5. Prior to a transmission, the Tx line sits low, then goes high for 1-bit as a start, then low = 0 and high = 1, the byte then ends a 0 for the stop bit (assuming you maintain the standand 8,N,1 settings (8 bits, no parity, 1 stop bit). RS232 swings from -(3V to 15V) to +(3V to 15V), sitting at a high level when not active, then dropping low (negative) for the start bit, with low = 1 and high = 0. The MAX232 (or its variants) do the level conversion.
  2. Yes, if you are using the newsoftserial library to create the signals. In that case, the analog pins are treated as digital pins (A0-A5 used as D14-D19). You cannot achieve the higher data rates that the internal hardware UART is capable of. Plenty fast enough for talking to a 4800 bps GPS tho, for example.

You cannot achieve the higher data rates that the internal hardware UART is capable of. Plenty fast enough for talking to a 4800 bps GPS tho, for example.

i cannot use high speed rate when i am using analog pins?

You cannot achieve the higher data rates that the internal hardware UART is capable of.

NewSoftSerial is capable of 115200 baud, which is the highest supported hardware baud rate. The hardware serial port is capable of much higher speeds, but they are not officially supported.

Wow - Does that leave much processing time for other stuff? 115,200 is 8.6uS per bit? With each bit taking some number of commands to write the bit, create the clock hi/lo, repeat. Only have something like 138 clocks to do that for each bit. Reading must be hell on cycle times too.