Serial interface characteristics

I'm trying to use a serial motor controller with arduino. The serial interface characteristics are: 9600 bps 8 data bits 1 start bit 1 stop bit non-inverted signals

I'm having some trouble communicating with the module with the TX/RX pins and the Serial.print() function. I have done Serial.begin(9600), but I can find no documentation on setting the number of data bits, start/stop bits, or the non-inverted signal. Does anyone know the characteristics of the serial interface in arduino? do those match with this ones? Or must I somehow modify and use the SoftwareSerial library?

Sounds correct. This is from the wiring_serial.c file in the hardware core folder:

// defaults to 8-bit, no parity, 1 stop bit

Lefty

dsc --

The Hardware Serial library does not support inversion or any configuration beyond N-8-1.

Mikal

9600 bps 8 data bits 1 start bit 1 stop bit non-inverted signals

You have to question what is meant by non-inverted. A serial line can be in two states Mark or Space. Normally for TTL signals Mark is a logic one and space is a zero. On RS232 Mark is -12V and Space is +12V. A serial line normally sits at the Mark state unless it is driven. While it is true the software serial library doesn't support options it is easy enough to hack it to accept an inverted signal.

You have to question what is meant by non-inverted

I assumed inverted meant 0V corresponded to a logic "1". I've been feeding the serial port through a voltage divider, and into my soundcard, so I can somehow debug it. This is the result for the Serial library: no1 - Serial.print(0, BYTE); no2 - Serial.print(255, BYTE); no3 - softserial.print(0, BYTE); no4 - softserial.print(255, BYTE);

44100/9600 = 4.59375, so, aproximately, there's a bit every 4.5 samples, correct? So, as far as I can see, the signals are inverted, and there is NO stop bit. Also, the start sequence looks a bit strange to me, any ideas about that? I probably can manage to hack the SoftSerial library, but certainly not without knowing exactly what I'm doing

there's a bit every 4.5 samples, correct?

Yes but you have probably got an anti aliasing filter on the front end of the sound sampler that is doing strange things to the signal. They certainly do not look correct.

Also your sound system might be AC coupled so that is why it looks like you are getting negative voltages. Were these waveforms taken with the other hardware connected?

If so the negative signals might indicate that your equipment has an RS232 voltage level input which means you would need a chip like the MAX232 to convert your signals from the Arduino to what the motor driver requires.

So, as far as I can see, the signals are inverted

Yes but they look inverted from the normal serial output. Are you sure that the inversion is not in the sound card amplifier. Have you tried measuring a DC voltage, does that come out the right way round?

Are you sure that the inversion is not in the sound card amplifier.

You're right, i've checked and the sound card is indeed inverting the input. I should have remembered to check that-_- After much exasperation, i've decided to move on to I2C interfacing... maybe I should have done that from the beggining, it's working beautifully now. Thanks for all the help!