EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

implementing CAN bus interface on Rab2000 platform

Started by lexicon022 August 26, 2004
hi,

I have to implement CAN bus interface on rabbit 2000 platform. I
would really appreciate if somebody send me a sample driver and few
words how to connect the CAN controller (SJA1000).

thanks all

sree.


Hi,

The problem with the SJA1000 is that was designed for a multiplexed bus
which the Rabbit does not use.

What I did was to use an address decoder (or 2 chip select lines, one of
which gets inverted) and wire one to the CS line and the one with the
inverter to the ALE line. The data bus then connects to D0-D7 as normal.
What you then do to access the device is write to the address which
connects to ALE with the register you wish to access and then write or
read the register with the address which enables CS. If you are always
accessing the same address then you only need to do the read or write
sequence.

Of course, there may be other options which require external devices,
such as extra LOGIC, FPGA, PAL etc, but the above was the easiest way
that I could get the device to work with the Rabbit with no addition
hardware except for the inverter which I already had in my design.

I also used this design idea when I created a parallel port CAN bus
interface for my PC.

As for a software driver, the device is simple to use and I would
suggest you have a go yourself and that way you will learn a bit more
about how CAN works. I learned a lot about CAN by having to write my own
drivers.

One other option you have is to look at the Microchip MCP2515 which has
an SPI interface. The latest version has a 10Mhz SPI interface. I have
used this device successfully with the Atmel AVR devices and have just
designed a Rabbit system with it too. This is still on the drawing board
and due to be prototyped in the next month. Drivers for this will be
ported from the AVR ones I already have.

Have fun as CAN is very powerful and a simple system to interface with
once you understand it all.

Regards
Dave...

---
Very funny Scotty, now beam down my clothes...!!
---
http://www.v8carlton.com
http://www.embeddedcomputer.co.uk
---
lexicon022 wrote:

>hi,
>
>I have to implement CAN bus interface on rabbit 2000 platform. I
>would really appreciate if somebody send me a sample driver and few
>words how to connect the CAN controller (SJA1000).
>
>thanks all
>
>sree. >





The 2024 Embedded Online Conference