electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

Interfacing RSW-434 TSW-434 With 8051


Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Interfacing RSW-434 TSW-434 With 8051
Author Message
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post22 Nov 2007 15:48   

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
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post27 Nov 2007 18:40   

rsw 434 precio


be_sincere86 wrote:
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 wrote:

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 wrote:

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?
Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post01 Dec 2007 15:18   

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 :
http://www.e-dsp.com/how-to-build-your-own-wireless-receiver-and-transmitter-device-create-rf-in-your-embedded-application/

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

http://www.sparkfun.com/commerce/product_info.php?products_id=7817

plz if u have some idea about it plz do share it with me
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post02 Dec 2007 22:37   

rf transmitter and receiver using tsw


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


Perfect, assembly is what I know best.

be_sincere86 wrote:

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
Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post03 Dec 2007 14:16   

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!!!!!
Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post16 Dec 2007 17:49   

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
Quote:
"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 ..



Sorry, but you need login in to view this attachment

Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post16 Dec 2007 21:21   

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:
http://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.



Sorry, but you need login in to view this attachment

Back to top
microlab



Joined: 04 Mar 2006
Posts: 106
Helped: 3


Post18 Dec 2007 8:26   

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
Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post18 Dec 2007 15:00   

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 ?
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post19 Dec 2007 3:59   

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



Sorry, but you need login in to view this attachment

Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post20 Dec 2007 9:03   

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 ?
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post20 Dec 2007 13:27   

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



Sorry, but you need login in to view this attachment

Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post20 Dec 2007 16:35   

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!!!
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post20 Dec 2007 19:39   

uart tws rf


be_sincere86 wrote:

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?
Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post21 Dec 2007 7:19   

tws-434a interface 8051


nops!

i issued it from my university.
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post29 Dec 2007 2:52   

tws 434 using at89c51


I saw a thread about this on 8052.com.

This may help you:

http://www.8052.com/forum/read.phtml?id=148694

Good Luck
Back to top
be_sincere86



Joined: 22 Nov 2007
Posts: 10


Post28 Jan 2008 10:41   

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
Back to top
ctownsend



Joined: 27 Nov 2004
Posts: 301
Helped: 21
Location: Canada


Post28 Jan 2008 16:14   

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.



Sorry, but you need login in to view this attachment

Back to top
mccarthyrj



Joined: 23 Dec 2008
Posts: 1


Post23 Dec 2008 20:58   

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!
Back to top
Google
AdSense
Google Adsense




Post23 Dec 2008 20:58   

Ads




Back to top
Vandal S



Joined: 02 May 2009
Posts: 50
Helped: 2


Post02 May 2009 1:34   

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?
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers -> Interfacing RSW-434 TSW-434 With 8051
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
About planar antennas for 434 MHz application... (1)
ADC interfacing with 8051 with full source code (1)
TMP101 interfacing with 8051 (2)
interfacing 24cxx with 8051 (4)
Interfacing 8051 with a SD card (6)
CDROM interfacing with 8051 (1)
8051 interfacing with 24c08 (9)
ADC0804 interfacing with 8051 (3)
MAX232 interfacing with 8051 (2)
interfacing 8051 with mobile (2)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS