Skip to main content
Tweeted twitter.com/StackElectronix/status/1053798160978636800
added 8 characters in body
Source Link
fadedbee
  • 1k
  • 1
  • 12
  • 29

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.

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. (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.

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. (Is 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.

edited tags
Source Link
fadedbee
  • 1k
  • 1
  • 12
  • 29

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, because. (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.

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, because I'm not using a crystal.

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.

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. (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.

edited tags
Source Link
fadedbee
  • 1k
  • 1
  • 12
  • 29

Are an Is the ATMEGA328P's serial baud ratesrate quantised?

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, because I'm not using a crystal.

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 P.S. I'm using GCC on Linux to compile code, and I'm not using Arduino code/IDE.)

Are an ATMEGA328P's serial baud rates quantised?

I'm using an ATMEGA328p, running from its internal oscillator.

If I set the baud rate to 9,600, it outputs serial at 10,220 baud, because I'm not using a crystal.

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.)

Is the ATMEGA328P's serial baud rate quantised?

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, because I'm not using a crystal.

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.

Source Link
fadedbee
  • 1k
  • 1
  • 12
  • 29
Loading