EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / XBEE interfacing with 8051

XBEE interfacing with 8051

|

Microcontroller › 8051 › XBEE interfacing with 8051

  • This topic has 19 replies, 7 voices, and was last updated 9 years ago by hanumanth.
Viewing 5 posts - 16 through 20 (of 20 total)
← 1 2
  • Author
    Posts
  • November 17, 2013 at 5:59 pm #10615
    buddha
    Participant

    dear sir,

                thanks for ur reply…as am using mplab 6.62 version as compiler but i could not convert my code into hex code…somehow error comes to it.as i am new to use mplab and i have seen mplab user guid as well but dont understand how to do it..as this is code..

    .this is for trasmitter.

    #include <16F73.h>
     
    #use delay(clock=20000000)
     
    #use  rs232  (baud = 9600, xmit=PIN_B0,rcv=PIN_B1,stream=WIRELESS) // WIRELESS communication
     
     
    unsigned long x_coord, y_coord;   
     
    void send_data(char sdata[])
    {
        fputs(sdata,WIRELESS);    
    }
     
     
    unsigned long GetX()
    {
       unsigned long result;   
       set_adc_channel(0);
       output_low(PIN_A2);
       output_high(PIN_A3);   
       result = read_adc();
       return result;   
    }
     
    unsigned long GetY()
    {
       unsigned long result;   
       set_adc_channel(1);
       output_low(PIN_A3);
       output_high(PIN_A2);
       result = read_adc();
       return result;   
    }
     
    void main()
    {
       char text[25];
      
       output_high(PIN_C4);
       delay_ms(1000);
       output_low(PIN_C4);
       delay_ms(1000);
       output_high(PIN_C4);
       delay_ms(1000);
       output_low(PIN_C4);
      
      
        while(1)
        {
        
          x_coord = GetX();      //get X- coordinates of touched location on to variable x_coord
         
          y_coord = GetY();   //Get the Y-coordingates of touched location
     
         
         
          if((x_coord > 25) && (x_coord < 85) && (y_coord > 25) && (y_coord < 125))
          {
             sprintf(text,”1″);
             send_data(text);
             output_high(PIN_C4);
          }
          else if((x_coord > 25) && (x_coord < 85) && (y_coord > 150) && (y_coord < 240))
          {
             sprintf(text,”2″);
             send_data(text);
             output_high(PIN_C4);
          }
         
          else if((x_coord > 90) && (x_coord < 140) && (y_coord > 25) && (y_coord < 125))
          {
             sprintf(text,”3″);
             send_data(text);
             output_high(PIN_C4);
          }
          else if((x_coord > 90) && (x_coord < 140) && (y_coord > 150) && (y_coord < 240))
          {
             sprintf(text,”4″);
             send_data(text);
             output_high(PIN_C4);
          }
          else if((x_coord > 145) && (x_coord < 190) && (y_coord > 25) && (y_coord < 125))
          { 
             sprintf(text,”5″);
             send_data(text);
             output_high(PIN_C4);
          }
          else if((x_coord > 145) && (x_coord < 190) && (y_coord > 150) && (y_coord < 240))
          {
             sprintf(text,”6″);
             send_data(text);
             output_high(PIN_C4);
          }
          else if((x_coord > 195) && (x_coord < 250) && (y_coord > 25) && (y_coord < 125))
          {
             output_high(PIN_C3); //LED Lamp ON
          
          }
          else if((x_coord > 195) && (x_coord < 250) && (y_coord > 150) && (y_coord < 240))
          {
             output_low(PIN_C3);  //LED Lamp OFF
          }     
          delay_ms(100);
          output_low(PIN_C4);  
        }
    }
     
     
    this is for recever.
    #include <16F73.h>
     
    #use delay(clock=20000000) //crystal oscillator
     
    #use  rs232  (baud = 9600, xmit=PIN_B1,rcv=PIN_B0,stream=WIRELESS) // WIRELESS communication
     
    #include <nokiaGLCD.c> //For Nokia Graphical LCD
     
    void main()
    {
       char text[25]; //For capturing the text
       char ch;
     
      
       //Following code is for Health Check (microcontroller)
       output_high(PIN_C4);  //LED ON
       delay_ms(1000);
       output_low(PIN_C4);   //LED OFF
       delay_ms(1000);
       output_high(PIN_C4);  //LED ON
       delay_ms(1000);
       output_low(PIN_C4);   //LED OFF
      
       nokia_init();  //Initialise Nokia GLCD
     
       //Nokia LCD got 6 row and 21 columns
      
       nokia_clear_screen();  //Clear the screen contents
       
       nokia_gotoxy(2,1);  //Go to row number-1 and column number 2
       
       sprintf(text,” TOUCH SCREEN”);  //this copies the text “TOUCH SCREEN” into the variable text.
       
       printf(nokia_printchar,”%s”,text); //Print the text on to LCD
       
       delay_ms(1000);  //wait for 1000 milli seconds
      
       nokia_gotoxy(2,3);  //third row second column
       sprintf(text,”  AIR LINES”);  //copies the text into text variable
       printf(nokia_printchar,”%s”,text);
       delay_ms(500);
         
       nokia_gotoxy(2,5);  //Fifth row and second column
       sprintf(text,”  ASSISTANT”);
       printf(nokia_printchar,”%s”,text);
       delay_ms(2000);
      
      
       nokia_clear_screen(); //clear LCD contents
       nokia_gotoxy(3,3);
       sprintf(text,”*** READY ***”);
       printf(nokia_printchar,”%s”,text);
       delay_ms(1000);
      
             
       while(1) //Infinite loop starts here
       {        
          
             if(!input(PIN_A0))  //If the clear button pressed, then clear the requests on LCD
             {
                output_high(PIN_C3); 
                delay_ms(500); //Long Beep
                output_low(PIN_C3);   
               
                nokia_clear_screen();
                nokia_gotoxy(4,1);
                printf(nokia_printchar,”     NO”);
                nokia_gotoxy(4,3);
                printf(nokia_printchar,”   PENDING”);
                nokia_gotoxy(4,5);
                printf(nokia_printchar,”  REQUESTS”);
                output_low(PIN_C4);
             }
          
          
           ch = fgetc(WIRELESS);  //get character
           
           nokia_clear_screen(); // clear Nokia screen LCD
          
           nokia_gotoxy(1,1);
           printf(nokia_printchar,” SEAT NO: A9″);
           output_high(PIN_C4); //LED ON
           switch(ch)   //switch to the block based on character received.
           {
             case ‘1’:
                      nokia_gotoxy(4,3);
                      printf(nokia_printchar,”  REQUESTING”);
                      nokia_gotoxy(4,5);
                      printf(nokia_printchar,”    WATER”);
                      break;
                     
             case ‘2’:                 
                      nokia_gotoxy(4,3);
                      printf(nokia_printchar,”  REQUESTING”);
                      nokia_gotoxy(4,5);
                      printf(nokia_printchar,”     FOOD”);
                      break;
                     
             case ‘3’:                 
                      nokia_gotoxy(4,3);
                      printf(nokia_printchar,”  REQUESTING”);
                      nokia_gotoxy(4,5);
                      printf(nokia_printchar,”   MEDICINE”);
                      break;
                     
             case ‘4’:                 
                      nokia_gotoxy(4,3);
                      printf(nokia_printchar,”  REQUESTING”);
                      nokia_gotoxy(4,5);
                      printf(nokia_printchar,”   BED SHEET”);
                      break;
             case ‘5’:                 
                      nokia_gotoxy(4,3);
                      printf(nokia_printchar,”  REQUESTING”);
                      nokia_gotoxy(4,5);
                      printf(nokia_printchar,”    SNACKS”);
                      break;
             case ‘6’:                 
                      nokia_gotoxy(4,3);
                      printf(nokia_printchar,”  REQUESTING”);
                      nokia_gotoxy(4,5);
                      printf(nokia_printchar,”   MAGAZINE”);
                      break;
           } //end of switch statement       
       }
    }
     
    November 19, 2013 at 5:06 am #10617
    AJISH ALFRED
    Participant

    Hi,

    Please copy paste the compiler output message here , so that I can easily find out the errors in the code.

    February 7, 2014 at 5:37 pm #10974
    prakash gupta
    Participant

    hello friends,

                      i m a final year student and i am working under major project where the project aim is…..

                          

                     

        ” XBEE BASED REMOTE MONITORING OF 3 PARAMETERS ON TRANSFORMER / GENERATOR

     

            HEALTH WITH VOICE ANNOUNCEMENT AND WIRELESS PC INTERFACE”

              

                   i have only block diagram of  transmitter & recevier section of this project but i have not the circuit

                   diagram due to that i am not able to interfece it with controller 8051…..can u please direct to me…

    April 15, 2015 at 4:48 pm #12790
    saranya
    Participant

    i need program for interfacing xigbee with pic18f4550 with inputs of sensor to xigbee

    February 11, 2017 at 12:21 pm #14430
    hanumanth
    Participant

    can u upload circuit connection of xbee with 8051

  • Author
    Posts
Viewing 5 posts - 16 through 20 (of 20 total)
← 1 2
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • RC Electronic Speed Control Capacitors February 11, 2026
  • CR2/CR123A Batteries In Projects February 11, 2026
  • Variable audio oscillator February 11, 2026
  • XLR splitter to mono. February 11, 2026
  • To couple or decouple February 10, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise