Hi,

I am using my cell phone to communicate with a device that has a PIC 12F683 and an HC-06 Bluetooth module (Linvor). Initially, certain parameters are set from the cell phone and then the device goes to sleep. When the device wakes up, it waits to connect to the cell phone. When I connect to the device from the cell phone using the app Blueterm, I get the message "Connected to Linvor". Once I see this message, I type '1' on the phone. When this '1' is received by the device, it executes a subroutine. Here's my question.

Is there a way to detect that the device has been connected to the phone by reading the value of some register of the PIC? If the answer is Yes, then I don't need to type '1' on the phone. The device can check the value of the register to know whether the connection has been established. If there is no connection, it keeps waiting. If the connection has already taken place, the device goes ahead with the next command to be executed.

I am using DEBUGIN and DEBUG for communication at 9600 baud rate, 8 data bits, no parity, 1 stop bit (8N1). 12F683 does not have a hardware USART and hence I will have to rely on software commands like DEBUGIN, DEBUG and SERIN, SEROUT.

Would highly appreciate any help.

Bala