Arduino Mega Serial Port Settings

Is there a way to change the number of data bits and parity that the Arduino Mega serial ports use to communicate? I'd like to communicate with a Roboteq motor controller which is stuck at 7 data bits and even parity. I know the Arduino's baud rate can certainly be changed, but I couldn't find any documentation on how to change the other RS232 settings.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • From the AT2560 datasheet, it looks like the UCSZn2 bit in register UCSRnB and UCSZn1 and UCSZn0 bits in register UCSRnC can be used to specify the frame size. Of course, if anyone has an easier suggestion (perhaps there's a function call that will do this?) I'm definitely interested!

This reply was deleted.

Activity