I am doing a wireless data transmission base on Cytron DIY project by using cytron product. I am using 315MHz transmitter and receiver and PIC16F877A in my project. Now I was developed a program (mikro-c compiler) and simulated successful for my RF receiver part. Below is my receiver side program;
- CODE: SELECT_ALL_CODE
// LCD module connections
sbit LCD_RS at RD4_bit;
sbit LCD_EN at RD5_bit;
sbit LCD_D4 at RD0_bit;
sbit LCD_D5 at RD1_bit;
sbit LCD_D6 at RD2_bit;
sbit LCD_D7 at RD3_bit;
sbit LCD_RS_Direction at TRISD4_bit;
sbit LCD_EN_Direction at TRISD5_bit;
sbit LCD_D4_Direction at TRISD0_bit;
sbit LCD_D5_Direction at TRISD1_bit;
sbit LCD_D6_Direction at TRISD2_bit;
sbit LCD_D7_Direction at TRISD3_bit;
// End LCD module connections
#define click_button RA1
unsigned int num;
char string1[]= "Welcome";
char string2[]= "Final Year Project";
char string3[]= "Wireless Data Transmission";
char string4[]= "Thank You";
char *string;
void Move_Delay() { // Function used for text moving
Delay_ms(500); // You can change the moving speed here
}
void main() {
int i=0;
TRISA = 0xFF; //configure PORTA as input
TRISB = 0xf0; //configure PORTB as input
PORTC = 0; //LED
TRISC = 0;
TRISD = 0;
PORTD = 0x00;
TRISD = 0x00;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,3,"Wireless Data");
Lcd_Out(2,4,"Transmission");
Delay_ms(3000);
Lcd_Cmd(_LCD_CLEAR); // Clear display
while(1)
{
if((portb.f0==0)&&(i==0))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,7,string1);
i++;
}
if((portb.f0==0)&&(i==1))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,1,string2);
i++;
}
if((portb.f0==0)&&(i==2))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,1,string3);
i++;
}
if((portb.f0==0)&&(i==3))
{
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,1,string4);
i=0;
}
}
}
But, the problem is I am confused and not understand about how is a transmitter program should be i used for make the receiver part operate by using RF since the Transmitter part cannot be shown how it work if simulated in Proteus Professional. Can you give me some suggestion or idea about my problem and if can give me a example of transmitter based on my program above?
Could my project going successfully without using UART (UART_write and UART_read) in both transmitter and receiver program?
Thanks for your help, I am really appreciate it! Regard!