CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

XBEE with 16F877A

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
balaji



Joined: 30 Mar 2010
Posts: 21

View user's profile Send private message Send e-mail

XBEE with 16F877A
PostPosted: Thu Apr 15, 2010 2:26 am     Reply with quote

Hai ,

I am constructing a project based on XBEE series 1 module. The problem is my MCU PIC 16F877A and dsPIC30F3010 is working on 5V and XBEE on 3.3V. Shall i directly connect RX/TX (TTL level signals) to XBEE(3.3V) or any level shifter is must.

Pls help.
Ttelmah



Joined: 11 Mar 2010
Posts: 19513

View user's profile Send private message

PostPosted: Thu Apr 15, 2010 4:46 am     Reply with quote

Multiple parts to the answer.
For the PIC's TX line, add a resistive divider. Not doing so, risks drawing excess current from the PIC, and damaging the 3.3v input.
For the RX line, it depends on whether you are using the hardware UART input (a 'must' really, if you want to do other things, and don't want to miss data). If so, then, 'yes', a level translator is a must. The UART input, on the PIC running at 5v, requires the signal to go up to 4v. Using a 'software' UART instead, depending on the pin chosen, you _may_ be able to operate without a transceiver, but at the cost of potentially losing data, not being able to do other things while receiving, etc. etc..

Best Wishes
balaji



Joined: 30 Mar 2010
Posts: 21

View user's profile Send private message Send e-mail

need much information
PostPosted: Thu Apr 15, 2010 5:43 am     Reply with quote

Thanks for your reply. I really need both Tx/RX pin to be connected becoz my project requires Full duplex comm. Hence kindly suggest me the level convertor chip
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: need much information
PostPosted: Thu Apr 15, 2010 6:26 am     Reply with quote

balaji wrote:
Thanks for your reply. I really need both Tx/RX pin to be connected becoz my project requires Full duplex comm. Hence kindly suggest me the level convertor chip


I don't think you will need one. I suggest dropping the PIC +5V to +4.5 - this is enough to let the PIC run happily and bring the supply voltages closer together. Then connect a 2.2K resistor between Tx out of the XBee and Rx of the PIC. Connect a 1.1K resistor from the PIC Tx pin to the XBee Rx pin and connect a 2.2K resistor from the XBee Rx PIN and ground.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Apr 15, 2010 9:52 am     Reply with quote

Quote:
I don't think you will need one. I suggest dropping the PIC +5V to +4.5 - this is enough to let the PIC run happily and bring the supply voltages closer together

This will not work. The spec sheet states that the RX pin is a Schmitt Trigger input and the VIH (minimum input level to register a High) is 0.8 * VCC. If VCC is lowered to 4.5V then the minimum level, to register a high, would be 3.6V. Since the XBEE runs at 3.3V, this will not be high enough.

I have used MAX3371 level converter in several of my project that use XBEE's and it works flawlessly. If you only need to send data to the XBEE then a voltage divider will work fine. Otherwise, if you need to send data out you will need a level converter.

Ronald
balaji



Joined: 30 Mar 2010
Posts: 21

View user's profile Send private message Send e-mail

PostPosted: Thu Apr 15, 2010 11:33 pm     Reply with quote

MAX3371 is single channel level shifter. Can you suggest any chip that has dual channels? Or shall I use 74LVC4245 buffer?
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri Apr 16, 2010 8:29 am     Reply with quote

I've never used that part but, after looking at the spec. sheet, it might work. You'll need to be the one that determines the differences between real-estate and cost of each part. For using both TX and RX signals, I've just used two max3371 parts. You could go to Maxim's site and see if they might have something you would like. They have several option available.

Ronald
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Apr 16, 2010 10:13 am     Reply with quote

rnielsen wrote:
I've never used that part but, after looking at the spec. sheet, it might work. You'll need to be the one that determines the differences between real-estate and cost of each part. For using both TX and RX signals, I've just used two max3371 parts. You could go to Maxim's site and see if they might have something you would like. They have several option available.

Ronald


I would use resistors from the PIC Tx to the XBee RX - its not as though you are concerned with loading at high speed as the XBee supports a maximum of 250K bps and I have used dividers without problem at 10Mbps
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
balaji



Joined: 30 Mar 2010
Posts: 21

View user's profile Send private message Send e-mail

74HCT125
PostPosted: Mon Apr 19, 2010 6:46 am     Reply with quote

Thanks for all your support.
I planned to put 74HCT125 buffer between the MCU and XBEE and zener of 3.3V before RX pin of XBEE. I think it must work.
Any comments??

pls include your resistor value
balaji



Joined: 30 Mar 2010
Posts: 21

View user's profile Send private message Send e-mail

It works
PostPosted: Wed Apr 28, 2010 9:28 pm     Reply with quote

hai all,

I tried the circuit with 74HCT125 and 3.3V zener. It works.

Thanks all
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group