RS232 max reliable speed? - Page 1
Forum section: electronics / projects

author: sasa
author_rank: Regular Contributor
timestamp: October 12, 2017, 09:22:12 am
content: What is the max reliable speed on RS232?Datasheet for MAX232 state 120Kbps and MAX3232 1Mbps. Is there some IC capable to provide faster communication on RS-232?

author: danadak
author_rank: Super Contributor
timestamp: October 12, 2017, 09:27:38 am
content: This might help -https://www.lammertbies.nl/comm/info/RS-232_specs.htmlhttps://stackoverflow.com/questions/13194017/maximum-potential-speed-for-serial-port-rs232Regards, Dana.

author: grumpydoc
author_rank: Super Contributor
timestamp: October 12, 2017, 09:29:01 am
content: The standard (IIRC) says 19.2k at 50 feet, anything faster is suck it and see.115 k, maybe even 230k is pretty much a given on decent cables in the 1-3m range.You probably won't get 1Mbps on anything other than very a short link.RS232 is not designed for high speed - what is your application?

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 12, 2017, 09:38:42 am
content: If you need speed and/or distance, RS422 or RS485 are the way to go. Easily does 4MBaud over 100m on Cat5

author: stj
author_rank: Super Contributor
timestamp: October 12, 2017, 10:01:54 am
content: but then you could use serial-over-ethernet drivers and run 100m of cable at upto a gigabit!!

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 12, 2017, 10:03:26 am
content: Quote from: stj on October 12, 2017, 10:01:54 amBut you need more hardware for that

author: sasa
author_rank: Regular Contributor
timestamp: October 12, 2017, 11:28:25 am
content: Thank you all for comments.My intention is to provide an experiment with ATMega 328p/2560 and make very simple oscilloscope (up to 250KHz, perhaps), sending ADC data to PC for visualization. Of course, there is a better way to make it based on PICs with native USB 2.0, however limit is as well XC8 in free mode, etc. Not very suitable with AVRs as well, however this would be only an experiment.ATMega 328p datasheet state that max speed for UART can be 500Kbps, or even 1-2Mbps (if I read table correctly), thus MAX3232 through FTDI/FT232RL based USB to serial converter (up to 1Mbps or more) should be good enough if native RS-232 is limited to 115200. Cable is short, less than 2 meters.All spec. as well moderately depend on 10-bit ADC measurement speed settings, but that is on me to read datasheet, then sensing +/- voltage, etc. However, that is for another thread, perhaps.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 12, 2017, 11:53:34 am
content: Quote from: sasa on October 12, 2017, 11:28:25 amYou won't get 500Kbaud through most RS232'sIf it's just 2 metres just keep it at TTL levels and use a TTL232 cable

author: JPortici
author_rank: Super Contributor
timestamp: October 12, 2017, 12:14:00 pm
content: Quote from: sasa on October 12, 2017, 11:28:25 amhow is it a limit?the limit is probably in your computer OS and the bandwidth required to transfer data quickly so you can reduce the blind time between acquisitions.I did a very simple 'scope (actually a data logger with realtime display) with a 18f because i needed to see how a throttle pedal signal changed in a car on the other side of the world that had all sorts of issues... the guy didn't have a scope but had a pickit and one of our boards he could re-program and a usb-ttl cable. I had to limit the samplerate at 10kS/s or so... it was plenty but here's why:let's say you transmit 8 bit packets, with a single start and stop bit that's effectively 10 bits per byte.250kS/s = 2.5 Mbaud/sthat already a lot for both your 8bit mcu and the USB-UART chip, if you need continous sampling (i did).besides, you want to transmit packets with a defined header and termination to mantain syncronization so you know the position of the samples you are transmitting.i ended up with 230.4kbps and 10kS/s per channel, two channels. PIC18 just acquired samples, packed them and pushed them through uart.If i wanted to increase the UART speed i would have problems in the windows application with chunks of missing samples, data was correctly sent through uart though.

author: sasa
author_rank: Regular Contributor
timestamp: October 13, 2017, 04:58:14 am
content: Quote from: JPortici on October 12, 2017, 12:14:00 pmXC8 PRO produced 60% smaller and 400% faster code - inherited limitation in FREE mode from HI TECH compiler. The Microchip USB framework was for C18 and there was some moderate problem (probably size) even to compile modified code and any example on XC8 for 2550/4550.I have not used 8-bit PICs and XC8 since these first releases and I do not recall of all details. I'm not aware is it any better now.QuoteI would be satisfied if manage up to 80KHz. With 328p on 16MHz and ADC prescaler factor 8, sampling frequency should be 16MHz/8/13 ~ 153846Hz, if I read datasheet correctly...Etc, etc... All that is on me to determine, it is just a hobbyist experiment.Thank you very much for your comment.

author: JPortici
author_rank: Super Contributor
timestamp: October 13, 2017, 05:20:24 am
content: Quotejust like the compiler saysI admit i haven't tried the pro version in quite some time but for some reason i don't believe him. I remember when i used to write big chunks of inline assembly, if confused the compiler on the number of instructions it could optimize, but it would always tell me it would end up producing 60% smaller and 400% faster codeI think that in this application the biggest limit on the MCU side is lack of buffers and/or DMA and (if using 8 bit pic) the lack of hardware pointers capability so you have to waste a lot of time moving things around, load the uart every single time, when you could just be looking for triggers or doing other software trickery

author: jaromir
author_rank: Unknown
timestamp: October 13, 2017, 05:55:51 am
content: Quote from: sasa on October 13, 2017, 04:58:14 amThe exact quote goes likeQuoteNotice theyou could haveandup to. Using it in PRO mode doesn't mean it's artificially bloated to add 40% of size and quarter of the speed. In fact, generating such as precisely calculated bloat would be technically quite challenging.What they are doing is turning offsomeof the optimizations that will savesomecode space and execution time, that in very specific and artificially prepared test cases lead to quadruple speed and/or 60% code space; though my experience tells that in "normal" programs the improvement is in order of few percents, perhaps 10% for both parameters.The PRO license is perfect when you want to squeeze last few words of your two cents cheaper MCU, because that's what counts when you are producing 100.000 of units; but free version being completely adequate for anything else.

author: danadak
author_rank: Super Contributor
timestamp: October 13, 2017, 12:05:14 pm
content: Another approach is to use LVDS transceivers at both ends of a link,some with framers. Simple, very effective. Coupled with DMA, wouldmake a very fast and reliable connection.PSOC has onboard DMA engine.Regards, Dana.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 13, 2017, 03:07:35 pm
content: My suggestion:Up to 1 meter, just use standard 5V or 3.3V CMOS, possibly with some 22R series termination - so this is basically what the $1 "USB TTL SERIAL" dongle is, without MAX232. 2Mbaud/s is probably fine, possibly even more. (the $1 dongles may have problems unrelated to electrical properties, such like buffering high data rates, so that's just an example).If you need longer cables, then use RS422 transceivers. It's an easy solution, you still use the UART you are familiar with, just replace the MAX232 with something designed for providing actually useful physical layer (i.e., higher speed differential, such as RS422).If RS422 is too slow, then there are a lot of options, but your basic MCU UART is too slow anyway, then, so you are looking at something more modern and complex.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: October 13, 2017, 03:23:21 pm
content: Quote from: Siwastaja on October 13, 2017, 03:07:35 pmRS422/485 is fine for anything you'll get from a UART - typically up to 12MBaud, depending which transciever you use.Above that things are a whole different ballgame.