I'm using an ATMEGA328p, running from its internal oscillator (divided by 8 = 1MHz).
I've (roughly) measured the oscillator output, using my Salae logic analyser, as ranging from 960KHz to 1000KHz, so it's not awful. I did this using the "Clock output on PORTB0" fuse.
If I set the baud rate to 9,600, it outputs serial at 10,220 baud. (BecauseIs this because I'm not using a crystal, or because of quantisation?)
If I either increase F_CPU or decrease USART_BAUDRATE, gradually, the output serial baud does not decrease, until it jumps to 8,800 baud.
#define USART_BAUDRATE 9600 #define BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1) int main(void) { // serial port setup UCSR0B |= (1 << RXEN0) | (1 << TXEN0); UCSR0C |= (1 << UCSZ00) | (1 << UCSZ01); UBRR0H = (BAUD_PRESCALE >> 8); UBRR0L = BAUD_PRESCALE; ... Is there some form of quantisation affecting the output baud?
P.S. I'm using GCC on Linux to compile code, and I'm not using Arduino code/IDE.