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.

Interfacing RSW-434 TSW-434 With 8051

Status
Not open for further replies.

be_sincere86

Newbie level 5
Joined
Nov 22, 2007
Messages
10
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,387
8051 uart code 11.0592 1200 baud

I m having problem in interfacing RF transmitter tsw and receiver rsw 434 with microcontroller 8051.

is it necessary to connect encoder decoder between controller and tsw/rsw-434 ?
which serial mode should i use ?


plz help me and guide me how to make this simple communication project
 

rsw 434 precio

be_sincere86 said:
I m having problem in interfacing RF transmitter tsw and receiver rsw 434 with microcontroller 8051.

What language are you using ? C or asm?
What derivative are you using? i.e. atmel, phillips
what is the chip name? i.e. AT89C51, AT89C2051, etc.

be_sincere86 said:
is it necessary to connect encoder decoder between controller and tsw/rsw-434 ?
which serial mode should i use ?

no it is not necessary to connect encoder, you can do the encoding/decoding with software using the 8051 alone.

be_sincere86 said:
plz help me and guide me how to make this simple communication project

do you have any code you can post? any schematics? what have you done so far? Did you search google?
 

interfacing wireless receiver with 8051

im using assembly
and 89c51 both sides trns and receiver.
the code is very simple both side (trans/receiver) baud rate is set which is 1200 bps then trans simple transmit hex value 0Fh and receiver receives it and send it to port 2.

when i directly connect the txd pin of 89c51 with rxd pin of receiving 89c51 it is perfactly working but when i use transmitte tws 434 and receiver rws 434 it start sending garbage...

i get some idea from this website :
**broken link removed**

but problem is this person had used atmega32 and the code which he had writen is very difficult to understand for me....
rlp and rws are same similarly tlp n tws

**broken link removed**

plz if u have some idea about it plz do share it with me
 

rf transmitter and receiver using tsw

be_sincere86 said:
im using assembly
and 89c51 both sides trns and receiver.

Perfect, assembly is what I know best.

be_sincere86 said:
plz if u have some idea about it plz do share it with me

I would be able to help you if you post your code a schematic or something to show your connections will also help. You can message me if you do not want to post your code on the forum.

I did the same thing with avr and I was thinking of doing it with an 89C2051. Its very easy to code.

Bear in mind that the receiver is always receiving. The protocol you use must filter out the packets, and it is a good idea to use some kind of CRC in the packet. I used a 4 byte packet with 8 bit CRC.

One question, did you use the right DATA output on the receiver? There are two, digital and linear. You need to use the digital one only, leave the linear one disconnected.

I am 100% sure I will be able to help you.

Good Luck
 

transmitter module 434+8051

actually im busy in my final exams im in 7th semester soon ill be free (till 13th december) then i'll show u both code and schemetic ..

plz dont go away i Desperately need a person like u who can help me out in this problem becz it is the question of my Final Year Project...

so i hope u'll help me and guide me just give me few days ...

thanks alot!!!!!
 
  • Like
Reactions: shiboo

    shiboo

    Points: 2
    Helpful Answer Positive Rating
tlp-434 pic asm

im back
here is the code for transmitter it simply just transmits 0fh:

mov tmod,#20h
mov th1,#-24
mov scon,#50h
setb tr1
again: mov sbuf,#0fh
here: jnb t1,here
clr t1
sjmp again
end

and here is receiver code which receives data and out it on port 1:

mov tmod, #20h
mov th1, #-24
mov scon, #50h
setb tr1
here: jnb r1, here
mov A, sbuf
mov p1, A
clr r1
sjump here
end


this is very simple code i got it from a book by mazidi, actually im not master of microcontroller but i know basics....

i m unable to understand that u said
"The protocol you use must filter out the packets, and it is a good idea to use some kind of CRC in the packet. I used a 4 byte packet with 8 bit CRC. "

can u please further explain about it ..
 

8051 rf transmitter code

quickly looking at the schematic, I saw that you need to tie EA (Pin31 on the microcontroller) to VCC on both receiver and transmitter.

The reset circuit should have a 10uF capacitor and an 8.2K resistor. I could not tell the values from your schematic.

The capacitor values for the crystal should be 33pF (or less) not 33uF.

You should read this:
https://www.sparkfun.com/datasheets/RF/KLP_Walkthrough.pdf

To test whether or not your serial routines are working, have the transmitter send data to the PC use the attached terminal program. You will need a maxim 232 driver in your circuit connected to the TX and RX lines of the microcontroller.

here is a small routine you can use:
Code:
;*********************************************
;UART Test code
$mod51
;this one uses UART hardware to TX @2400 Baud
;timing is adapted for 11.0592 MHz crystal
;****************************************************
org	00000h
Reset:
	sjmp	Start			;reset vector
Start:
	MOV   SP,#70h           ; Start stack near top of '51 RAM. 
	mov	a,#0FFh		; clear Ports
	mov	p1,a			;
	mov	p3,a			;

;------Initialize Uart------------
	MOV SCON,#01010000B 	;(50H) Mode 1/Rec en
					; bit 4 = REN receive enable				
					; bit 6 = mode 1. -  8 bit uart variable baud rate
;;	MOV TH1,#0E8H 		; Reload value for 1200 Bd @11.0592 MHz
	MOV TH1,#0F4H 		; Reload value for 2400 Bd @11.0592 MHz
;;	MOV TH1,#0FAH 		; Reload value for 4800 Bd @11.0592 MHz
	MOV TMOD,#00100000B	; (21H) Gate1/Timer/Mode 2 / Gate0/Timer/Mode 1
					; bit 5 = 8 bit auto reload for timer 1 (Mode2)
	setb	TR1			; start timer 1	
;----------------------------------------------	
Main:  	
	clr	a
Main1:
	lcall	transmit
	inc	acc
	acall	Time1mS
	sjmp	Main1
;----------------------------------------------	
Time1mS:
	MOV   R2,#2
      MOV   R1,#221
tim1mS:
	DJNZ  R1,$
      DJNZ  R2,tim1mS
      RET
;----------------------------------------------
transmit:
	MOV SBUF,A
	JNB TI,$
	CLR TI
	ret
;----------------------------------------------
end

use the attached terminal program and set the input to hex (not ascii)
connect at 2400 baud and you will see it works.

then you can test the receiving code. All you have to do is type in a character in the terminal and press send, this code will return the value you sent back to the terminal.

Code:
;*********************************************
;UART Test receiver code
$mod51
;this one uses hardware uart to receive @2400 Baud
;timing is adapted for 11.0592 MHz clock
;
;port 3 pinouts
;----------------------------------------------------
org	00000h
Reset:
	sjmp	Start			; reset vector
Start:
	MOV   SP,#070h          ; Set up stack pointer
	mov	a,#0FFh		; clear Ports
	mov	p1,a			;
	mov	p3,a			;
;------Initialize Uart------------
	MOV SCON,#01010000B 	;(50H) Mode 1/Rec en
					; bit 4 = REN receive enable				
					; bit 6 = mode 1. -  8 bit uart variable baud rate
;;	MOV TH1,#0E8H 		; Reload value for 1200 Bd @11.0592 MHz
	MOV TH1,#0F4H 		; Reload value for 2400 Bd @11.0592 MHz
;;	MOV TH1,#0FAH 		; Reload value for 4800 Bd @11.0592 MHz
	MOV TMOD,#00100000B	; (21H) Gate1/Timer/Mode 2 / Gate0/Timer/Mode 1
					; bit 5 = 8 bit auto reload for timer 1 (Mode2)
	setb	TR1			; start timer 1	
;----------------------------------------------	
Main:
	lcall	receive		;receive data from terminal	
	lcall	transmit		;echo it back to terminal
	sjmp	Main
;----------------------------------------------	
; Receive a character and return in ACC
receive:
	JNB RI,$		;wait here for receive int
	MOV A,SBUF		;get data
	CLR RI		;clear receive int
	ret
;----------------------------------------------
;Transmit a character from ACC
transmit:
	MOV SBUF,A
	JNB TI,$
	CLR TI
	ret
;----------------------------------------------	
end

If that works, then you know your hardware is perfect. Then just change the TX & RX lines back to the RF modules and test the same code.

Remember the receiver ALWAYS receives data, no matter what it is, noise, etc.

In my code I filtered out the incoming data like this:

Code:
Main1:
	lcall	receive			;receive data from uart
	cjne	a,#099h,Main1	  ;compare received byte with 99h
						;if its different, restart
	mov	08h,a			;save first byte received

;we are here because first received byte compares to 0x99
	lcall	receive			;get second byte
;-------------
	cjne	a,#088h,Main1		;compare received byte with 88h
        mov	09h,a			;save second byte received

;next the program gets two more bytes (total 4 bytes)
;then xor first three bytes together
;then compare last byte with xor value of 3 first bytes
;not the same? go back to Main1
;this way you are SURE that your receiving code won't pick up garbage bytes.
;I mean it always will, but you must ignore the garbage.

Let me know how it goes.
 

baud rate tws 434 junk

Dear friend

you should take care much when you are interfacing the mcu directly to the rf tranceivers
because the modules are sensitive to any rf signals at the range
so ther willbe a lot of junk charectors
you should take care of the conditions where you are going to impliment the system and take care of the junk

regarfd

ml
 

interfacing transmitter with 8051

@ctownsend

thanks for ur continous support ...
one problem im having in the code for checking transmitter n receiver that when i assemble the code using asem51 is generates an error which is

Reset:
^
@@@@@ symbol already defined @@@@@

im unable to remove it
can u tell why is it and how it will be removed ?
 

mov sp, #70h

put both the asm files in a new folder and extract these three files from this zip file in the same folder.
just run the asm.bat file and both files will assemble.

I use asm51 not asem51 to assemble the code.
Also the mod51 file is included.
Good Luck
 

tws-434 max232

@ctownsend

when i burn the hex file while verification it generates an error that is

'$
'is not valid integer value

i dont understand it ... is it the problem with microcontroller or code or burner ?

secondly can u provide schemetic for the serial port testing ?
 

8051 burner by using 8051 and max232

What program are you using that is giving you this error?

I assume you are using 89C51 or 89C52. How are you programming the micro?

Did you assemble the code with the files I posted?

All you need to do is make a new folder with only these files in it:
both the asm files,
asm.bat
asm51.exe
mod51

watch the screen for any errors. There must be no errors when it assembles. If there are, you have an extra char in there somewhere.

I tested the code and it assembles perfectly and it does work sending & receiving.

attached is a schematic that will work with the code I posted.

***THINGS TO WATCH OUT FOR****
Two capacitors on the Max 232 are reversed. Capacitors C1 and C7 the leads are reversed. ( GND to + (C1), and + to GND (C7))

Please follow the schematic carefully.

Good Luck
 

rf 434 schema

im using software EZ3 (EZ uploader v 3) which detects the burner at com1 port and take hex file erase the ROM and burn the program (HEX code) on controller (89C51)and then verify it.

there is no error in the list file which is generated while assembling the asm file by asm51.

so ur code is error free.

error accurs while burning the hex file. EZ3 writes the code perfactly but while verifying it, it generate an error.
i donot have any idea why it is occuring..
somtimes it doesnt appear, and process completes successfully.

well thanks for providing schemeting ...now i'll do it!!!
 

uart tws rf

be_sincere86 said:
error accurs while burning the hex file. EZ3 writes the code perfactly but while verifying it, it generate an error.

somtimes it doesnt appear, and process completes successfully.

that would have to be something in your programmer setup. Did you build the programmer yourself?
 

tws-434a interface 8051

nops!

i issued it from my university.
 

tws 434 using at89c51

I saw a thread about this on 8052.com.

This may help you:

**broken link removed**

Good Luck
 

encode decode program in 8051

helloo
coming after a very long time...

i tested ur code and my hardware that is 89c51 is perfact it is transmitting as well as receiving properly.

now the problem i m facing is that first of all u said "Then just change the TX & RX lines back to the RF modules and test the same code"

can u plz tell me exactly the pin number where i place tx and rx module.

currently im connecting my tws data input pin with pin 11 of 89c51 and then receiver at pin 10 of max 232 that is making transmission from controller back to computer wireless.

but this time im not receiving the actuall data there is a lot of garbage coming .. and im failed to remove it.

when i connect controll pin 11 to pin 10 of max 232 then it is working fine that is when i type character on terminal and send it ..controller perfactly return it back to pc and it appears on terminal.

kindly send me the complete code with removal of garbage... im sorry my assembly is very weak if u can explain how to remove garbage and receive correct data in simple words ill be very thankfull to u...
waiting for ur kind response
 

tws 434 with 89c51

I don't remember where I got this, it is not my work.
I haven't tested it either, but it looks like this is all you need,
and includes everything.

Briefly looking at the code, it should
work with any 8051 (including 89C51/52) as long as the
proper pins are connected as per the schematic.

Regards.
 
rlp 434 8051

Hey what's up guys. I am doing a similar project. I am making a remote controlled car. I am using the AT89C51RB2 and using assembly language. However, I am horrible at assembly and i am not using a Max232 chip. I am also using FLIP and READS51 to program the 8051 and load the program onto the chip. Can I use these same steps for my transmitter and receiver? My transmitter and receiver are 434M and 2400 baud. The code would be very similar too right? Any help would be appreciated!
 

how to work on asm51

I'm doing something similar, too, a remote controlled car with wireless commands from RS232, exept it's with a PIC and in C. Could you give more informations, a link or something?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top