gauravkothari23
Advanced Member level 2
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.
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.
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.
Code:
#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;
}
dont know what is wrong in this code..
can anybody please let me know how can i do it.