+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Newbie level 1
    Points: 14, Level: 1

    Join Date
    Jun 2013
    Posts
    1
    Helped
    0 / 0
    Points
    14
    Level
    1

    PIC 16F877A LM35 based wireless temperature sensor

    Hello! All,
    I am really glad that usually I find most of the solutions in this site. Tnx to all for providing such support with their expertise and wisdom.
    I am working with a temperature sensor. Its a PIC 16F877A, LM35 based temperature sensor. Its working perfectly. But now I want to use KST TX01 and KST RX 806 TX-RX module to send and receive the data. Actually the sensor node (Tx) will send the sensing data to another node (Rx) through RF. I have used Hi-Tech as compiler.
    The following code was done using CCS C compiler. Please suggest me how I can use these code in Hi-Tech.
    Receiving side code
    #include <16F877A.h>
    #device *= 16
    #fuses HS, NOWDT, NOPROTECT, NOLVP, PUT
    #fuses NOBROWNOUT, CPD, NODEBUG, NOWRT
    #use delay(clock=10MHz)
    #use rs232(baud=1200, rcv=PIN_C7, bits=8, parity=N)

    #include

    void main()
    {
    byte c;
    lcd_init();
    lcd_putc("\f");
    while(true)
    {
    c=getc();
    printf(lcd_putc,"\fRx Data = %u",c);
    delay_ms(100);
    }
    }
    Transmitting side code
    #include <16F877A.h>
    #device *= 16
    #device adc=8
    #fuses HS, NOWDT, NOPROTECT, NOLVP, PUT
    #fuses NOBROWNOUT, CPD, NODEBUG, NOWRT
    #use delay(clock=10MHz)
    #use rs232(baud=1200, xmit=PIN_C6, bits=8, parity=N)

    #include

    void main()
    {
    byte s=0;
    lcd_init();
    lcd_putc("\f");
    setup_adc_ports(adc_clock_internal);
    setup_adc(AN0);
    set_adc_channel(0);
    while(true)
    {
    read_adc(adc_start_only);
    while(!adc_done());
    s = read_adc(adc_read_only);
    lcd_gotoxy(1,1);
    printf(lcd_putc, "\fTx Data = %u" s);
    putc(s);
    delay_ms(100);
    }
    }
    The following is the existing mplab ide program where I am want to insert the tx rx module. Please help. Thank you.
    tempr.rar

    •   AltAdvertisment

        
       

  2. #2
    Full Member level 5
    Points: 1,841, Level: 9
    Golden Electronics's Avatar
    Join Date
    May 2013
    Location
    India
    Posts
    309
    Helped
    49 / 49
    Points
    1,841
    Level
    9
    Blog Entries
    1

    Re: PIC 16F877A LM35 based wireless temperature sensor

    1. Change all fuse with config register
    2. Replace Print f & Putc with Equiv. C code
    3. Write function for ADC, Serial port initialization as well as ADC read.



--[[ ]]--