This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interface Bluetooth HC-05 with 89S52

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.

Parents
  • 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.

    .-

Reply
  • 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.

    .-

Children