Hi.. i am trying to interface bluetooth module HC-05 with my mobile phone and tryng to send some datas on my mobile phone using 89S52.
#include<regx51.h> char num[4]={"000"}; void main() { TMOD=0x20; //Choosing Timer mode TH1=0xFD; //Selecting Baud Rate SCON=0x50; //Serial mode selection TR1=1; IE=0x90; //Enabling Serial Interrupt while(1); } void ser_intr(void)interrupt 4 { unsigned int i; //Subroutine for Interrupt IE=0x00; for(i=0;i<=2;i++) //Transmitting data { SBUF=num[i]; while(TI==0); TI=0; } IE=0x90; }
i am not able to receive any datas on my phone. dont know what is wrong in this code.. can anybody please let me know how can i do it.
Have you studied the HC-05 documentation to understand how to properly configure it, and the process of getting connected to the phone - prior to actually sending any data?
The device HC-05 bluetooth has to be paired with another HC-05 or an HC-06 device. The HC-05 can act as master or slave. The HC-06 acts as a slave only. These devices must be "paired" with a common code/password to function. Typical smartphones cannot connect to these devices HC-05,HC06 due to protocol authentication.
Options are: a. You can try to use another HC-05 (or HC-06 slave) with your PC to connect to the embedded device(89S52). b. You can use a different approach of external bluetooth device "BLE" with your 89S52. These bluetooth "BLE" devices are compatible with smartphones and have various interfaces to microcontroller as UART, SPI, I2C. These bluetooth "BLE" devices can be used with Android and iOS/iPhone smartphones.
.-
<quote>Typical smartphones cannot connect to these devices HC-05,HC06 due to protocol authentication.</quote>
Can't say anything about the HC-05, but i've never had problems connecting to an HC-06 from anything.
thank you all.... @pope.... you mean to say that HC-06 can easily be connected to any smart phones and can send txt files to your smartphones. if so then can you please guide me for this.
There's masses of information around for these devices.
One article I read was www.instructables.com/.../