Closed holgerlembke closed 1 year ago
Look at this tool: WormFood's AVR Baud Rate Calculator Ver. 2.1.1 25 , it shows you how the baud rate can work with different system clocks.
The real serial speed what the hardware does at 2 and 4 MHz is 100kbaud. It is not a software issue.
Thanks for the fast response.
I tested 1 MHz with 9600 baud and it works perfectly.
So I assume we have a software serial port that depends on cpu clock, right?
Hmmm. I try to understand the data sheet.
So we have USART hardware and the clock is generated from CPU clock.
So we have USART hardware and the clock is generated from CPU clock.
Yes, you are right. Despite of LGT8F328P has a 32MHz internal clock, the USART uses the CPU clock.
Moin.
I use a LGT8F328P-nano style board.
Setup is spectacular code!
With 1 MHz, 2 MHz and 4 MHz the output is garbage, 8 MHz, 16 MHz and 32 MHz work fine.
I just switch the clock setting (new IDE) and reupload.