RN-41/RN-42 Serial Communication Issue

Hello,

I'm using a Teensy 3.1 to transfer data using an RN-41 to an RN-41-EK. Everything worked well for a Baud Rate of 9600, but when I increase the Baud Rate to 115200 and read the output using Realterm, I get gibberish (I'm sending a repeating series of "1," for testing). I was able to communicate using a Baud Rate of 250000 using the Arduino Pro Mini, but for some reason switching over the Teensy 3.1 is not working as well.

My code is attached.

#define BSERIAL Serial3 //Use UART3 to communicate with the RN-41

uint16_t sensorValue1;
uint8_t packet[2];

void setup()
{
BSERIAL.begin(115200); //Begin Serial at 115200
pinMode(2, INPUT); //This pin is for the Bluetooth's RTS
analogReadResolution(16); //Analog Reading Resolution
}

void loop()
{
sensorValue1= analogRead(A0); //Simulate reading an analog pin
sensorValue1=49; //Send a value of "1"
packet[0]=highByte(sensorValue1); //Break into high and low bytes
packet[1]=lowByte(sensorValue1);
while(digitalRead(2)==HIGH) //While the RTS pin is high, do nothing
{
}
if(digitalRead(2)==LOW) //If the RTS is low, meaning the RN-41 is ready to send data
{
BSERIAL.write(packet,sizeof(packet)); //Write the value of "1"
BSERIAL.write(44); //This is a comma to delimit the data
}
}

If anyone has any suggestions, that would be great. Thanks for any help you can provide!

Here is an update on the situation:

I decided to use Serial1, and I also got the same problem. I also switched to a lower Baud Rate (4800), and I'm still getting issues.

This problem is currently baffling to me, so if anyone has any suggestions, that would be greatly appreciated.

Thanks!

  sensorValue1=49; //Send a value of "1"

Or

  sensorValue1='1'; //No stupid comment needed.

but for some reason switching over the Teensy 3.1 is not working as well.

So you figured you'd ask a Chevy question at the Ford dealership, reasoning that all cars have 4 tires? You probably should ask at the pjrc.com site.