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.

I get only junk characters on the hyper-terminal.

Status
Not open for further replies.

RohanDey

Member level 2
Joined
Feb 17, 2013
Messages
42
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
India
Activity points
1,688
Hi,

I have been trying to interface a 433 MHz RF Tx Rx using UART of 8051 IC. But unfortunately I get only junk characters on the hyper-terminal.

The Tx module is **broken link removed** and the Rx module which I am using is **broken link removed**

The schematic of the Tx and Rx part is attached. I have been following this link http://www.codeproject.com/Articles/55864/Remote-control-based-on-c8051-with-433MHz-radio-mo for the schematic.

In the Rx side I have used a NPN transistor. This is because, if I directly connect the Data pin from the Rx module to the RXD pin of my MCU, then I don't see anything on the scope, where as if I use the NPN I can see the exact same bits as rom the Tx side inverted. As per my observation, the communication part is ok, only thing is I cannot get the data into my MCU from the Rx module using UART.

Can anyone please tell me what might be wrong here.

Thanks..
 

Attachments

  • RF 433 MHz ASK TxRx.png
    RF 433 MHz ASK TxRx.png
    14 KB · Views: 78

Re: 433 MHz ASK RF Tx Rx using 8051 UART

Does your module work at 3V or 5V? Can it handle 5V? If not you need a level shifter. Post your code.
 

Re: 433 MHz ASK RF Tx Rx using 8051 UART

Does your module work at 3V or 5V? Can it handle 5V? If not you need a level shifter. Post your code.

Yes the RF modules can handle 5V.

Code:
// Transmitter
void rs232_init()
{
	TMOD = 0x20;
	TH1 = -24;	// 1200 baud rate using 11.0592 MHz
	SCON = 0x50;
	TR1 = 1;
	//EA = 1;              /* Enable global interrupt flag       */
}
void rs232_transmit_char(char ch)
{
	SBUF = ch;
	while(TI == 0);
	TI = 0;
}
void main()
{
	rs232_init();
	TCON = 0x01;	
	IE = 0x81;		
	while(1);
}
void ext_interrupt_0(void) interrupt 0
{
	rs232_transmit_char('I');
}

Code:
// Receiver
void main()
{
	IE = 0x90;
	rs232_init();
	while(1) {
		if(receive)	 {
			ES = 0;
			rs232_transmit_char(buf);
			receive = 0;
			ES = 1;
		}
	}
}
void rs232_int() interrupt 4
{
	if(TI == 1)	TI = 0;
	
	else if(RI == 1) {
		buf = SBUF;
		receive = 1;
		RI = 0;
	}
}

I am sending the received data to hyper terminal. I receive only Junk characters.
I am thinking that this might be a hardware issue, not sure though.
 

Re: 433 MHz ASK RF Tx Rx using 8051 UART

Inverting the data polarity on the RX side only can't work. The RF modules are designed to work with remote command encoders/decoders (HT12E/HT12D type) and have active high polarity. Means the transmitter is permanently sending in UART idle state unless you invert the TX data, too.

Simple ASK modules don't transmit UART data reliably without special provisions, e.g. using manchester encoding or a similar data format modification.
 
Re: 433 MHz ASK RF Tx Rx using 8051 UART

Yeah, you have to invert data at both ends.
Slow down the transmission to well below rated 4800bps.
I'd go as low as 300bps, and then make sure you use at least a 2-byte sequence, don't relay on transmitting only one byte ..
:wink:
IanP
 
Re: 433 MHz ASK RF Tx Rx using 8051 UART

Inverting the data polarity on the RX side only can't work. The RF modules are designed to work with remote command encoders/decoders (HT12E/HT12D type) and have active high polarity. Means the transmitter is permanently sending in UART idle state unless you invert the TX data, too.

Simple ASK modules don't transmit UART data reliably without special provisions, e.g. using manchester encoding or a similar data format modification.

I have successfully transmitted 4 bit data using HT12E-HT12D pair and a MCU. Can you please make me understand, what difference it makes when transmitting data through the encoder/decoder and through the 8051 UART. When I see on my oscilloscope I find the exact same data on the Data pin of the RF receiver which was transmitted through UART, but when I connect this pin to my MCU RXD pin the signal vanishes.

I will try inverting the TX data and check what happens.
 

Re: 433 MHz ASK RF Tx Rx using 8051 UART

but when I connect this pin to my MCU RXD pin the signal vanishes
Wrong pin connected, defective chip?
 

Re: 433 MHz ASK RF Tx Rx using 8051 UART

I have inverted the Tx Side also and now I am getting the data on the Rx side.

I am transmitting a string "ABCDE\r\n" every 200 ms at 300 baud rate. I have attached my schematic and hyperterminal screen shot.

Now the problem is, I am getting a lot of junk data along with my string, and sometimes the string is also getting corrupted. On the receiver side I am using the UART in interrupt mode and so the MCU is getting interrupted for every junk character. It will be difficult to do some other work if the MCU is interrupted so much.

Is there a way to overcome this problem?
 

Attachments

  • RF 433 MHz ASK TxRx.png
    RF 433 MHz ASK TxRx.png
    14.6 KB · Views: 67
  • hyperterminal.png
    hyperterminal.png
    122.2 KB · Views: 75

Re: 433 MHz ASK RF Tx Rx using 8051 UART

I have similar problems ....my communication part upto controlller is ok...bt on hyperterminal i am getting garbage data....
I am using HT12E and HT12D
RF 433Mhz and
89c51 at Rx side ....
I want ascii value as the output on hyperterminal so i have writtern a code in assembly language for it....
I am Tx 4 bit data....
Rx section connected to P1 of controller
I am using 89c51 developing board so there is no problem in mcu part
when I check the voltage at the corresponig pins of controller with DMM it shows the input volage i.e 5v at which it receivs logic 1 and 0 V for logic 0...
what should be the baud rate...??
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top