I´m a new Arduino user and I like to learn.
I got an Uno Rev.3 which I have already made some small sketchs.
Now I need to run a remote (about 50 feet away) wired I/O unit with at least 8DI and 8DO.
I´d like to stay with something simple.
Is RS232 enough, do I have to go for RS485?
Which friendly (programable for newbie) boards out there?
This is my first post, thanks in advance for helping!
If I remember... RS232 is specified for 10 meters, 30 feet but works for significantly larger distances when using a moderate baud rate and well selected cables. Of corse stay away from sparking welders, high power radio transmitters and similar stuff.
Um. 15m. (50ft!) (Actually, the spec if for maximum cable capacitance.) RS-232 - Wikipedia
Much longer distances usually work fine in practice.
The next higher speed choice is probably rs422, which is more-or-less backward compatible.
Protocol-wise, you could do a lot worse than to duplicate i2c port expanders.
What would you do if you were me (still with poor programming skills)?
It has to be a wired line. I had a lot a faith on the CDP6402 IC...
So this leaves me with a RS485 protocol, which I understand it's pretty good for my needs although I never worked with it. I've been reading about the RS485 and Modbus RTU on Arduino, but I'm a bit in the dark...
I disagree. Depending on speed, I guess. It used to be common to run rs232 at 9600bps all over office buildings through standard telco wiring, far further than 50 feet.
Once you put something at the end of a serial port you need a processor at the other end.
I had a lot a faith on the CDP6402 IC
The 6402 is ancient. (I used two in my first work project after college, converting a 6bit 75bps newswire feed to 8bit rs232. That was 1981.) it needs a separate clock generator. It might work simply enough for outputs, but you'd need some way to trigger it to transmit the value of your inputs, which rapidly escalates into "more complicated and more expensive than another AVR."
This is normally implemented over a twisted wire pair as a half duplex system. That means it can only work in one direction at any one time. This means you need some sort of protocol to stop both ends trying to transmit at the same time.
This normally involves a master / slave protocol where the master end sends a fixed number of bytes and the slave end returns a fixed number of bytes in reply. You are free to make up this protocol as you see fit. But maybe it is too much software for you?
40 years ago 15 therminals were connected to the Nova computer via RS232. The distances were way greater then the spec. We used 9600 baud. The cables were selected, likely shielded. What did they cost? I've no idea.
Maybe RS485 is preferable now days.
There is no "RS232 protocol". It's an electric level specification. I don't remember if they even used the parity bit.
That's correct, +- 12 volt. 0 and 5 volt level has been named "TTL".
There are circuits shifting between RS232 and TTL.
The OP talked about RS232 and that is relevant. Running TTL levels for such distances is hopeless.