• In progress
  • SJA1000 Can Bus Support

    Overview

    Seco delivers boards that are equipped with a Philips (NXP) SJA1000 CAN controller. This CAN controller follows the CAN 2.0B standard. It can serve BasicCAN and extended Frames and handles bitrates up to 1MBit/s.

    SJA1000 peripheral chip: sja1000_3.pdf

    Background

    Seco delivers a Windows CE canbus driver, based on early adoption of Garz & Fricke's CAN Driver for SH-3.

    The driver has been heavily reworked. But there is still an old version of the documentation available in html form, which can be used to access the driver with through the gfcan32.dll.

    Download: sja1000_html.zip

    Demos using the can-libraries accessing the driver

    The newer singlecan.dll and dualcan.dll libraries can be used to access a single instance or multiple instances of canbus drivers. Most of the code will be compatible to the gfcan32.dll.

    Here is some democode to access a single instance:

    Download: singlecan.zip

    Using multiple can controllers please bind to dualcan.dll, the API has an additional argument selecting the canbus controller instance.

    Here is a democode using up to 4 can controllers:

    Download: dualcan.zip

    Special bit-timings

    Standard timings are calculated with the CanSetBaudrate(); API, but if special timings are requested, the user can add the special timing to the registry with X=Bitrate/kB Baud(X)=hex:(brp),(btr1)
    E.g. to specify a special timing for 50KBaud

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SJA1000] "Baud50"=hex:09,1c

    Functions

    CanReset

    CanGetBaudrate

    CanSetBaudrate

    CanGetStatus

    CanGetLastError

    CanCallback

    CanRegisterCallback

    CanStartReceiveQueue

    CanStopReceiveQueue

    CanSetRxTxTimeouts

    CanReadDescriptor

    CanReadMessage

    CanTransmitMessage

    CanWriteDescriptor

    CanWriteRegister

    CanReadRegister