I’ve been using my Bluesmirf module with a PIC recently (16F876 using hardware UART) and am getting some strange results.
When I use a cable there are no problems, however when I replace the cable with the Bluesmirf it doesn’t work reliably. I have an LED on my board which flashes when a serial character is received by the PIC. It flashes when I connect to the bluetooth serial port from the PC, so the Bluesmirf must be sending something to the PIC when a connection is made. It is this which is confusing my PIC program I think, as the program is listening for characters and jumping to various things depending on the character, a simple command set type thing. I suspect the unknown data is causing it to jump out of my control, as from the connection onwards I can’t get the PIC to respond without a reset. Is this data that it sends upon connect known, so maybe I can add something to ignore it, or shouldn’t I be getting it at all? If I make the connection to the Bluesmirf before the PIC starts listening for my command set, it works ok usually.
Any ideas appreciated!