Go Down

Topic: I2C to RS485 (Read 7697 times) previous topic - next topic

jsav2000

May 23, 2016, 02:39 pm Last Edit: May 23, 2016, 02:45 pm by jsav2000
Hi all,

I have an IC, MAX485, which converts UART to RS485 and RS485 to UART.
http://pdf1.alldatasheet.com/datasheet-pdf/view/73463/MAXIM/MAX485.html

I would like to know if an IC like this, but, instead of UART, interfacing with I2C, exists.

Thanks, in advance.

septillion

#1
May 23, 2016, 03:03 pm Last Edit: May 23, 2016, 03:03 pm by septillion
Problem is, the MAX485 doesn't convert it from UART to RS485. It only converts the signal from TTL to RS485. It doe nothing with the protocol, that just passed on. It's common to use asynchronous serial over RS485 (which is what you get when you connect UART to a MAX485) but nobody says you have to...

So in theory you could convert the TTL I2C signals to RS485 with two MAX485 but that's probably not what you want. I think what you want is to go from TTL I2C (what comes out of the Arduino) to RS485 asynchronous serial.

I don't know a chip that can do that by default (because it's not really a common thing to do) but you can just use an Arduino to do so. Just make a sketch that passes I2C (Wire library) data to the Serial (and maybe the other way around somehow if you want two way communication) and just connect a MAX485 (or two for full duplex) to that Arduino.
Use fricking code tags!!!!
I want x => I would like x, I need help => I would like help, Need fast => Go and pay someone to do the job...

NEW Library to make fading leds a piece of cake
https://github.com/septillion-git/FadeLed

raschemmel

#2
May 23, 2016, 03:06 pm Last Edit: May 23, 2016, 03:07 pm by raschemmel
Quote
UART to RS485  
" UART " is NOT the name of a serial protocol. It is the name of a device. Serial protocol is called "TTL SERIAL " (not "UART").

(Google "TTL")

Also, I2C pins (A4 * A5) are OPEN COLLECTOR. (Need 4.7 k ohm pullup resistors to +5V)

Grumpy_Mike

This is a USB to I2C interface
USB to I2C
But you need to program it. I made a transistor tester with it programming it in Processing:-
http://www.thebox.myzen.co.uk/Hardware/Transistor_Tester.html

raschemmel

Quote
I would like to know if an IC like this, but, instead of UART, interfacing with I2C, exists.
Why ? What do you plan to use to drive it if there was one ?

Is there an arduino in this post anywhere or are you just looking for a protocol translator from RS485 to I2C ?

Do you then plan to translate back to RS485 ?

68tjs

#5
May 23, 2016, 09:28 pm Last Edit: May 23, 2016, 09:29 pm by 68tjs
Quote
Serial protocol is called "TTL SERIAL "

(Google "TTL")
Except that  microcontrollers  are not TTL logic but CMOS logic.
TTL use bipolar transistors not CMOS.
TTL enforce Vcc = 5V. Absolutly no TTL device works with an other voltage.
Cmos logic are not TTL compatible : there is special family in 74HCxxx logic IC for TTL compatibility : 74HCTxxxx.
Even if using the term TTL for IC which can operate at different voltage of 5V  is in common use  this is nonsense.

Ceux qui savent qu'ils ne savent rien en connaisse autant que ceux qui croient tout savoir et qui n'en connaissent pas plus qu'eux.
Pierre DAC.

raschemmel

#6
May 23, 2016, 09:37 pm Last Edit: May 23, 2016, 11:13 pm by raschemmel
Nonsense.
"Cmos logic"  is meaningless because CMOS comes in so many different voltages.
"TTL LEVEL " is the universal term for 5V logic. No one cares if TTL is obsolete. TTL LEVEL means 5V logic and everyone knows that. (except you apparently). No one uses the term "CMOS LOGIC" because is means nothing.
arduino is "TTL "LEVEL"


Quote
The Arduino is built on a slightly more robust platform. The most noticable difference is that the invalid region of voltages is only between 1.5 V and 3.0 V. The noise margin is greater on the Arduino and it has a higher threshold for a LOW signal. This makes building interfaces and working with other hardware much simpler.
arduino-logic-levels

68tjs

Sorry but IMHO you are wrong.
It is not sufficient that the majority mistake in using badly TTL term for this term becomes  righteous.

Quote
arduino is "TTL "LEVEL"
Arduino is a board, what is important is the micro controller Atmel.
I repeat  TTL enforce Vcc = 5V .
Some Nano and mini-pro works with Vcc = 3,3 volts
DUE and Zero are 3,3 V,  they are not TTL logic level.


Your remark about the use of the term UART is right. (UART = Universal Asynchronous Receiver Transmitter)
But IMHO  use of the term UART to define the  serial protocol is more appropriate that  your generalization of the term TTL for integrated circuits that have absolutely nothing to do with the TTL logic.
Remember that all new circuits use 3,3Volt (Zero, Due for exemple) , 5V is endangered and 2.5 Volt is about to come. Use of TTL term is an error and it is dangerous.

UART (and USART) inherits only protocol part of the RS232 standard
The use of the term RS232 to define the  serial protocol  must be banished as it means of voltage levels of -25 V to +25 V.
Ceux qui savent qu'ils ne savent rien en connaisse autant que ceux qui croient tout savoir et qui n'en connaissent pas plus qu'eux.
Pierre DAC.

raschemmel

Quote
But IMHO  use of the term UART to define the  serial protocol is more appropriate that  your generalization of the term TTL for integrated circuits that have absolutely nothing to do with the TTL logic.   
You are still not getting it. Go back and read my post. I never said anything about ICs. I specifically said that the both the terms "TTL" AND the term "TTL LEVEL" , refer to the voltage levels, NOT the ICS, when you say "TTL SERIAL, " you are NOT saying TTL SERIAL ICs . You are saying "TTL LEVEL" . Even though 7400 family ICs are still around, TTL technology is basically obsolete. All that remains is the convention of using the term "TTL LEVEL" OR "TTL SERIAL" to describe 5V logic, whether it comes from CMOS ICs or TTL ICs. The term TTL no longer means 7400 ICs like it used to. Now it just means 5V logic. Can you say that "technically " it does mean the ICs ? Sure.

be80be

#9
May 24, 2016, 02:19 am Last Edit: May 24, 2016, 02:21 am by be80be
Oh heck just say 3.3 volt serial or 5 volt serial one never knows nowdays. A real comport should have 7 volt swing, but most are 0 to 5 then comes The tll serial it can be anything from 0 to 5 volts and some is 0 to 2.5
So what we need to know is what the OP using and What the OP want's to end up with.

But I2C was not made to send over any kind of long wire if that's what the OP is after forget I2c and just send the data over RS485 after all 0xff will still be 0xff in the end.


Power_Broker

Nonsense.
"Cmos logic"  is meaningless because CMOS comes in so many different voltages.
"TTL LEVEL " is the universal term for 5V logic. No one cares if TTL is obsolete. TTL LEVEL means 5V logic and everyone knows that. (except you apparently). No one uses the term "CMOS LOGIC" because is means nothing.
arduino is "TTL "LEVEL"



arduino-logic-levels
Someone forgot their coffee this morning lol
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

raschemmel

#11
May 24, 2016, 03:10 am Last Edit: May 24, 2016, 03:13 am by raschemmel
Quote
The Arduino is built on a slightly more robust platform. The most noticable difference is that the invalid region of voltages is only between 1.5 V and 3.0 V. The noise margin is greater on the Arduino and it has a higher threshold for a LOW signal. This makes building interfaces and working with other hardware much simpler.  
What that means is that it is NOT standard CMOS level. It is 5V logic but TTL COMPATIBLE.

If it is TTL COMPATIBLE that makes it "TTL LEVEL"

I stand by my previous statement. No matter where you go , no matter what product you look at, no company describes their product as "CMOS LEVEL" or "CMOS COMPATIBLE", or "CMOS SERIAL".

They ALL use the standard term "TTL LEVEL" ,"TTL SERIAL, or "TTL COMPATIBLE".

ARDUINO LOGIC LEVELS ARE TTL COMPATIBLE.
If you don't believe that then hook up an old 1970s series 7400 TTL chip to an input or output and it will work, every time. To say the arduino GPIO is "CMOS LEVEL" is BS. It may be CMOS circuitry but it's TTL LEVEL and TTL COMPATIBLE.

I don't need coffee to know that any TTL chip will interface to the arduino. It was specifically designed that way. (that's what the above quote means)

Power_Broker

What that means is that it is NOT standard CMOS level. It is 5V logic but TTL COMPATIBLE.

If it is TTL COMPATIBLE that makes it "TTL LEVEL"

I stand by my previous statement. No matter where you go , no matter what product you look at, no company describes their product as "CMOS LEVEL" or "CMOS COMPATIBLE", or "CMOS SERIAL".

 They ALL use the standard term "TTL LEVEL" ,"TTL SERIAL, or "TTL COMPATIBLE".

ARDUINO LOGIC LEVELS ARE TTL COMPATIBLE.
If you don't believe that then hook up an old 1970s series 7400 TTL chip to an input or output and it will work, every time. To say the arduino GPIO is "CMOS LEVEL" is BS. It may be CMOS circuitry but it's TTL LEVEL and TTL COMPATIBLE.


Can someone please get this guy a cup of coffee? He needs it, real bad. Maybe even a hug.
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

raschemmel

#13
May 24, 2016, 03:15 am Last Edit: May 24, 2016, 03:25 am by raschemmel
Quote
Can someone please get this guy a cup of coffee? He needs it, real bad. Maybe even a hug.
You're the one that needs the coffee.

I never said the arduino was TTL technology. I said it is TTL compatible. The fact that it is CMOS is irrelevant because when you are discussing logic levels, you don't talk about CMOS levels unless you are discussing CMOS family ICs like the 4000 series. The arduino logic levels are clearly different that the CMOS 4000 series. It is different to make it possible to use TTL technology to interface with the GPIO.
4000 SERIES CMOS doesn't source 40 mA.

Power_Broker

You're the one that needs the coffee.
Ohhh baby, Imma scared now lol.
"The desire that guides me in all I do is the desire to harness the forces of nature to the service of mankind."
   - Nikola Tesla

Go Up