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.

Problem with RF Transmission / Reception BAUD rate issue?

Status
Not open for further replies.

rallysteve

Newbie level 6
Joined
Apr 24, 2012
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,417
I am trying to develop a serial link over 868Mhz using two 89C51s (one at each end) I have got a simple piece of code allowing me to send a piece of 8-bit HEX data from my computer to the transmitter which in turn then sends to the receiver turning on a LED at certain values, and off at others, the HEX data is then returned to the PC via a second serial port. This works perfectly when connecting transmitter and receiver via a wire (between TXD and RXD pins using the UART) however when i connect my FM transmitter / receivers I am not able to receive anything. I think this is something to do with the transmitter side, and possibly the baud rate??

I am using 11.0592MHz crystals at both ends with the UART running in mode 1, with timer in mode 2. Following the application note i have set up for operation at baud rate of 9600. However I believe that the transmitter/receiver I am using has a max data rate of 4600 kHz, so am I right in thinking this could be the problem?

Code:
$NOMOD51 						 ; Prevent Keil from defining SFR Registers
$INCLUDE (reg_c51.INC)
;
;
		ORG		000H
		LJMP 	BEGIN
;
;
		ORG		23H
		LJMP 	SERIAL_IT;
;
;
		ORG 	0100H
;
; Timer 1 in Mode 2 (8 Bits auto re-load timer)
BEGIN:
		MOV		SCON,#50H		 ; UART in mode 1 (8 Bit), REN = 1
		ORL		TMOD,#20H		 ; Timer 1 in Mode 2
		MOV		TH1,#0FDH		 ; 9600 Bds at 11.059Mhz
		MOV		TL1,#0FDH		 ; 9600 Bds at 11.059Mhz
		SETB	ES				 ; Enable Serial Interrupt
		SETB	EA				 ; Enable Global Interrupt
		SETB	TR1				 ; Timer 1 Run
;
		JMP		$				 ; Endless loop
;
;
SERIAL_IT:
		JNB		RI,EMIT_IT		 ; Test if it is a reception
		CLR		RI				 ; clear reception flag for next
		MOV		A,SBUF			 ; Move data from UART into Accumulator
		MOV		SBUF,A			 ; Send data from accumulator into UART
		CJNE	A,#00h,LED_ON	 ; Switch LED On
		CJNE	A,#0FFH,LED_OFF	 ; Switch LED Off
		LJMP	END_IT
;
;
LED_ON: CLR		P2.0
		RETI
;
;
LED_OFF:SETB	P2.0
		RETI
		;
		;
EMIT_IT:
		CLR		TI				; Clear transmission flag for next transmission
		;
		;
END_IT:
		RETI
		;

end

When connected the the oscilloscope the following pattern can be seen at the data in pin of my transmitter, with the
Code:
JNB		RI,EMIT_IT		 ; Test if it is a reception
removed so that a constant series of data values are sent:
DS0005.jpg

I have tried to reduce the baud rate of my transmitter by altering the TL1 reload value to #0F3H but it seems to make no difference to the frequency of the output measured on the ossciloscope which always shows 9.6kHz.

Is anyone able to help at all please??
 

You're right, if the module is designed for 4600bps, then you need to reduce your baud rate. Probably best to try a much lower rate, e.g. 2400baud.
 

Excellent thankyou, just what I was thinking. I have created a simple lower frequency pulse with one of my 89C51s which is around 1kHz and sent this through the transmitter, it is received perfectly at the other side :)

I just need to try and reduce the Baud rate of my UART as you say now to 2400bps, however no matter what TH1 and TL1 settings i choose (from the keil baud rate calculator https://www.keil.com/c51/baudrate.asp). According to this my TH1 should be set at #0F4h to create a baud rate of 2400 exactly, however this seems to make no difference! I am unsure whether I should also change the TL1 value to match.

I only seem to be able to transmit at 9600bps!!!

Can anyone give me any pointers please, possibly just show me how to modify my 'SERIAL_IT' routine above to transmit a 8 bit Hex number at 2400bps so I can test this theory fully?

Any help much appreciated.

Thanks
Steve
 

Yeah, struggling to find what to set it too. If i also set it to #0F4h, operation still seems to be at the wrong baud rate. I might try altering it to see if i can make it work.....

Thanks
Steve
 

Have messed around with Baud rate and have now got something showing up at the receiver side :) The problem now seems to be that the TX line on the chip is at 5v and drops to zero during a pulse, however on the data output of the receiver, the RX line is at 0v and rises to 5v during a pulse. This can be seen on my oscilloscope below here, where the upper trace is the TX pin of the transmitter and the bottom trace is the RX pin of the receiver. Can anyone help at all with this?
DS0011.jpg

Thanks
Steve
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top