Uart 9Bit

26 Apr 2011

Hello.

Does anyone know how to make a serial-connection with the 9th bit set?

I have to manually set the 9the bit somtimes to 1 and sometimes to 0. I read that the serial-format could only 5-8bits, but i have never seen that i could use a 9th bit. I'm programm on Atmel Atmega's and on them there is Register where i can set the 9th bit.

Is this possible on the mbed (LPC1768) or should i use a SoftwareUart (Does such exist for the mbed)?

regards

muerzi

26 Apr 2011

It's not possible in a standard way, but you can hijack the parity bit for it. Use the LCR register (Parity Select field) to force parity to 0 or 1.

26 Apr 2011

Thanks for the reply.

Nice idea, but i have the following Protocoll 9o1. So i think this would not work like you discribed. Any other ideas?

regards

26 Apr 2011

Yeah, if you need nine bits with parity then you'll probably have to use another way.

26 Apr 2011

You could use a MAX3110,3111 Device, which uses SPI interface. I have had a quick look, and it is possible to send 9 bits. And it has the advantage of level shifting, So no MAX232 required !

Enjoy

Ceri