Baud 1200
From: terry (leonlai2k_at_yahoo.com)
Date: 11/29/04
- Previous message: Michael Noone: "very new to embedded programming - can you look at my code for an AVR?"
- Next in thread: Magnus J: "Re: Baud 1200"
- Reply: Magnus J: "Re: Baud 1200"
- Reply: Unbeliever: "Re: Baud 1200"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Nov 2004 23:34:20 -0800
Hi,
I used ATMega16 UART to communicate with a target device which is of
baud 1200 but failed. I then tried to communicate the UART with PC COM
Port and terminal software. I found the communication is OK when the
baud is from 115200 down to 2400. But straight characters appear when
the baud rate turns to 1200.
My baud setting function is:
void uartSetBaudRate(u32 baudrate)
{
u16 bauddiv=F_CPU/baudrate/16L-1;
outb(UBRRL, bauddiv);
outb(UBRRH, bauddiv>>8);
}
Do anyone has my similar problem? The MCU clock speed is 7.3728MHz.
Thanks!
- Previous message: Michael Noone: "very new to embedded programming - can you look at my code for an AVR?"
- Next in thread: Magnus J: "Re: Baud 1200"
- Reply: Magnus J: "Re: Baud 1200"
- Reply: Unbeliever: "Re: Baud 1200"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|