drivers/ecos_lpc2138_sja1000/ReadMe.txt
author frdupin
Wed, 13 Dec 2006 14:14:18 +0100
changeset 53 73bc47a0db55
parent 0 4472ee7c6c3e
permissions -rw-r--r--
Add prototypes
0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     1
/*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     2
This file is part of CanFestival, a library implementing CanOpen Stack.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     3
  ____    _    _   _
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     4
 / ___|  / \  | \ | | ___  _ __   ___ _ __
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     5
| |     / _ \ |  \| |/ _ \| '_ \ / _ \ '_ \
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     6
| |___ / ___ \| |\  | (_) | |_) |  __/ | | |
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     7
 \____/_/   \_\_| \_|\___/| .__/ \___|_| |_|
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     8
                          |_|
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
     9
          ____                      _
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    10
         / ___|__ _ _ __   __ _  __| | __ _
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    11
        | |   / _` | '_ \ / _` |/ _` |/ _` |
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    12
        | |__| (_| | | | | (_| | (_| | (_| |
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    13
         \____\__,_|_| |_|\__,_|\__,_|\__,_|
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    14
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    15
                   canfestival@canopencanada.ca
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    16
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    17
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    18
See COPYING file for copyrights details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    19
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    20
This library is free software; you can redistribute it and/or
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    21
modify it under the terms of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    22
License as published by the Free Software Foundation; either
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    23
version 2.1 of the License, or (at your option) any later version.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    24
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    25
This library is distributed in the hope that it will be useful,
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    26
but WITHOUT ANY WARRANTY; without even the implied warranty of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    27
MARKETING or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    28
Lesser General Public License for more details.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    29
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    30
You should have received a copy of the GNU Lesser General Public
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    31
License along with this library; if not, write to the Free Software
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    32
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    33
*/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    34
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    35
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    36
CanFestival driver for the Philips ARM7 model LPC2138 , with a Philips
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    37
SJA1000 CAN controler, and running on the eCOS operating system.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    38
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    39
Driver Features:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    40
Full CANfestival-3 support including:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    41
DS-150/205: CAN Power Management Layer specification (sleep/wake-up)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    42
DS-201: CAN low level layer
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    43
DS-301: CANopen Application layer and Communication Profile (basic CANopen specification)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    44
DS-303-1: LED diagnostic usage (led.c)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    45
DS-305: Layer Setting Service (lss.c) to set the baudrateand node ID in a PnP fashion.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    46
NVRAM: Non Volatil Ram (nvram.c) Full support for internal Philips IAT programming FLASH mode
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    47
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    48
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    49
To use this driver, you need to proceed to do all these steps.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    50
NB: We choose to leave this driver in .o object code to keep the capability
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    51
to make on-the-fly redefinition of some parameters for all examples.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    52
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    53
Step 1
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    54
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    55
Have a developpement workstation. To build everything, we chose to use
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    56
an old AMD K6/2-300Mhz running with FreeBSD-5.2-RELEASE freely available
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    57
at http://www.freebsd.org/.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    58
To install freebsd, download the two floppy images from
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    59
ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/5.2-RELEASE/floppies
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    60
and copy them to a simple floppy disk by typeing:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    61
	dd if=./image.dd of=/dev/fd0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    62
	dd if=./image2.dd of=/dev/fd0
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    63
and proceed to boot on them.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    64
You can use Linux or Windows also or any other O/S where you can use GCC.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    65
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    66
on FreeBSD, you need to configure the serial port by editing the /etc/rc/serial
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    67
config file by adding this entry:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    68
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    69
lpc2000 () {
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    70
        # Philips LPC2000 serial port configuration for 57600 bauds connection.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    71
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    72
        ci=$1; shift
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    73
        co=$1; shift
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    74
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    75
        for i in $*
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    76
        do
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    77
                # Lock clocal on, hupcl off.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    78
                # XON-XOFF printer
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    79
                stty < /dev/ttyi${ci}${i} clocal -hupcl ixon -imaxbel -ixany -ixoff -crtscts 57600
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    80
                stty < /dev/ttyl${ci}${i} clocal  hupcl
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    81
                stty < /dev/cuai${co}${i} clocal -hupcl ixon -imaxbel -ixany -ixoff -crtscts 57600
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    82
                stty < /dev/cual${co}${i} clocal  hupcl
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    83
        done
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    84
}
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    85
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    86
###############
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    87
lpc2000		d a 0 1  # to configure COM1 and COM2, mean, /dev/cuaa0 and /dev/cuaa1
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    88
###############
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    89
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    90
Step 2
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    91
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    92
Find an upload tool to be able to flash the LPC2138.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    93
We found the lpc2isp at the address: 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    94
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    95
	http://guest.engelschall.com/~martin/lpc21xx/isp/index.html
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    96
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    97
 You can use this upload script to call it with proper arguments.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    98
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
    99
#!/bin/sh
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   100
lpc21isp -term -control build/terminal.hex /dev/cuaa1 57600 14746
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   101
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   102
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   103
Step 3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   104
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   105
Proceed to build a GCC cross compiler to be able to produce ARM7TDMI compatible
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   106
binary. Go to the port directory of your FreeBSD
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   107
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   108
	cd /usr/ports/devel/arm-elf-binutils
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   109
	gmake install
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   110
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   111
	cd /usr/ports/devel/arm-elf-gcc295
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   112
	gmake install
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   113
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   114
And add the installation binary PATH to your environment variables. 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   115
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   116
	cd /etc
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   117
	vi profile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   118
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   119
		export PATH=$PATH:/usr/local/armelf/bin
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   120
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   121
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   122
Step 4
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   123
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   124
Build an eCOS tree for the LPC2138.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   125
Download eCOS from  http://www.ecoscentric.com  and proceed to compile
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   126
the configtool program.  
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   127
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   128
	cd /usr/ports/devel/ecos-tools/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   129
	gmake install
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   130
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   131
	untar our special package for eCOS named  eCOS-OLIMEX-p2138.tgz in 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   132
	the eCOS three on your files system.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   133
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   134
Start now your configtool for eCOS:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   135
	configtool 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   136
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   137
Choose the right target 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   138
For our purpose, we choose to use an OLIMEX P2138 target board.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   139
This target is not in the list, we created it from a derivative of
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   140
the OLIMEX P2106. We simply selected an other processor in the pulldown menu
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   141
of the configtool. The LPC2138. Adjust some memory capacity, and that's it.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   142
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   143
When all you need is properly selected in the configtool, you click on
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   144
Save_As and you suggest a name like My2138. 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   145
After, you click on Generate Build Tree.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   146
	cd My2138_build
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   147
	gmake depend
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   148
	gmake
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   149
	gmake install
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   150
 And now you have you own eCOS tree for your project in  My2138_install
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   151
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   152
Step 5
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   153
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   154
Prepare the hardware board for this project. We chose to use an
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   155
http://www.olimex.com/  board, the P2138.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   156
Any other LPC2138 evaluation could made the job.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   157
On the P2138 board, we have a little area that we can use to solder
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   158
the SJA1000 controler.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   159
See can_controler.gif to know how to solder all wires.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   160
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   161
Warning: If you want to use different GPIO (General Purpose Input Output)
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   162
pin to fit with your own project, 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   163
you can choose a different one, but you need
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   164
to be sure to properly define then in the lpc2138_pinout.h
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   165
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   166
Step 6
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   167
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   168
Put the CANfestival-3.tar.gz stuff in My2138_install/src/CANfestival-3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   169
	cd My2138_install/src/CANfestival-3
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   170
	./configure target=ecos-lpc2138-sja1000
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   171
	gmake
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   172
	cd My2138_install/lib
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   173
	ln -s My2138_install/src/CANfestival-3/src/libcanfestival.a
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   174
	cd My2138_install/src 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   175
	ln -s My2138_install/src/CANfestival-3/driver/ecos-lpc2138-sja1000
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   176
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   177
Step 7
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   178
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   179
Now you are ready to build our demo.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   180
  cd My2138_install/src/CANfestival-3/examples/DS-406Master_ecos
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   181
	gmake
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   182
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   183
  cd My2138_install/src/CANfestival-3/examples/TerminalSlave_ecos
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   184
	gmake
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   185
Step 8
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   186
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   187
To test, upload both .hex file to both targets with lpc21isp and
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   188
see the DS-406 absolut rotary encoder transmiting his absolute value to the
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   189
terminal.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   190
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   191
	For more info about this project, see http://www.oremeq.qc.ca/
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   192
Step 9
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   193
-----------
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   194
For your own project, you can copy all the examples files in your own
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   195
directory and modify them.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   196
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   197
What is important to understand is:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   198
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   199
driver/ecos_lpc2138_sja1000:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   200
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   201
	build_baudrate.c is a commande line tool to generate the proper
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   202
		timing file for your sja1000 regarding your sja1000 clk.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   203
			see the Makefile for adjustment.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   204
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   205
	canOpenDriver.c is the only link between the libcanfestival and
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   206
		the hardware.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   207
			f_can_send
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   208
			f_can_receive
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   209
			interrupts
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   210
			nvram_save/load
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   211
			baudrate
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   212
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   213
	eCOS-OLIMEX-p2138.tgz  eCOS package for the OLIMEX p2138 evaluation board
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   214
		you have to untar that files in your eCOS three.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   215
		
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   216
	sja1000.c containe only function for initialization or 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   217
		configuration of the CAN controler. All this stuff is
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   218
		_not_ use by the libcanfestival. You have to call them
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   219
		from your main() to enable CAN with your needed configuration.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   220
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   221
		hardware init 
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   222
			
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   223
	lpc2138.c All the basic stuff to run the LPC2138
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   224
		iat_flash  user programmable internal flash of the lpc2138
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   225
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   226
	lpc2138_pinout.h  Is your LPC2138 pinout definition. Modify this file
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   227
		if you want to redefine your pinout affectation.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   228
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   229
	time_slicer.c  eCOS implementation of the CANfestival scheduler.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   230
		settimer
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   231
		alarm
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   232
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   233
	applicfg.h is your configuration file for the libcanfestival
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   234
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   235
	lpc2138_pinout.h define all your GPIO to fit macros.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   236
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   237
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   238
objdictedit:
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   239
	Objdictedit  will produce the dictionary.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   240
	Generate your dictionnary. (Or use an already made YourFile.od with
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   241
	the tool: objdictgen.py
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   242
	The job is to implement all functions define in the YourFIle.c in
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   243
		your own project files.
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   244
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   245
Enjoye!!!!	
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   246
		Canopen Canada core team
4472ee7c6c3e Commit a new cvs repo.
etisserant
parents:
diff changeset
   247
		canfestival@canopencanada.ca