I've made this into a new topic because I am no longer interfacing an ATOM to a parallax stamp. I couldn't figure out how to edit the title of the previous topic.

I've been working on this all day, and have got basic serial communication between two ATOMS with a rudimentary flow control pin. My code is almost identical to Dale's code in his post on January 28th, 2002, in the topic on PIC to PIC serial communication (http://forums.basicmicro.net/atom-f484/pic-to-pic-serial-problem-t4277.html.) I have also spent hours on this forum looking at any and all other chip to chip serial topics.

Like I said, I have got this working, but sometimes the flow pin will just not reset. With both chips turned on, if I pull the flow control wire and connect it from P4 on the transmitting chip directly to Ground, it will make the chip start sending serout commands again. Is there anything I can do to make this setup more reliable? Different resistors, caps, what? I am not an electrical engineer and could really use the help here.

This is exactly the resistor setup of my actual circuit. I am pulling the flow control wire high, because a low signal triggers the transmit chip, and I am pulling the serial wire low, because I am using normal (non-inverted) serial data.

Any ideas on resistors or caps, or a different setup altogether?

Also, I have run a robo claw with 300 feet of wire between it and the controlling ATOM chip. I want to use the same amount of distance between the two ATOMS. Will this be possible? Do I need TTL/RS232 transceiver chips?

Two things I would change. Replace the 2.2megaohm resistors with 2.2kohm or even 1kohm resistors. The megaohm(millionohm) resistors will have almost no pullup capability. Replace the 1000ohm resistors with 220 to 330ohm resistors. The 1000 ohm resistors are for current limiting but 1000ohm is way too high(your leds will be very dim).

The receiving ATOM uses hardware serial to buffer the signals from the transmitting ATOM. My hardware serial lines on the transmitting ATOM are taken, so I had to use software serial.

Also, I am 99% sure that the commands "enablehserial" and "sethserial" are not included in the "reference manual version 1" (though sethserial1 and sethserial2 are included, and yes, this was confusing). I am not sure about any manual that may be in the forum, though it seems like the hserin section is not there. I think I discovered the "enablehserial" from someone's code on the forum.

I'm using version 1.0.0.32 and it gave errors without "enablehserial". Thanks for giving me the heads up on the new version of the software. I didn't see it had come out.

I have also now successfully tested the above circuit with 330 feet of wire between the two chips and with two separate power supplies. The grounds of the chips and supplies are connected with an additional 330 foot conductor.

Correct, the 1.0 Studio required the enablehserial directives. As of approx 2.0.0.5 those directives are nolonger needed. Also we added support for the second hardware serial port on some AtomPro processors into the hserial commands which required the SetHserial commands to be renamed(eg SetHSerial1 and SetHSerial2). The manual in the forums is the current most up to date manual for the current release of Studio. Obviously old versions of studio will not always be compatible with the newest release. Also the download section of the main website always has nearly the latest release available. it tkaes a little while to get the webmaster to update that for me.

So concerning long distance serial communication, are there any sort of filters or capacitors or any special components or connections that would maximize a long distance chip to chip serial connection? I am not having problems chip to chip at 330 feet (which is my maximum distance) but I would like to make that connection as stable as possible. I do have shielded twisted pair wire between the chips. Anything else?

I know the obvious answer is that TTL serial is not made for long distance communication, but...

For long distances, use RS-422 or RS-485 differential pair drivers/receivers. Also make sure you have the proper termination resistors. Try the MAX485/RS-422 chips.

Alan KM6VV

blake3 wrote:

So concerning long distance serial communication, are there any sort of filters or capacitors or any special components or connections that would maximize a long distance chip to chip serial connection? I am not having problems chip to chip at 330 feet (which is my maximum distance) but I would like to make that connection as stable as possible. I do have shielded twisted pair wire between the chips. Anything else?

I know the obvious answer is that TTL serial is not made for long distance communication, but...

Who is online

Users browsing this forum: No registered users and 0 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum