68hc08 and CAN bus

With Motorola 68HC08 and CAN bus, is there a way to find out what the maximum length of the bus can be at say 38K baud or 9600 baud without actually creating a system?

Is the max length affected by the number of devices on the bus?

If a longer length was needed, is there any way to build some kind of repeater device that effectively doubled the length?

Can a token ring be implemented using the CAN protocol or is the CAN system by itself sufficient for implementing a network where there are say 30 devices each with one 20 byte message to send every one second that need to be received by the other 29 devices.

Thanks

Reply to
darkknight
Loading thread data ...

The maximum length of the bus translates into the maximum available delay, which is one bit interval to and from the farthest transmitter. Note this is a theoretical maximum -- real maxima will be shorter.

For speed-of-light transmission, no extraneous delays, and zero loss from long wires the maximum length a 38K baud system could ever be would be (300e6 meter/second)/(2 * 38,000Hz) = 3900m. I suspect that you'd see problems from resistive drop in the wires before you saw propagation problems at those distances. You'd have to calculate this from the known termination impedance and the resistance/foot of your proposed wire.

Note, too, that signals will propagate slower on wire (because of the velocity factor of the dielectric) than in free space. 66% of light speed is a safe factor, so your above 4km distance would drop to 2600m.

Yes, no, maybe. First-order theory says no. Second-order theory says that each device will load the bus with some capacitance which will slow things down. Higher-order theories will disagree about whether the device loading on the bus will cause problems, so it's a good idea to do some calculation beforehand.

Yes, no, maybe. No, you can't just repeat the signal and maintain the CAN bus arbitration scheme. Yes, you could build a bridge that would receive messages completely from one bus then post them onto the other. Some knowledge of your networks higher-level protocol, along with some filtering would probably be a good idea. If you have two CAN-based clusters separated by one long run of wire a full-duplex, non-CAN link with bridges at each end might be a good idea.

The token ring is not necessary -- CAN performs its own collision arbitration.

You need to know more -- "Controller Area Network" by Konrad Etschberger is the book that I have, but there are certainly other ones out there.

--
Tim Wescott
Wescott Design Services
 Click to see the full signature
Reply to
Tim Wescott

The standard specifies 5000 m at 10 kbit/s, 2500 m at 20 kbit/s, more than 1000 m at 50 kbit/s and so on.

The maximum branch length from the main line to the device is specified for different speeds. You may have to use thicker wires if a large number of nodes is required.

At speeds below 62.5 kbit/s repeaters should used every 1000 m, but the repeater delay reduces the maximum end-to-end distance, thus, less than 5000 m would be obtainable at 10 kbit/s.

The CAN arbitration handles the producer/consumer distribution automatically, thus no token passing etc. required.

A CAN message can only carry an 8 byte (64 bit payload), thus the 20 byte message would have to be split into three CAN frames. Some bits should be reserved to tell which of the 3 frames are transmitted. With

30 devices sending 3 frames once every second (90 frames/s) and with an average frame size of 100-150 bits, more than 10000 bits should be transferred every second. Thus 20 kbit/s would be the lowest speed and the network size should be less than 2500 m.

Paul

Reply to
Paul Keinanen

To second order of approximation, i.e. a engineering-grade prediction: yes. There's even one that doesn't rely on knowing what the CPU is

--- because that doesn't matter. It's simple, too: just get yourself some documentation on CAN and read it.

OTOH, the choice of transceiver would matter, because different types of transceiver have different delays. But then again at such low speeds, this effect should be mostly negligible.

Not directly.

Depends on which limit you're running into: signal strength or timing. Repeaters can help with signal strengs, at the cost of timing. Once you've hit the timing limit, you need the CAN equivalent of a bridge or switch, i.e. a device with two or more CAN controllers that passes messages through from one bus to the other.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Thanks for the replies.

I have one more question. Suppose the network is saturated with all devices always needing to transmit. Does CAN provide any way of ensuring a device gets to transmit within a known deterministic time or is it completely random under saturation.

Reply to
darkknight

The CAN protocol will not ensure each device gets to transmit under bus saturation. The bus is arbitrated according to message ID, so message transmission won't be completely random assuming all messages don't have the same ID.

~Dave~

Reply to
Dave

No, basic CAN does not have time slices. Transmission is however not random, but priority based. If two nodes try to send a message at the same time, the message with the highest priority gets through, and the node trying to send the lower-priority message backs off.

For info on time-triggered extensions for CAN, try googling for TTCAN.

Reply to
Hans Odeberg

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.