Re: [ha] Introduction & CAN

Lars Wictorsson (lars.at.lawicel.com)
Wed, 2 Dec 1998 23:43:03 +0100

Zeb et. Al,

First some introduction on what I do (even if I might have
said something earlier about it).

Well, I'm both a software and a hardware developer, not so
much in analog technicues, but mostly digital.

Through the years I have worked with 6502, 8080/8085, 8051
derivatives and 16 bit Microcontrollers from Siemens.

I program mostly in C (in embedded environment) and there I
use KEIL C (8051 & C16x), then on the PC mostly Visual Basic
and some C/C++ (DLLsm OCXs etc.).

I'm also very devoted to CAN (as I have said earlier).

Now to Zeb's questions:

>This is something for Lars: You said you used RS485 for can. But if 2
>can drivers (75176) send different things (0 and 1), high currents will
>flow between the 2 devices and they 'll turn into a protective thermal
>shutdown mode. How do you deal with that?

I use OPTO between the CAN chip and the MAX485 driver (no 75176) and
got this design actually from a CAN course (this was designed back in
93 when there was not so many CAN transcievers). Now adays I only
use the 82c250 and compative 8 pin SOIC drivers, but the MAX485 is
still working (havn't changed the design), but it "talkes" to 82c250.
I'll be happy to give you the design, but I do not know if I can attach
gif pictures to this discussion group. However, I wouldn't use this
design in a new one!

>Second, do you have a protocol
>spec. In other words, would it be possible to implement (a portion of)
>CAN in another µC. I ask this because you mentioned 505C and 515C with
>on board CAN. The IC's have a 68PLCC package wich I believe takes up too
>much boardspace is you want to hide things behind a wallplate (at least
>in my case).

Well the C515C is not a PLCC, it is a QFTP 80 pin and is approx. 20mm
in square (including the pins). It is very narrow pins, but I have soldered
many of them by hand before we take them to manufacuting. The C505C
is a QFTP 44 pin and is 12mm in square (inc. pins). Currently these
has possibilities to run with external memory or as an OTP (requires
an expensive adapter on a prommer, but I have that :-) ). There is
32k OPT on board. Siemens will next year release a FLASH version with
ISP possibilities and I can't wait until they are here.

>CAN in a 8pin pic would be ideal. Maybe I'm rushing things
>but I was just wondering.

Many has infact asked for that, but who knows Microchip (who
makes the PICs) has planned a CAN Microcontroller and the first
to come is one bigger chip, but who knows, there migh be smaller
in the future.

The smallest availible is either C505C or the Motorola 86HC05X4, which
is (if I'm not misstaken) a 24/28 pin SOIC, also OTP or FLASH, don't
remember. It is possible to implement CAN in software, but you will
steel all the power of an 8 bit MC and maybe just reach 30-50kbit!
There is the Bosch Spec on CAN, but when using it you have to pay
a licence, this licence is included in the price of the CAN chips
that is on the market today. So CAN must be implemented the hardware way
and there are those who have done it in ASICs (but expensive!).

>And then the typical Swedish problem with the 3 phases ;o) Don't worry,
>same here. We should be able to solve this by 'bridging' them (e.g. put
<a repeater between the 3 lines). How does professional equipment cope
>with that?

Great, I'm not alone :-) However I do not know how that should work though.

>And how does CAN handle speed if you have a slow and a fast device on
>your line? Is there some negotiation algorithm?

Well, in CAN you do not have slow/high, you must have the same speed
in the same network, so when designing it, you need to know how many
possible messages that are going to be sent, so you can deside the
network speed, so that you do not exceed 100% busload. Some of these
small 8051 derivatives has 15 "mail slots", which each one of them
could be masked to carry one ID, then you solve the rest in hardware
to have a fifo queue buffer for sending and recieving if you need
many senders/reciever IDs, but that is normally not the case, the
mail slots are more than enough in many cases and to speak with
1Mbit with an 8051 isn't a big deal!

I have a whole bunch of C505C waiting now for many projects, like
small I/O nodes, an RS-232 to CAN module etc. Will be very inexpensive!

I hope I sorted out some of the ??? , if not send again ;-)

/Lars

P.S. By the way I live in south Sweden and I'm 32 years old.
(sofar the only representing Sweden I guess).

----------------------------------------------------------
LAWICEL Phone : +46 (0)451-50750
Lars Wictorsson Fax : +46 (0)451-50750
E-mail: lars.at.lawicel.com WWW : http://www.lawicel.com

Embedded hardware/software together with 8051/C16x and
smart distributed I/O with Controller Area Network (CAN).
----------------------------------------------------------