Hi there is another one,
I have a RS232 device that the only configuration possible is 9600,7,E,1
I already have a working routine for the UART but with 8,N,1
What do I need to change?
this is my Code:
void InitUART0 (void) //UART0 init
{
BCSCTL1 &= ~DIVA0; // ACLK = XT1 / 4 = MCLK / 4
BCSCTL1 |= DIVA1;
UCTL0 = CHAR; //Sart bit, 8 data bits, no parity, 1 stop
UTCTL0 = SSEL0; //ACLK is UART clock
U0BR0 = 0xd0; //2000000:9600=208
U0BR1 = 0x00;
UMCTL0 = 0x00; //no modulation
ME1 |= UTXE0 | URXE0; //enable UART modul
P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD
P3DIR |= BIT4; //enable TXD0 as output
P3DIR &= ~BIT5; //enable RXD0 as input
IE1 |= URXIE0; // Enable USART0 RX interrupt
_EINT(); //enable interrupt
}
I’m using a Olimex Easyweb II (F149) and ImageCraft Compiler
Thanks in advance