Baud rate --- Propeller 1200, 2400 , 4800 ???
markuster
Posts: 184
Hi,
I need to connect a Propeller microcontroller with a long cable to a PC.
I will use 150 feet RJ45 cable CAT 6.
I had some problems using 9600 baud rate. I need to transmit just data
from the Propeller to the PC
I would like to know if I can use lower speed like 1200 baud rate in order
to ensure good connection.
What do you think if this speed will help ?
Is 1200 too slow ?
Is there any real difference between 1200 and 4800 baud rate ?
Thanks,
I need to connect a Propeller microcontroller with a long cable to a PC.
I will use 150 feet RJ45 cable CAT 6.
I had some problems using 9600 baud rate. I need to transmit just data
from the Propeller to the PC
I would like to know if I can use lower speed like 1200 baud rate in order
to ensure good connection.
What do you think if this speed will help ?
Is 1200 too slow ?
Is there any real difference between 1200 and 4800 baud rate ?
Thanks,
Comments
This is substantially about noise interference. But there is also an problem in that today's RS232 ports may drive just between 0-5 volts instead of adherding to the older standard of -12/+12. A lot of products just don't want to bother with dual voltage and higher voltage power supply for the RS232 communications.
If that is not to your liking, you can use the same code that RS232 serial uses with a full duplex RS422 chip set. That takes four wires, but will bring the speed back up to as high as 115,200 baud and the distance of 1000 meters being reasoable.
I have built RS422 full duplex and worked with a RS232 to RS422 adapter from my computer to the Propeller over 100 meters of LAN wire, that CAT5 stuff that has 8 tiwisted pairs.
It is a bit easier if you don't want to program the Propeller of the wire, but you can also do that if you are wiling to use 3 twisted pairs, instead of the usual 2 twisted pairs.
I am NOT a supporter of USB to CAT5 to USB as it introduces more layers of format change and can be more buggy.
I'll try to locate the thread earlier this year where all the debat and designes for RS422 were discussed. That's when I built my current set up.
http://forums.parallax.com/showthread.php/149387-Your-longest-serial-cable-connection
A. An RS232 to RS422 converter
B. A USB to RS422 convert (FTDI sells a cable that will even include the RS232 control signals to program the Propeller at a distance.)
At the Propeller end, you need a RS422 reciever and an RS422 tranmitter for full duplex Rx and Tx. If you want to program the Propeller, another RS422 reciever is required and it will drive the RST line via a transistor.
********************
The above is Not expensive in comparison to the long distance USB - CAT5 - USB setup. And I feel it is easier to work without the USB ports being involved at both ends.
You also end up with a setup that will go farther distances... up to about 1000 meters without repeaters. But limitless if you use RS422 repeaters.
http://forums.parallax.com/showthread.php/142386-Simplest-RS485-to-RS232-conversion
I guess you already know all about it as you are the original poster.
http://forums.parallax.com/showthread.php/149224-I-need-to-know-the-best-cable.?highlight=RS422+loopy
But is it better to use less speeds like 1200 baud instead of 9600 baud to ensure better comunication ?
You wrotte "300 baud" .
Is 300 baud an usefull speed to send a simple object detection data from the Propeller
to a PC ( 50 readings per second ) ?
Thanks again.
But the problem is how to know the speed.
I think if the speed is too low , it will be impossible to send the total amount of data.
For this reason could be usefull to know how I could calculate the better speed
and for this reason I am asking if the speed is important or not as important than
other like cable manufacturer , cable lenght or cable CAT 5 or 6., etc
I don't know if I am explaining my self.
Thanks.
38kHz out of the noise. If the far end is terminated with a 100 ohm resistor this ought to fly for several km as most of the attenuation
would be tuned out.
When using CAT5/6 or course its absolutely vital to send signal/ground over the same twisted pair.
If you must use TP cable then use a simple balanced driver or even just an RS485 chip locked into transmit or receive plus you can easily run high speeds. Taking into account the actual characteristics of RS232 receivers you will be able to run the output of the balanced receiver directly into the PC RS232 port without the messy and redundant RS232 drive levels. Alternatively you can just try a simple 5V logic inverter gate as the driver all the way down the line straight into the PC, I think you will be pleased to see how simple it can be.
BTW, 1200 baud is very slow and if your present arrangement isn't working then something is wrong but you should double check that your circuit works with a short cable anyway. I gather that you have not connected any other signals other than your transmit from the Prop and a signal ground which should be on the same pair together.
Also, the 38kHz stuff mentioned only works because the receiver is AC coupled and "tuned" to that carrier as this circuitry is built-into the IR sensors. Duplicating that at the hardware level is too much work and it's better and easier to just use balanced drivers.
Reducing the baud rate is a trial and error process that is only worth doing if you really have to. At some point, the wire is either going to be too long or the noise environment to high for any reduction in baud rate to gain anything.
The RS422 is wonderful as the noise goes away, and nothing is lost in speed. It also can be done with 3.3 volt chips or 5 volt chips -- no weird demands of a complex power supply. And finally, the chips are both very cheap and very easy to wire up.. easier than the Max232.
I really have no idea if 150 feet of RS232 is feasible. I have never bothered to try it (for all the reasons I have mentioned). And as you mention, the comes a point that you don't want the baud rate to be so slow.
~~~~~~~~~~~~~
I did do a lot of shopping around on the internet for the idea RS422 full duplex with control signals to USB and found the Ftdi has a dongle that is likely the absolute best value. There is really no reason to bother with the junk on EBay when the good stuff is so reasonable.
FTDI is claiming either 3Mbaud, not just 115,200 baud. It doesn't get any faster or cleaner.
Use the USBRS422 cable if you just want 2 pair (four wire) full duplex serial to and from the Propeller Or it can also be used to set up a 3 pair (six wire) scheme to program the Propeller from afar.. Cost is about 37 British Pounds shipped to Taiwan. If that is too much, a DIY build of RS223 to RS422 is maybe 1/3 of that cost.
http://www.ftdichip.com/Products/Cables/USBRS422.htm
I reread the original thread of this topic and someone else says you might be able to do 120 feet at 9600 baud. That might mean 150 feet as well. But that seems to be a starting point from someone with experience. You just have to try it and see if you get good results or nonsense.
If you get occasional nonsense, you go down by half to 4800 baud and try again. When you get stable good data, you quit.
~~~~
You seem to think that twisted pair wires with one a ground and one going high/low is protected from noise. If really is not as protected as the 'differential pair' of the RS422. What happens in differential pair, one line goes high as the other goes low, and vise-versa. There is no one line that holds to ground... but it manages to be very resistant to noise from outside electrical fields. The transmitter and receiver at each end translate the signal to and from ttl high and low over a very short jump that is less prone to picking up noise than a long wire.
A rough divide by 10 gives you characters per second. Unless your object data is really small, 300 baud won't be quick enough. 1200 baud might be, assuming two bytes of data per data unit and a few bytes to mark beginning of packet, time stamp on data set, etc...
I would shoot for the 9600 personally. It's quick enough, and that leaves you room to do things like send the data twice, include header, time stamp, whatever you want.
If you fail, a downgrade to 4800 is still quick enough, and both should work well at the target distance you've got, assuming good cables. I did it with the old solid wire clunker cables common to that time period, hand soldered end connectors, etc... Longest connection was almost 300 feet and I can't remember whether or not I had to downgrade that one or not. If I did, it was 4800 baud.
Tons of cheap transceivers available:
Here's 5 for $5 USD shipped.
http://www.ebay.com/itm/like/330735703560?lpid=82
1. Half-duplex means you have to use two chips to get Full-duplex
2. The lesser baud rate is because the chip has more control of the quality of the signals transmitted and received (easier to build with). That is fine with me as I don't need to go to 3Mbaud. I rarely go about 115,200 baud.
Yes indeed RS422 full duplex is cheaper than RS232 adapters such as the MAX232
http://www.ebay.com/bhp/maxim-max232-ic
And easier to wire.
http://www.maximintegrated.com/datasheet/index.mvp/id/1111
By twisting each signal with a ground, you create a canceling effect that limits the effect of electric field interference because it's positive on one half-twist but negative on the next. Twisting the signals around each other in the same pair is very bad, allowing both signals to pick up EM interference along their entire length and causing strong capacitive coupling between the two lines. You need to hook both ground wires up to ground, but you don't want them to form a loop so you only hook both of them up at one end -- which end doesn't matter.
If you wire it like this I would give you 80% chance of success. If the wire were shielded I would say 99%.
Also establish that it works with a short cable, as suggested.
Localroger's grounding scheme sounds like one I saw used that worked over a distance that I though should have been too long. Grounding can get interesting.
Lastly, what kind of cable are you using? Often, when I have a connection problem it turns out the cable itself is a crappy off brand.
Really surprised it is not used more often.
Good to know I'm not alone in sticking with something that works well and lasts a long time.
I tested with 237 feet and it was impossible to "see" the Propeller connected using my PC but know I used
a 150 feet cable and it is working !!!! .
I have it at 9600 baud.
I thought to download to 4800 baud rates to ensure good comunication
but the complete proyect need 8 Propellers working at a time sending data at the same time
and perhaps the 4800 baudrates coud be not enought speed for all the Propellers.
This first Propeller will be the Master be cause all the oother seven Propellers will send the data to
the Master and only this master will be conected to the PC
I am using CAT 6 cable twisted and at the beggining of the cable I have B configuration socket and at
the end of the cable I have the B configuration cable too.
Do you know how add more cable ?
I think download the Baude rates to 4800 could be a sulution
But do you know and other idea '
Thanks