Home - Search - Members
Full Version: at89s52 interfacing with Xbee
Pages: 1, 2
Feb 7 2011, 5:57 PM
hello, i had promble with communication by using xbee. i know that xbee operate with 3.3V but 89s52 is 5v

1. my project like this :

uc+xbee (send data to) xbee+pc

2. can i using this circuit http://www.8051projects.info/upload/Image/Interface_ckt.BMP


Ajay Bhargav
Feb 8 2011, 5:44 PM
You can use that schematic if your module is support 5v inputs. if not then you have to lower down the voltage level. You can make use of a simple transistor logic.

for input to microcontroller you actually dont need to do anything. microcontroller that are 5V tolerant can accept 3V input levels.

so.. do check your module's datasheet...

Ajay Bhargav
Feb 8 2011, 5:47 PM
[Topic moved to 8051 Discussion forum]

Feb 9 2011, 4:35 PM
i see the module`s datasheet, the tx current : 45mA @ 3.3V and rx current : 50mA @ 3.3V

it show that i cannot directly connect to pin tx/rx uC and must have a voltage divide to reduce the voltage from 5V to 3.3V ? right? if i wrong plz corret it.

Feb 10 2011, 8:03 AM
yes u can use voltage divider or MC14050 it is 3.3 volt operated not gate
insert it in controller and xbee module
Feb 10 2011, 11:29 AM
thanks majoka for ur reply

are this circuit like this?

Feb 10 2011, 12:08 PM
yes almost in pdf circuit is doing same thing resistor will limit hr current
i was talking like this that is on this page
Feb 10 2011, 12:35 PM
hmm, how about the data? did will be effect at the data tx/rx?
Feb 10 2011, 12:40 PM
yes may be it effected but module can effect that point is more important
Feb 10 2011, 3:22 PM
hmm, that any solution to make sure the data and module in the good condition when it interface with 89s52?
Feb 11 2011, 5:33 PM
Ajay Bhargav
Feb 12 2011, 3:34 PM
check the latest post i made on this:
Feb 14 2011, 3:00 PM
oh, i see
thanks a lot for ur information.
i have one question about interfacing xbee with pc

must connect with max232?
Feb 15 2011, 9:09 AM

must connect with max232?

yes it is must when connecting to pc it is a line driver or level converter ic
Ajay Bhargav
Feb 15 2011, 2:49 PM
xbee is 3.3v better use max3232
Feb 15 2011, 3:46 PM
oh, i see. thanks a lot

ok, i just see one circuit xbee interfacing with the pc

the circuit like this http://amtek.../files.wordpress.com/2010/11/xbee.jpg

can i used the circuit?
Feb 16 2011, 5:19 PM
this is not a valid not gate is not use for this purpose and its not a pretty solution use max3232 for connecting it directly to pc
Feb 25 2011, 11:10 AM
i already have xbee
and i just build a circuit to interfacing with PC by using max232
but the result is bad, unable comm. with modem

so, how do I determine whether xbee is in good condition or damaged?
did anyone know?

Ajay Bhargav
Mar 1 2011, 1:43 PM
check datsheet if they have provided any test modes for checking.

you have used Max232? again? i told u Max3232
Mar 1 2011, 2:46 PM
ya u already told it,
but my place not have max3232

so i decide to buy a new xbee usb adapter

tq for u reply ajay

Mar 1 2011, 5:35 PM

i just build a circuit to interfacing with PC by using max232
but the result is bad, unable comm. with modem


Can you post the circuit you used.

Consider an adapter like this one.

so, how do I determine whether xbee is in good condition or damaged?
did anyone know?


This website sells XBee variants and modules.

It has instructions for its test software.
"Users Guide: XCTU Configuration & Test Utility Software"
I have no idea if it would work on your Xbee, but it shows that some parts of an Xbee are testable.
Mar 7 2011, 3:10 PM
i already succesful parameters the both xbee
now, i want to interfacing to uC
i used this circuit to interfacing xbee and uC http://www.kronosrobotics.com/Projects/MaxStreamInterface3.pdf

i already load this program at my at89s52

org 0h
call initserial
mov dptr,#MyCharacter
gets: clr A
Movc A,@A+dptr
cjne A,#0,Next
sjmp getin
Next: call sendout
inc dptr
sjmp gets
getin: call inchar
cjne A,#'1',next1
mov P0,#11111110b
next1: cjne A,#'2',next2
mov P0,#11111101b
next2: cjne A,#'4',next3
mov P0,#11111011b
next3: sjmp getin
mov scon,#52h ; Konfigurasi komunikasi serial mode 1
mov tmod,#20h ; Baud rate 2400 BPS
mov th1,#0F3H
setb tr1
detecti: jnb ri,detecti ; Deteksi bit RI apakah data sudah diterima atau belum
clr ri
mov a,sbuf
detecto: jnb ti,detecto;
clr ti ;
mov sbuf,a ;
DB ' Tekan Tombol 1, 2 atau 4',13,10,0

now what the next step ? anyone can help me?
Mar 7 2011, 8:57 PM

i already succesful parameters the both xbee
now, i want to interfacing to uC


So are you saying you are able to use the Xbee with a PC ?
you are happy with that ?

You now want to connect the Xbee to an at89s52 ?
Have you had any success ?
Mar 8 2011, 9:53 AM
yes i am

yes , now i want connect xbee to an at89s52
but still not succesful.
dont know what the next step
i used x-ctu terminal to monitar the program. but still not appear the data.

Mar 8 2011, 11:32 PM
Have you read this page, it seems to give a lot of info about setting up.


For the at89s52 program try a very simple test program.

Send "A", no need to check serial port ready bits etc,
just set the baud rate and load 0x41 into sbuf.

Wait a quarter of a second.
loop back and send "A", again.
Use a logic probe or led to look for a pulse as the char is sent.

Also look for any sign that it arrived.
Let us know what happens.
Mar 13 2011, 2:32 PM
thanks for ur help exUK

i`m can control the uC only ( PC to uC)
but i still problem , when (uC to PC) the data not appear.
when i check the voltage at dout(pin 3 xbee) it below 1v.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Rickey's World © 2003 - 2007