Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interface Bluetooth HC-05 with 89S52

Status
Not open for further replies.

gauravkothari23

Advanced Member level 2
Joined
Mar 21, 2015
Messages
640
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
6,922
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.
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;
}
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.
 

Interface it with your pc first! Send and receive messages throug phone and pc.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top