bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
Friends,
I want to test my RF module like this one :
With MCS 51 as a receiver and PC as transmitter (serial port) I connect TX pin from PC to Data on transmiter module, is it possible ? I tranmit using PuTty and receive with MCS51(I connect data into RX or pin 10 on AT89S52),
I haven't seen any responses,
Anyone has ideas ?
thanks
Here's the code:
I want to test my RF module like this one :
With MCS 51 as a receiver and PC as transmitter (serial port) I connect TX pin from PC to Data on transmiter module, is it possible ? I tranmit using PuTty and receive with MCS51(I connect data into RX or pin 10 on AT89S52),
I haven't seen any responses,
Anyone has ideas ?
thanks
Here's the code:
Code:
#include <REG51.H>
#include <stdio.h>
sbit LED1= P0^0;
sbit LED2= P0^1;
unsigned char Serial_read() {
SCON = 0x50; /* SCON: mode 1, 8-bit UART, enable rcvr */
TMOD |= 0x20; /* TMOD: timer 1, mode 2, 8-bit reload */
TH1 = 253; /* TH1: reload value for 9600 baud @ 11.0592MHz +/- 3.5% error */
TL1 = 253;
TR1 = 1; /* TR1: timer 1 run */
TI = 1; /* TI: set TI to send first char of UART */
display_wait();
printf("\n Enter `a` to continue \n");
while(!RI);
RI = 0;
return SBUF;
}
main()
{
unsigned char serial_char;
while(1)
{
serial_char=Serial_read();
switch(serial_char)
{
case 'a':
LED1=0;
LED2=1;
break;
case 'b':
LED1=1;
LED2=0;
break;
}
}
}