Hi Bobi,
Following is my Tx code
Tx Activity in ISR)
if(TI)
{
//DO TRANSMISION ACTIVITY
TI = 0;
tr_ptr++;
if(*tr_ptr == $)
{
tr_ptr = ser_out_arr;
TR_RDY_F = 1;
}
else
SBUF = *tr_ptr;
}
//////////////////////////////////////
ser_out_arr[0] = 'A';
ser_out_arr[1] = ((weight / 1000) + '0');
weight%= 1000;
ser_out_arr[2] = ((weight / 100) + '0');
weight %= 100;
ser_out_arr[3] = ((weight / 10) + '0');
ser_out_arr[4] = ((weight % 10) + '0');
ser_out_arr[5] = 0x0d;
ser_out_arr[6] = 0x0a;
ser_out_arr[7] =$;
start_transmission();
/////////////////////////////////////
Following is the receiver code:
if(RI)
{
RI = 0;
//DO RECIVER ACTIVITY
*rec_ptr = SBUF;
if(*rec_ptr != 0x0a ) // line filled
rec_ptr++;
else
{
SER_DATA_RDY_F = 1;
rec_ptr = ser_in_arr;
}
if(ser_in_arr[0] == 'A')
DATA_RECEIVE_F = 1;
}
//////////////////////////////////////////
if(DATA_RECEIVE_F)
{
DATA_RECEIVE_F = 0;
weight = ser_in_arr[1] - '0' ;
weight *= 10;
weight += ser_in_arr[2] - '0' ;
weight *= 10;
weight += ser_in_arr[3] - '0' ;
weight *= 10;
weight += ser_in_arr[4] - '0' ;
}
The value in weight variable is displayed on lcd.
& the schematic of the wireless module is as attached.
The Rx data pin of receiver is connected to the RXD pin of controller.