Arduino Forum

Using Arduino => Project Guidance => Topic started by: tdb on Jun 13, 2018, 07:07 pm

Title: Arduino Uno with Bluetooth 2.0 RX/TX
Post by: tdb on Jun 13, 2018, 07:07 pm
I have my Bluetooth 2.0 HC-06 plugged into the pin 0(RX) and 1(TX). When I try to run a sketch I get this error:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x11
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x11
I know it is the plugins to these pins because once I take them out, everything runs fine.
Why are those pins not working?
Title: Re: Arduino Uno with Bluetooth 2.0 RX/TX
Post by: spycatcher2k on Jun 13, 2018, 07:15 pm
Those pins DO work, but they are connected to the USB chip that you use for upload! So you CAN'T use them while uploading!  :)
Title: Re: Arduino Uno with Bluetooth 2.0 RX/TX
Post by: tdb on Jun 14, 2018, 03:48 am
I am running this code and typing AT command but my bluetooth 2.0 isn't responding back.
This is my sketch

#include <SoftwareSerial.h>

SoftwareSerial mySerial(5, 6); // RX, TX

void setup() {

Serial.begin(57600);

//pinMode(9,OUTPUT); digitalWrite(9,HIGH);

Serial.println("Enter AT commands:");

mySerial.begin(57600);

}

void loop()

{

if (mySerial.available())

Serial.write(mySerial.read());

if (Serial.available())

mySerial.write(Serial.read());

}
Title: Re: Arduino Uno with Bluetooth 2.0 RX/TX
Post by: Nick_Pyner on Jun 14, 2018, 04:59 am
Wrong pins, wrong baud rate, wrong code, and probably wrong anything else - including, most certainly, the wrong instructions. The first thing to consider is: do you really need to do this anyway?

You might find the following background notes useful.

http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino
Title: Re: Arduino Uno with Bluetooth 2.0 RX/TX
Post by: tdb on Jun 14, 2018, 05:07 am
But when I use the Rx->TX and TX->RX I cannot run arduino sketches I get the error I described above.
Title: Re: Arduino Uno with Bluetooth 2.0 RX/TX
Post by: Nick_Pyner on Jun 14, 2018, 05:09 am
So, the background notes I provided a link to were of no use to you after all?