UART registers

25 Nov 2011

I need to play with parity bit to emulate a 9th bit called wakeup bit. On tx I must set parity to 1 (serial::forced1) to the first byte and parity to 0 (serial::forced0) for the remaining bytes.

ps1.format(8,Serial::Forced1,1);

ps1.putc(*s);

wait_ms(1);

ps1.format(8,Serial::Forced0,1);

for(i=1; i<len; i++){

s++;

ps1.putc(*s);

}

thre is a better way to do this? can i avoid waiting 1ms to switch parity? in ansi c I used to write directly to UART registers with outb sentence of, I thinh, io.h

25 Nov 2011

You can address the UART registers directly, using the CMSIS definitions.

Andy Kirkham's notebook page gives a very clear tuturial for this method:

http://mbed.org/users/AjK/notebook/getting-closer-to-the-hardware/

26 Nov 2011

Rod Coleman wrote:

You can address the UART registers directly, using the CMSIS definitions.

Andy Kirkham's notebook page gives a very clear tuturial for this method:

http://mbed.org/users/AjK/notebook/getting-closer-to-the-hardware/

thanks, you show me the way