PDA

View Full Version : Pair of PICs, Xbee's and rs232



Michael
- 23rd December 2011, 22:48
I have a pair of PIC's that are using the software RS232, one is a transmitter, the other a receiver.

When they are hard wired (serout to serin) they work flawlessly.

I also built 2 boards that uses xbee's to transmit wireless RS485, and I hook up my 2 pics to an SN75176 rs485 to rs232 converter.

That also works perfectly.

BUT --

If I try to connect RS232 (pic software generated, not usart), directly to the data in and data out of the XBEES, I get zilch. ? !

I have level conversion 5v to 3.3 and vice versa and have tried everything but it won't work.

Doesn't make sense because the very same rs232 data is going in (and out) of my SN75176b chips and they work fine.

any ideas?

Michael
- 24th December 2011, 14:36
here's what's happening (or not happening) -- doesn't make sense.

transmit:
PICserout rs232 > sn75276 convert to rs485 > another sn76176 back to rs232 > XBEE datain > rf out

receive:
rf in > XBEE dataout > sn75176 convert to rs485 > another sn75176 back to rs232 > PICserinrs232

The above works like a champ. Only 1200 baud and it transmits a good 150'. (No doubt your wondering about the two sn75176 -- seems redundant but no time to explain).

If I simply remove the sn75176b chips and don't change ANYTHING -- in other words, a direct rs232 connection -- it won't function.

I have proper 3.3v to 5v level conversion everywhere, I've tried pullups and pulldowns, a series resistor and nothing.

I do see a data stream on my scope at the receiver end but it cuts in and out. ??? !

amgen
- 24th December 2011, 15:19
how about 232 transmit from pic inverted, xbee probably looking for correct polarity of 232. send and recieve on pics.

Michael
- 24th December 2011, 18:33
you beat me to it -- funny because i tried a chip inversion to try and fix it but no go -- then I tried T1200 (was using N1200).

the xbee must need true? changed both the rcvr and xmtr to T1200 and they work fine -- which tells me the sn75176 must invert as well.

amgen
- 24th December 2011, 19:15
ok, why the 2 485 chips each and don't you want to go to higher baud like 38k or more ?

Michael
- 25th December 2011, 17:19
Simple I/O Industrial control -- opto isolated and 1200 baud for reliability -- the rs485 chips are there because the PCB will retrofit into another product.