Hello, colleagues!
I'm really new in AVR/ATMega, so sorry for my maybe dummy question. The questions are about clocks.
I have ATMega2560V-8AU with 7.3728MHz generator.
I want to use USART. There is a table "22.10 Examples of Baud Rate Setting" in datasheet. I want to setup 9600 8N1 UART. According to table my MCU should be initialized as 47 baud rate (9600/7.3728MHz) in UBBR.
1/9600 = 0.000104166666667Sec = 104msec per 1 bit.
Code written and compiled by AVR-GCC. :)
F_CPU defined as 7372800UL.
But Oscilloscope shows about ~800msec per bit.
Some experiments showed me that being initialized by 6 baud rate value one bit becomes about ~104ms. 6 baud rate value according to table is for 9600bps@1MHz.
I've checked _delay_ms(1000); (by LED) and LED worked about 8 secs. So I've divided time by 8 and tested again _delay_ms(1000/8);. And it was about one second. Then I've undefined F_CPU, got "warning F_CPU..." and _delay_ms(1000); gave me one second of blue LED light. But oscilloscope shows 800msec per one bit with 47 UBBR value.
How should I correctly setup USART and _delay_ms();?