hi

i wounder wath baud value i should use with a 32mhz xmega usally i do this with bascom avr baud calculator but it does only goes up to 22mhz and i don't now how to do this

manual.

## baud calculator

it is in the datasheet, look at page 238 in the manual. There is a table titled "Equations for Calculating Baud Rate Register Setting.

The equation is slightly different than that of the traditional AVR's due to a prescaler being present, before the baud rate divisor.

Try this calculator instead.

If bascom don't calculate constant expressions at compile time, then you should chose a programming language, which can do it, e.g. C.

Then simple write down the formula for the baud rate divider and insert your crystal and the wanted baud rate:

#define XTAL 14.756e6 #define BAUD 9600 #define BDIV (uint16_t)(XTAL / BAUD / 16 - 0.5) ) UBRR0H = BDIV >> 8; UBRR0L = BDIV & 0xFF;

I use only ATtiny/ATmega, maybe the formula was different for Xmega.

No need for awkward separate calculator tools.

Peter

thanks glitch it is not so fun to read 445 pages and of some reasons the bokmarks doesn't work on my computer dam crap!!

danni: the formula for the XMEGA is similar, but it has an extra parameter BSCALE.

If you are running at 32MHz, you do not need the BSCALE (at least for normal baud rates)