Baudrate ofset - Arduino Mini Pro 5V 16Mhz

Board: Arduino Mini Pro 5V 16Mhz SparkFun
Software: Arduino 0017, putty terminal on PC
Board selected: 'Arduino Duemilanove w/ 328' (as suggested by SperkFun)

  1. Blink test was downloaded and working fine.
  2. ASCII example sketch on 9600 downloaded fine, but displayed garbage on PC.

To detect framing error ofset I wrote simple cketch

void loop() 
{ 
  for (int i=7000;i<=9000;i++){
  Serial.begin(i);      // send string for each speed
  Serial.print("#");   Serial.print(i);   Serial.println("# - ABCDEFGH"); 
  }
 
while (true) {}
}

I opened serial terminal and resetted Mini Pro.
Display started to show garbage, but soon I got normal readings starting from baudrate 7273 and ending with 8011.

I have modifyed ASCII chart sketch setting baud rate on 7500 and putty terminal to 9600. Now serial output and imput is perfect.

So the ofsett from 9600 on Arduino compared to 9600 on PC is 2100 bauds. Arduino is working slower than expected.

I suspect that there is something wrong with oscylator settings. Other boards (Lilypad, Duemilenove) are working perfectly in sync on any speeds.

Why this is happening? How can I fix that?

Best regards

Janis

You may want to verify that whatever sketch you load is compiled for the correct clock rate (F_CPU). One way to do this is to load a sketch that prints the F_CPU definition.

E.g.

Serial.begin(7500); // assuming this is what you need at 9600 baud
Serial.println(F_CPU);

If F_CPU is defined as 20MHz (rather than 16), this would explain the baudrate issue.

BenF

Thank you for help. Pro Mini is indeed 20 Mhz despite being labeled 16 Mhz. All if working now :slight_smile: