Question

Having a couple of issues with what I was hoping to be fairly straight forward.

I've been transmitting data from my PIC to a PC via RS232 at a baudrate of 115200. I've recently got a RN-41 bluetooth module and was hoping the switch would be as simple as powering the module and connecting the PIC TX (via a max3232) to the RN-41's RX, as the online community has led me to believe.

I'm able to connect to it and pair it to the computer, I'm also able to use PUTTY/Realterm to change the parameters, like the name and baudrate. Finally, by connecting a link to the RX and TX on the bluetooth module and powering it, I'm able to ping text by sending and echoing it using PUTTY, so I'm fairly sure the module isn't broken.

However, when I try to transmit my data from the PIC to the bluetooth module, and view it using realterm (which was working fine with the wired connection) I'm getting data received, but it's not what is expected. I'm expecting a packet of 25 bytes, with a header value of 2, I'm getting around 12-15 bytes and a header of -65.

The first value, -65, is always the same, and the other data can change, which really suggests a baudrate problem, but I've tried a variety of baudrates (changed in my UART code, the bluetooth parameters, and in realterm), and the data doesn't change at all; always wrong.

What have I missed? Anything I need to change in the Bluetooth configurations? I've also checked the parity bit, stop bit, etc, all the same as each other.

Was it helpful?

Solution

The problem was the MAX3232 circuitry. It was necessary for the RS232 connection I was using prior, but when I wanted Bluetooth, which required TTL signals, I was feeding it the same RS232 data!

Making a link straight from the PIC to the Bluetooth receiver solved this problem. Hope this helps someone else in the future!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top