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.

PIC 16F877A LM35 based wireless temperature sensor

Status
Not open for further replies.

Shuvodip Das

Newbie level 1
Joined
Jun 10, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
18
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 <lcd.c>

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 <lcd.c>

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.
View attachment tempr.rar
 

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.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top