I2C to RS485 converter

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
598
@JohnInTX , attached find the ckt. This is for reference only, not complete.

I think it can solve below points. Please check it below poitns can be resolved.
1. I think it will have immunity of RS485.
2. Would be full duplex so can communicate with bq34z100-g1 i2c protocol also via SC18IM700.

One issue on which I am not yet clear:
1. When one or both of mosfet gets off i.e there is no connection between BAT- & Pack-, then can communication happen?
On master side either the MCU is powered from Pack+/Pack- or external supply. Communication should happen in both cases.
 

Attachments

JohnInTX

Joined Jun 26, 2012
4,787
You have connected two slave devices together. That accomplishes nothing.
I don't know about that. What I'm getting is (reading the schematic from right to left) is:

MCU single ended UART lines each get converted to balanced RS485 (two twisted pairs) by U5
Proceeding to the left, the long haul is connected via J2->J1
The differential pairs are converted back to single ended UART signals by U4
Those UART signals are presented to U3, the Master I2C-bus controller with UART interface. That chip uses async commands to effect an I2C master function
The only slave I see is U1 at the far left, the bq34z100-g1 battery controller.

What am I missing that makes it look like there are only slaves?

At any rate, it is a convoluted way to do it. And as @cmartinez suggests, I don't see how comms can continue with either MOSFET breaking the ground line. You would lose ground reference for U1. Even if U4 and U3 were incorporated into the battery pack using battery ground, turning off the MOSFETs would cause the RS485 link to drift around likely exceeding common-mode values. You might be able to get around that by putting a reasonable resistance across the MOSFETS that would allow ground reference sufficient to maintain RS485 while keeping fault currents to a minimum. Otherwise, you are looking at some isolated setup either opto or one of those cool digital isolation parts. A necessary next step is to detail the schematic showing power and grounds for each part.

FWIW I've attached the datasheets to make it easier for all.

Good luck!
 

Attachments

ErnieM

Joined Apr 24, 2011
8,415
Point taken. I missed the SC18IM700 was 485 to I2C master and not slave.

Still, breaking the ground is a major issue for common mode voltages on the 485 lines.
 

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
598
I got this point of common mode voltage range of RS485. Suppose RS485 IC has +-7V of common mode voltage range.
As far as I understand, this means that even though there is communication through A & B wires of IC, the value of voltage on A,B on both master & slave should not cross +-7V wrt to ground of any RS485 IC.


Gnd1->Master_A/Master_B ----- Slave_A/Slave_B<-Gnd2
1. If I put voltmeter :
+ve lead : At any pin Master_A/Master_B/Slave_A/Slave_B
-ve lead: Gnd1

The voltage should be range of +-7V at any pin of +ve lead.

2. Similarly If I put voltmeter :
+ve lead : At any pin Master_A/Master_B/Slave_A/Slave_B
-ve lead: Gnd2

The voltage should be range of +-7V at any pin of +ve lead.

Is this correct?



But I dont understand, I had made a project, in which master & slave had two different supplies, completetly isolated from each other, one had a smps based supply & other was battery operated.
Both were communicating thourgh only two signals A & B. There was no common ground or any other point. Just 2 wires A & B.
This was working perfectly fine.
Why was that so?
 

ErnieM

Joined Apr 24, 2011
8,415
I got this point of common mode voltage range of RS485. Suppose RS485 IC has...
Do not suppose. You chose a 485 converter, check the spec of the part you chose.

Then ask youself how you can guarntee you do not exceed the rating on these unconnected segments of your design.

My guess is you cannot and should either be looking at your grounding scheme (so grounds remain continious) or a truly isdolated system whene you use isolated RS-485 transceivers.


But I dont understand, I had made a project, in which master & slave had two different supplies, completetly isolated from each other, one had a smps based supply & other was battery operated.
Both were communicating thourgh only two signals A & B. There was no common ground or any other point. Just 2 wires A & B.
This was working perfectly fine.
Why was that so?
Why? You got lucky?

I could keep on guessing but there are no details to work with.

Start another thread if you are going to persist in asking.
 

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
598
Hi,

1. Attached fine the current2.pdf. It contains the actual board which I am using currently.
a)Q1 & Q2 are required in ckt as they protect the battery from charge & discharge error.
b)R1 is sense resitor for measuring current flowing in/out of circuit.
c)Bq34z100-g1 is powered by 3.3V. SO I2C signals are 3.3V.
d) Usage of Q3/Q5 & Q4/Q6 is explained in page 2 of current2.pdf
e) Communication breaks in following cases:
i) Q1 discharge fet off: Q3/Q5 fets off also
ii) Q2 charge fet off: Q4/Q6 fets off also
iii)Q1/Q2 both gets off: Q3/Q5/Q4/Q6 all gets off
f) Reasons for turning off of Q1 or Q2:
i) Q1 off: Battery gets over discharged
ii) Q2 off: Battery gets over charged
iii) Q1 & Q2 both off: Some short circuit in circuit.


2. Now I want that:
a) This problem off communication break do not occur
b) Convert I2C to differential communication RS485/CAN
c) Preferable as hardware asic based
d) As low power as possible, since circuit is battery powered.


3. I have attached a circuit CAN_BUS.pdf.
a) Fets in Communication line are removed.
b) I have used P82B96 & SN65HVD231 for convert I2C to CAN
C) On receiver side, CAN to I2C conversion is done
d) SN65HVD231 has CMR of -2V to 7V, I will select a device with CMR -7V to +7V.
e) On host/receiver side, communication ckt can be either powered from pack+/pack- or external supply.
f) But all return path for communication will be referenced to pack- only.



4. Can this circuit work?


5. Biggest problem will be:
a) When Q1 or Q2 or both gets, there will be no voltage between pack+ & pack-. & suppose receiver side is powered from external supply whose return path is reference to pack-.
In that case, can communication happen?

I think it can, as there is differential communication, moreover CAN IC has CMR of -7Vto+7V, while CAN IC are powered by only +3.3V, so I can be in limits


b) By connecting this circuit, there should be no path between BAT- & Pack-, which can let the current flow through them in case of Q1/Q2 gets off. Otherwise there will be error in batteries or it may get damaged.



6. If this circuit cannot work, then I have to use CAN isolator like ISO1050.
Only problem is creating a low power isolated supply of +5V for ISO1050, I will look into it, if above circuit cannot work.
Any low power isolated power supply IC?
 

Attachments

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
598
Hi ErnieM ,
I know that Can != I2C,
there is conversion process between I2C to CAN & then CAN to I2C.
You can check NXP AN10364 , Page 4 , Fig2 for more info on this.

If u think this circuit will not work, tell me where it will not work, what point it will create problem
 

ErnieM

Joined Apr 24, 2011
8,415
According to that previously unmentioned app note "...these arrangements provide the same common-mode immunity as offered by those systems, normally around +/- 7 V."

So the point where this creates problems is anything above 7 volts.

Perhaps if you bring the battery return thru your connector (junction of R1 and V1) to the controller you can avoid common mode issues.
 

Thread Starter

Vindhyachal Takniki

Joined Nov 3, 2014
598
1. Cannot make return thorough junction of R1 & V1, defeats the wholde purpose of protecting the battery.
2. There are two cases:
a) Host is powered from Pack+ & pack-.
b) Host is powered from external supply.


3. In case of host is powered thorugh pack+ & pack-, in any case if Q1/Q2 or both gets off, there will be no voltage at host also, and no need for any communication also.

4. In case of host is powered by external supply. Lets suppose at some point of time, Q1/Q2 or both gets off,
a) U4/U5 is getting powered from 3.3V & its return is Bat-
b) U6/U7 is getting powered from 3.3V2 & its reuturn is pack-
c) 3.3V2 is created from external host supply
d) 3.3V is created from pack+ & bat-
e) Now communication IC (U4 with U6) & (U5 with U7) dont have common ground. Also max voltage across both IC's is 3.3V each. Now can they communicate with each other as they dont have common ground?

I think they can as system is communicating differentially & CAN IC 's used have max CMR of -7V to +7V. Whereas max voltage difference can to 3.3V in each IC.
But I am not sure about this.

5. Another thing is in both point 3 & 4, will there be any leakage path between Bat- & pack-?
 
Top