ArduinoBT can't upload code anymore

I have an Arduino BT board here and I'm trying to set up some simple data transfer app. from the Arduino to a PC.

I wanted to change the baud rate between the PC and the BT module so I followed the initialization code but changed the line below to use 9600 baud.

  Serial.println("SET CONTROL BAUD 115200,8n1");      //first release 19200

Now when I try to upload code avrdude throws and error.

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I can still pair with the Arduino BT module but nothing else seems to be working.

I'm guessing this wasn't the correct way to change the baud rate?

The Arduino BT page says that serial communication between the ATMega168 and the BT module needs to be 115200 but now I've set it to 9600 in setup(). Is this why it won't program anymore?

How can I reprogram it again?

Edit: I've checked the board and COM settings and I've also tried pressing reset and clicking the upload at the same time. It didn't work.

I think I realized what I did wrong.

I also used SET BT NAME so when it resets my PC is paired with the new name and not the default one so the PC can't connect until my program has run. Is this what might have happened?

Is there any way to reprogam it through USB or something?

Hi rob2687,

you have found one of around 4 ways to lock you out from the Arduino-BT :slight_smile:

Never change the baud rate between the ATmega and the WT-11!

To fix it in this state, you need either a FTDI serial chip or an Arduino Duemilanove.

With the Duemilanove, follow these steps:

  1. Set a jumper between pins 5+6 (Reset+GND) of the ICSP connector on the Arduino Duemilanove. This puts the TX line of the ATmega to a high impedance state.

  2. Set a jumper between pins 5+6 (Reset+GND+Reset) of the ICSP connector on the Arduino-BT

  3. Connect some pins between the two Arduinos:

Arduino-BT Duemilanove
RX (PD0) => TX (PD1)
TX (PD1) <= RX (PD0)
GND = GND
  1. Connect the power cable to the Arduino-BT

  2. Connect the USB cable between the Arduino Duemilanove and your PC

  3. Start a terminal programmme (I use putty, you can also use Hyperterminal) and set the baud rate to the baud rate of your Arduino-BT which is normally 115200 but in your case it is 9600. Type the command (you won’t see what you type):

SET

to see if your connection is working. It shows the most important settings.

  1. Type the following commands in the terminal window:
SET CONTROL BAUD 115200,8n1

Now you have to switch the baud rate of ther terminal programme to 115200.

  1. Optionally: Define a pin to restore some default settings.
    On a low-high edge on the WT-11 pin PIO5 (bit 5 = mask 0x20), all these commands are executed and restore the default config:
SET CONTROL BIND 1 20 RISE SET BT AUTH * 12345
SET CONTROL BIND 2 20 RISE SET CONTROL BAUD 115200,8n1
SET CONTROL BIND 3 20 RISE SET BT PAGEMODE 3 2000 1
SET CONTROL BIND 4 20 RISE SET BT ROLE 0 f 7d00
SET CONTROL BIND 5 20 RISE SET CONTROL ECHO 0
SET CONTROL BIND 6 20 RISE SET CONTROL ESCAPE - 00 1
SET CONTROL BIND 7 20 RISE SET CONTROL CONFIG 102D
  1. Optionally you can send the following command to enable the Over-The-Air provisioning via Bluetooth. This means you don’t need a cable for sending commands, but you can open a second serial bluetooth connection to the Arduino-BT command channel:
SET PROFILE OTA on

To disable it, use

SET PROFILE OTA
  1. When you are finished, don’t forget to remove the jumpers

Michael