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.

source code (mikro-c compiler) of RF wireless data transmission

Status
Not open for further replies.
Dear friend, thank for your advice~ ^^ You are really help me a lot!

Actually 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.

Could my project going successfully without using UART (UART_write and UART_read) in both transmitter and receiver program?
 

Hi friend,

Since i am getting to use rf module, from the research i found that uart can be use in sending or receiving a sequence data in both trasmitter and receiver am i right?
But my simple project is when i was pressed a pushbutton 1 time and the receiver will get the signal and show the first string in LCD display, when second time pressed and show second string and so on. So i need to use uart also?

I was combine the program you have been adviced me before with uart but seem is not work succesfully...can u help me?
 

Dear friend,

Uart is simple one in mikroc, just four instruction only.

first do a simple program for uart transmitter
then do transmitter only transmit when a key is pressed.
here i attach a simple program for uart transmitter.
 

Attachments

  • usart.txt
    165 bytes · Views: 126
Hi friend,

I have try it in my program, although build successfully but cannot transmit signal to receiver (via pin TX and RX) according to my proteus circuit. Help me take a look please. Thanks!

proteus circuit.pngView attachment Receiver.txtView attachment Transmitter.txt
 

Dear fiend,

I have lot of doubts in your program,



if((UART1_Data_Ready()==1)&&(i==0)) // If data is received through UART
{
string = UART1_Read();
Lcd_Cmd(_lcd_clear);
Lcd_Out(1,6,string1);
Delay_ms(500);
i++;
}

in rxr side purpose of this line
string = UART1_Read();

second thing
actually here we implement rs232 communication techniques not pic-pic communication

I suggest you firs you check your program in pic simulator ide
I will give some steps for you

first you write program for transmitter then you simulate it in your pic simulator ide (by using uart interface keypad )

check the data in your uart terminal when the switch is pressed.
if uart contain data then transmitter side is ok

simultaneously check your rxr side.
 
Hi friend,

That is no surprise you have doubt in my program, i am really is a programming newbie, so i cannot write a well or even a correct program.

First, i putting string = UART1_Read(); i thought when the data is ready and the character will be read by uart.

Secondly, I thought my project don't have using any rs232 device since i am going to transmit and receive data by rf wireless? (the pic-pic circuit connection, i just want to prove that whether my uart can transmit or receive data [assume the wire connection between RX pin and TX pin are wireless])

Sorry for my ignorance, i am not really to get your mean by using uart interface keypad. I have no idea and not understand what is going next.
 

Dear friend,

It is my mistake ,I am very sorry.

Basically communication techniques are same for both rs232 and rf.The reason is that pic provides only one serial communication protocol. You can interface any device with pic (it may be a rf or anything ) through usart.

Anyway your program is correct.
You can check your program in pic simulator ide.(if you don't have it you can download it from oshonsoft)
If it is correct then you check it proteus.
 
Hi friend,

No need apologies, may be is my way of describe not good enough so make you confuse, sorry.
Yup i can get it what is your mean of rs232 communication techniques.^^

So my program is correct by the way?
The problem you have stated just now ===> string = UART1_Read();
can be used?

Yup. I was successfully build all the program in MikroC without any error, and the 2 pic circuit connection as i was uploaded just now 1 is the transmitter pic (master)and another 1 is receiver pic(slave). Sir, since no any error in my program, why i am still cannot transmit the signal? ( That's mean when i was pressed the button, LCD cannot show the character).

All afternoon I have been checking the circuit connection in proteus with port assigned in my program, can you help me to find out the solution together?
 

Dear friend,

One mistake in your program in txr side

while(1)
{
if (click_button == 0)
{
for(i=0;i<7;i++)
{
UART1_write(string);
Delay_ms(1000);
}
}

UART1_write(string); in this sentence string contain no data for transmitting so change either string to string1.

Also the below code has no effect in your program.

char string1[]= "Welcome";
char string2[]= "Final Year";
char string3[]= "Project";
char string4[]= "Wireless Data";
char string5[]= "Transmission";
char string6[]= "Thank You";


Avoid delays for software simulation.

I simulate your program in pic simulator ide it run successfully.

I want some clarification in your project What data here you send from txr to rxr?no data?
 
Hi friend,

So if i change program to string1, izit mean that it only transmitting the character string1 only? So i need to continue the program on string2, string3 in the following program?

Ok. Let me briefly explain about my project and what problem i have been face now. My project is going to design 2 RF board (PCB) for transmitting and receiving data. Before that, i need to make sure my program (coding) is correct to operate the both PIC.

So what i am intend press a button on transmitter board for transmit data, the signal sent by transmitter will be received by receiver and display the data (character) in LCD. When i pressed button second times, i will appear another character, and so on. ( My transmitter wound not store any signal [mean that would not collect how many time i was pressed] and will sent the signal once i pressed the button).

Now the problem is, although my program can be build successfully by pic simulator ide, but when i construct the circuit in proteus, it cannot work properly.

First i was obsevered that the pin7 for (RX) and pin6 for (TX)[PORTC] (Transmitter and Receiver) will not response when i pressed the button to input (RA1 //assign in program). There have a attach picture you can look for it for further understanding.

Secondly, when i start the simulation, the character in LCD will be displayed automatically as the sequence I have been assigned. ( Should be shown 1 by 1 after i pressed the button on transmitter). I have try to edit the coding such as

if((UART1_Data_Ready()==0)&&(i==0)) to if((UART1_Data_Ready()==1)&&(i==0))

but it cannot show any character in LCD no matter how many times i have pressed the button. I think is uart problem but i am not so sure and no idea how to change the uart in program (may be is my uart program wrong?).

Hope you can undestand. Thanks guy.

proteus.png
 
Last edited:

Dear friend,

(So if i change program to string1, izit mean that it only transmitting the character string1 only? So i need to continue the program on string2, string3 in the following program?)

Ans:

look attached program for transmitter .Make changes if you need.

if((UART1_Data_Ready()==0)&&(i==0))

change this by

if((UART1_Data_Ready())&&(i==0))




I am asking to you a simple question

Do you mind about your transmitted data?

If you need to display the transmitted data you must care about your code (need changes in your rxr side program). Otherwise no need.
 

Attachments

  • Transmitter.txt
    2 KB · Views: 103
Hi friend,

I am not mind about my transmitted data. I just concern about when i click the button at transmitter side and there will be a signal received by receiver and show something in the LCD (mean wireless data transmission is successful).

I was tested your attached file to me, but it doesnt work as what i expected.

When i change this to if((UART1_Data_Ready())&&(i==0));
the whole receiver will be ran automatically without transmitter. That's mean i haven pressed the button, those character will shown 1 by 1 automatically.

Friend, what should i do? Or i cannot construct the circuit in proteus like this? Have you try it before?
 

Hai,

This rxr program is working one. Check it.
 

Attachments

  • rxr.txt
    1.9 KB · Views: 89
Hi friend,

Ya, i am using this program in receiver side.
As i say just now, it will run automatically without function in transmitter side.

So i just wonder why. Frustrated~
 

Hai,

Can you post nyour rxr side program?

I am not familir with Hitech c
 

Hai,

your program is correct and it works properly in my simulator.

Just for checking, disable the first lcd display.


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,3,"Transmission");

Delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR); // Clear display
 
Hi friend,

For more further understanding to me, can you briefly explain to me how is my program simaulate in ur simulator?
have you construct circuit like me in the proteus also?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top