nacbus: Controller Area Network (CAN) driver example application.

You must license the NET+OS Controller Area Network (CAN) 
driver from Digi before you can use it. Please register at 
http://www.digiembedded.com/requestcan to receive the 
required CAN bus support files.

Running this sample application requires external hardware to interconnect to 
your Digi JumpStart Kit Development board.  This readme provides instructions 
based on the Digi FIM Application Kit (Digi P/N DG-ACC-FIM).

Please note it is not mandatory to use the FIM Application kit to successfully 
run this application; prototype hardware can be built up in its place.  
However, the FIM Application Kit provides a standard reference design platform 
with all the hardware components and accessory items necessary for immediate 
prototyping of NET+OS applications with FIM-based I/O capabilities.

The FIM Application Kit (Digi P/N DG-ACC-FIM) supports the ConnectCore 9P  9215, 
Digi Connect ME 9210, and NS9210/9215 chip development platforms.  
Complete documentation and schematics for the FIM Application Kit are available 
in the "Application Kit" section on the Digi technical support website at 
www.digi.com/support.

Please also visit the www.digiembedded.com for additional information and purchase options.


Connecting and configuring your FIM Application Kit board
-----------------------------------------------------------------------
The application requires FIM1 to be configured as CAN_1 
and connected to the CAN_1 section of the FIM Application board. 

Please refer to the FIM Application Kit Quick Start Guide and the Hardware Reference
Manual (HRM) for guidance on how connect and configure your FIM Application Kit board.


You could also build your own CAN interface.  The file 
canInterface.bmp shows how to create one using an SN65HVD233
CAN driver.  Pins 6 and 7 on this chip attach to the CAN bus.
Pins 1 and 4 need to connect to processor GPIO pins. 


ConnectCore 9P 9215
===================

A. FIM0 Configuration
   ------------------

1. In gpio.h, make sure GPIO pins are setup correctly as follows:
   #define BSP_GPIO_MUX_IOP_0_CAN_RXD    BSP_GPIO_MUX_USE_ALTERNATE_PATH
   #define BSP_GPIO_MUX_IOP_0_CAN_TXD    BSP_GPIO_MUX_USE_ALTERNATE_PATH


2. You must also make sure the configuration file canTable.c in 
   the platform directory selects FIM0.  Edit the file and make
   sure it contains the following statements.

   NaCanTable_t naCanTable[] = 
   {
       {
           NA_IOP_PROCESSOR_PIC0,
           (NaIopProgram_t *) &naCanIopDriver
       }
   };

B. FIM1 Configuration
   ------------------

1. In gpio.h, make sure GPIO pins are setup correctly as follows:
   #define BSP_GPIO_MUX_IOP_1_CAN_RXD    BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH
   #define BSP_GPIO_MUX_IOP_1_CAN_TXD    BSP_GPIO_MUX_USE_2ND_ALTERNATE_PATH

2. You must also make sure the configuration file canTable.c in 
   the platform directory selects FIM1.  Edit the file and make
   sure it contains the following statements.

   NaCanTable_t naCanTable[] = 
   {
       {
           NA_IOP_PROCESSOR_PIC1,
           (NaIopProgram_t *) &naCanIopDriver
       }
   };


Digi Connect ME 9210
====================

A. FIM1 Configuration
   ------------------

1. In gpio.h, make sure GPIO pins are setup correctly as follows:
   #define BSP_GPIO_MUX_IOP_1_CAN_RXD    BSP_GPIO_MUX_USE_PRIMARY_PATH
   #define BSP_GPIO_MUX_IOP_1_CAN_TXD    BSP_GPIO_MUX_USE_PRIMARY_PATH

2. You must also make sure the configuration file canTable.c in 
   the platform directory selects FIM1.  Edit the file and make
   sure it contains the following statements.

   NaCanTable_t naCanTable[] = 
   {
       {
           NA_IOP_PROCESSOR_PIC1,
           (NaIopProgram_t *) &naCanIopDriver
       }
   };


Rebuild the BSP after you have edited gpio.h and canTable.c.

This example demonstrates how to use the NET+OS CAN driver.  The
application opens and configures the CAN driver.  It periodically
sends a request frame and a data frame, and it responds to 
selected request frames received from the CAN bus.

The example code is contained in root.c.  There are a set of 
constant #defines near the top of root.c.  These control the bit
rate of the CAN bus, and the CAN IDs used by the example.  It is
very important to set the correct bit rate for the bus.  Edit
root.c and make sure CAN_BUS_BIT_RATE is set to the correct value.

Note that there must be at least two devices on a CAN network.  
This is because all frames must be acknowledged by at least one
receiver.  The example will not work unless there is at least
one other CAN node on the network.


appconf.h           sets application configuration settings
canInterface.bmp    schematic of CAN interface
.\32b\image.gpj     used to build the big endian Green Hills version of the
                    application.  The build script creates a version that
                    can be debugged with Multi, and the file image.bin 
                    which can be written into a ROM that uses the bootloader.
makefile            Make file for the GNU toolset.
project.gpj         
readme              this file
root.c              contains the applicationStart() function, that
                    creates an application thread
naftpapp.c          contains the RAM based FTP application code
project.gpj         contains the generic project build script

In addition, the following files in the BSP directory are built
as part of this application:

reset.s         contains the reset code
appconf_api.c   contains run time access to the application configuration


