Problems with Opto in a CANBus

Thread Starter

santini

Joined Nov 14, 2008
4
Hi all,

I'm doing some CANBus to work at 1Mbit rate. I made like the schematic on PCA82C250 (schematic in anex). When I'm using the optos, many of my messages are lost becouse bus error. When I remove the optos, the CANBus works without error. Can someone give me a hand?

Details:
1) My CAN Controller is a dsPIC30F4012.
2) VDD and Vss are another +5V and another 0V
3) My optos are 6n137 (10 Mbaud).
4) The 100nF capacitor are ceramic and they are very close to the optos.
5) Rext from PCA82C250 is zero (operates at high frequency)

Thanks

Santini
 

Attachments

Papabravo

Joined Feb 24, 2006
21,225
Your problem is time delay through the optos. If you analyze the bit timing at 1 Mbit you will see that in the worst case you are only allowed negative cable distance. Repeat your experiment at a much lower baudrate to see if you get different results.

The HCPL 0710 or the HCPL 7710 both have a 40 nsec delay specification and they are used on DeviceNet at 500 kbits with 100 meters of cable. That cable is special because it has the foam dielectric and propagation speed of 0.77c. I'm sure you will be impressed by the price differential between the 6N137 and the HCPL 7710.

We avoided 1Mbit on DeviceNet for EXACTLY this reason.

What you care about in an opto for CAN is not the frequency at which it will operate, but the time dealy through the part. This delay applies to both transmitter and receiver, and to both nodes taking part in the exchange.

You will NOT be able to do 1Mbit with optos unless there is a new breed of optos with a propagation delay << 40 nsec.

So sorry 'bout that, I hope you don't have to back off of a contractual committment on that score.
 

Thread Starter

santini

Joined Nov 14, 2008
4
Thanks Papabravo,

Its my first time working on CANbus, I made a few analyzes:

My CAN Controller is working with a 12MHz clock, that resultes in 12 time quantum.

My propagation time is:
1) 150ns from PCA82C250,
2) 100ns from 6N137 (if only one side has this opto)
3) 100ns from cable (using a 200Mm/s and a 20m cable)

This will result in a PROP_SEG with a 2*(150+100+100) = 9 time quantum and the Bus will fail.

If I remove the optos. I can program PROP_SEG with a 2*(150+100) = 6 time quantum, plus SYNC_SEG 1 time quantum and PHASE1_SEG= 2 PHASE2_SEG=3. With this, the CANbus will works.

Am I right?

Santini
 

Papabravo

Joined Feb 24, 2006
21,225
That looks correct to me after a quick glance. I would also recommend that if you want to run at 1 Mbit/s that you raise the crystal frequency to to 16 MHz. This will allow you to place the sample point as close to the end of the bit cell as possible. I'm not sure you can go higher than 16 Mhz. We used the AT89C51CC01 with an 18 MHz. clock.

BTW the 82C250 is quite obsolete. You should be using the SJA1000 also from Philips.
 
Top