Instructions
316Libraries
© 2013 Conrad Electronic
5.20 RS232
There is a chance to miss received characters when using the polled serial routines, especially
at high baud rates. If this is an issue, please use the interrupt driven serial routines with Serial_In-
it_IRQ() instead of Serial_Init().
Mega
The serial interface can be operated at speeds of up to 230.4 kilo baud. With the functions for the
serial interface the first parameter will indicate the port number (0 or 1). The Mega32 does only
provide one serial interface (0), while the Mega128 does provide two interfaces (0, 1).
AVR32Bit
The C-Control Pro AVR32Bit supports up to 3 serial interfaces with maximum rates to 460.8 kilo
baud. The serial interfaces are enumerated from 0 to 2. The number differs from the naming on the
Atmel AVR32 Microcontroller:
C-Control AVR32Bit
Atmel AVR32
0
USART0
1
USART3
2
USART4
5.20.1 Divider (Mega)
The functions Serial_Init() and Serial_Init_IRQ get a divider value as baudrate parameter. The
baudrate is derived from the processor clock (14,7456 MHz for Mega32, Mega128 and 16 MHz for
Mega128 CAN).
According to the Atmel processor handbook the following formula is used to calculate the divider for
a specified baudrate: