Problems read/write serial on Arduino Mini Pro

Hi,

I am using an Arduino Mini Pro for a couple of months now and everything worked fine. I used to communicate with a bluetooth gold mate. Yesterday I updated my program and my program wasn’t working anymore. When investigating about it I noticed that my Arduino was speaking a new language. :neutral:

I tried a minimal program that just sends back the byte it receives and the problem occurs.

void setup()
{
  Serial.begin(9600);
}

void loop() 
{
  byte b;

  if (Serial.available()) 
  {
    b = Serial.read();
    Serial.write(b);
  }
}

For instance if I send ‘a’ (hex 61), I receive F8 as an answer. I also receive F8 for ‘z’, FE for ‘e’ and so on. I used to have similar problems in the past when the baud rate used in the program didn’t match with the baud rate in the serial monitor or any terminal application. I check it is not the case. I also had this problem when the bluetooth board was configured to use a specific baud rate. However I experience the problem with the direct serial cable, and with the USB + FTDI board.

Here is a screenshot of the Arduino IDE, and the terminal (red = what I send (character + hex), yellow = what I receive).

http://img221.imageshack.us/img221/5729/pbarduino.png

I tried the same program on another board (5V 16Mhz instead of 3.3V 8Mhz) and the problem doesn’t occur.

So, is anything wrong with my board? What should I do, restore the bootloader? How can I do that?

It is a very important project, and it hurries very much. I also have an Arduino Uno, a Nano v3 and even a Lilypad at hand, but I can only use a mini pro 3.3V for this project. If I don’t find a solution today I will have to buy a new one and I will lose precious time with soldering and so on.

I thank you for your help in advance.

OK I solved the problem. I didn’t change the type of board back, it was still configured for my Arduino Nano. I spent a stressful night because of this but thankfully it is solved.

I hope it will help scatterbrain people like me in the future. :slight_smile: