--- a/doc/manual/en/manual.tex Tue Feb 12 15:38:54 2008 +0100
+++ b/doc/manual/en/manual.tex Wed Feb 13 15:58:51 2008 +0100
@@ -1,10 +1,6 @@
-%% LyX 1.5.1 created this file. For more info, see http://www.lyx.org/.
-%% Do not edit unless you really know what you are doing.
\documentclass[12pt,english,a4paper]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
-\setcounter{secnumdepth}{5}
-\setcounter{tocdepth}{3}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{textcomp}
@@ -22,6 +18,13 @@
\author{Edouard TISSERANT}
\date{\today}
+\setcounter{secnumdepth}{5}
+\renewcommand\thesection{\arabic{section} -}
+\renewcommand\thesubsection{\arabic{section}.\arabic{subsection})}
+\renewcommand\thesubsubsection{\arabic{section}.\arabic{subsection}.\arabic{subsubsection})}
+\renewcommand\theparagraph{\alph{paragraph})}
+\renewcommand\thesubparagraph{\roman{subparagraph})}
+
\newcommand{\canopen}{CANopen }
\begin{document}
@@ -79,7 +82,7 @@
\begin{enumerate}
\item Object Dictionary editor GUI. WxPython Model-View-Controler based
-GUI, that help a lot in generating object dictionary source code for
+GUI, that helps a lot in generating object dictionary source code for
each node.
\item A configure script, that let you chose compile time options such as
target CPU/HOST, CAN and TIMER drivers.\\
@@ -87,10 +90,7 @@
keeping micro-controller target in mind.
\end{enumerate}
-\subsection{Standard conformance}
-
-
-\subsubsection{Multi-Platform}
+\subsection{Multi-Platform}
\begin{enumerate}
\item Library source code is C-ANSI.
@@ -100,55 +100,39 @@
any Unix system (tested on GNU/Linux and GNU/FreeBSD).
\end{enumerate}
-\subsubsection{\canopen conformance}
-
-
-\paragraph{DS-301}
+\subsection{\canopen standard conformance}
+
+\subsubsection{DS-301}
+
+Supported features should conform to DS301. V.4.02 13 february 2002.
\begin{enumerate}
-\item Should conform to DS301. V.4.02 13 february 2002.
-\item Master and Slave functionality implemented.
-\item Sending SYNC implemented.
-\item 1 SDO server per node. (update: more than one possible. To be more
-tested)
-\item Unlimited SDO client.
-\item SDO transmission mode : normal, expedited download and upload.
-\item Unlimited PDO receive.
-\item Unlimited PDO transmit.
-\item Object Data type implemented : 8, 16, 32 bits values, and fixed length
-strings.
-\item Slave state full implemented.
-\item NMT to change slaves state implemented.
-\item PDO transmission mode : on request, every reception of 0 to n SYNC,
-on event.
-\item NMT Heartbeat implemented : A node can be either heartbeat producer
-or receiver.
-\item NMT NodeGuard implemented : Not fully implemented.
-\item TIME (time Stamp) : Not implemented.
-\item EMCY (emergency objects) : Sending and reception of EMCY objectos
-(without manufacturer specific error field).
-\item PDO Mapping bit per bit implemented.
+\item NMT master and slave
+\item Heartbeat consumer and producer
+\item NodeGuard slave reponder and basic master without tracking
+\item SYNC service
+\item SDO multiples client and server, segmented and expedited
+\item PDO : TPDO and RPDO, with respect to transmission type
+\item PDO mapping from/to OD variables bit per bit.
+\item EMCY : Send and receive and keeps track of emergency objects
+\item Data types : 8 to 64 bits values, fixed length strings.
\end{enumerate}
-\paragraph{DS-302}
-
-\begin{enumerate}
-\item Concise DFC : implemented.
-\end{enumerate}
+\subsubsection{DS-302}
+
+Only concise DFC is supported.
\section{How to start}
-
\subsection{Host requirements}
What you need on your development workstation.
-
\subsubsection{Object Dictionary Editor GUI}
\begin{enumerate}
\item Python, with
-\item wxPyhon modules installed (at least version 2.6.3).
+\item wxPython modules installed (at least version 2.6.3).
\item Gnosis xml tools. (Optional can also be installed locally to the project
automatically with the help of a Makefile. Please see {}``Using Dictionary
Editor GUI'' )
@@ -179,68 +163,53 @@
Please always use CVS, this is the best way to get the most reactive
support from the developer community :
-cvs -d:pserver:anonymous@lolitech.dyndns.org:/canfestival login\\
- (type return, without entering a password)
-
-Then, enter : \\
- cvs -z3 -d:pserver:anonymous@lolitech.dyndns.org:/canfestival co
--P CanFestival-3
+
+\begin{verbatim}
+ cvs -d:pserver:anonymous@lolitech.dyndns.org:/canfestival login
+\end{verbatim}
+
+(type return, without entering a password)
+
+Then, enter :
+
+\begin{verbatim}
+ cvs -z3 -d:pserver:anonymous@lolitech.dyndns.org:/canfestival co -P CanFestival-3
+\end{verbatim}
+
\section{Understanding Canfestival}
-
\subsection{CanFestival Project tree layout}
Simplified directory structure.
-\texttt{\textbf{./src ANSI-C source of \canopen stack}}
-
-\texttt{\textbf{./include Exportables Header files}}
-
-\texttt{\textbf{./drivers Interfaces to specific platforms/HW}}
-
-\texttt{./drivers/unix Linux and Cygwin OS interface}
-
-\texttt{./drivers/win32 Native Win32 OS interface}
-
-\texttt{./drivers/timers\_xeno Xenomai timers/threads (Linux only)}
-
-\texttt{./drivers/timers\_kernel Linux kernel timer/threads}
-
-\texttt{./drivers/timers\_unix Posix timers/threads (Linux, Cygwin)}
-
-\texttt{./drivers/can\_virtual\_kernel Fake CAN network (kernel space)}
-
-\texttt{./drivers/can\_peak\_linux PeakSystem CAN library interface}
-
-\texttt{./drivers/can\_peak\_win32 PeakSystem PCAN -Light interface}
-
-\texttt{./drivers/can\_uvccm\_win32 Acacetus{\textquotesingle}s
-RS232 {}``CAN -uVCCM'' interface}
-
-\texttt{./drivers/can\_virtual Fake CAN network (Linux, Cygwin)}
-
-\texttt{./drivers/hcs12 HCS12 full target interface}
-
-\texttt{\textbf{./examples Examples}}
-
-\texttt{./examples/TestMasterSlave 2 nodes, NMT SYNC SDO PDO, win32+unix}
-
-\texttt{./examples/TestMasterMicroMod 1 node, control Peak I/O Module,
-unix}
-
-\texttt{./examples/gene\_SYNC\_HCS12 Just send periodic SYNC on HCS12}
-
-\texttt{./examples/win32test Ask some DS301 infos to a node (}\texttt{\textbf{win32)}}
-
-\texttt{\textbf{./objdictgen Object Dictionary editor GUI}}
-
-\texttt{./objdictgen/config Pre -defined OD profiles}
-
-\texttt{./objdictgen/examples Some examples/test OD}
-
-\texttt{\textbf{./doc Project and \canopen doc}}
+\begin{verbatim}
+./src ANSI-C source of \canopen stack
+./include Exportables Header files
+./drivers Interfaces to specific platforms/HW
+./drivers/unix Linux and Cygwin OS interface
+./drivers/win32 Native Win32 OS interface
+./drivers/timers_xeno Xenomai timers/threads (Linux only)
+./drivers/timers_kernel Linux kernel timer/threads
+./drivers/timers_unix Posix timers/threads (Linux, Cygwin)
+./drivers/can_virtual_kernel Fake CAN network (kernel space)
+./drivers/can_peak_linux PeakSystem CAN library interface
+./drivers/can_peak_win32 PeakSystem PCAN-Light interface
+./drivers/can_uvccm_win32 Acacetus's RS232 CAN-uVCCM interface
+./drivers/can_virtual Fake CAN network (Linux, Cygwin)
+./drivers/hcs12 HCS12 full target interface
+./examples Examples
+./examples/TestMasterSlave 2 nodes, NMT SYNC SDO PDO, win32+unix
+./examples/TestMasterMicroMod 1 node, control Peak I/O Module, unix
+./examples/gene_SYNC_HCS12 Just send periodic SYNC on HCS12
+./examples/win32test Ask some DS301 infos to a node (win32)
+./objdictgen Object Dictionary editor GUI
+./objdictgen/config Pre-defined OD profiles
+./objdictgen/examples Some examples/test OD
+./doc Documentation source
+\end{verbatim}
+
\subsection{Implement CanFestival in your application}
@@ -256,14 +225,13 @@
\subsection{CanFestival CAN interfaces}
Because most CAN controllers and drivers implement FIFOs, CanFestival
-consider sending message as a non bloking operation.
+consider sending message as a non blocking operation.
In order to prevent reentrent calls to the stack, messages reception
is implemented differently on {\textmu}C and OS.:
\begin{enumerate}
-\item {\textmu}C must provide interuption masking for timer and can receive
-TI\\
+\item {\textmu}C must provide interruption masking, mutually excluding timer and CAN receive interrupts.\\
@@ -272,7 +240,7 @@
\par\end{center}
\item OS must provide a receive thread, a timer thread and a mutex. CAN
-reception is a bloking operation.\\
+reception should be a bloking operation.\\
@@ -282,14 +250,14 @@
\end{enumerate}
-\subsection{CanFestival events scheduling}
+\subsection{CanFestival event scheduling}
A \canopen node must be able to take delayed actions.
-As exemples, periodic sync emission, heartbeat production or SDO timeout
+For instance, periodic sync emission, heartbeat production or SDO timeout
need to set some alarms that will be called later and do the job.
-{\textmu}C generaly do not have enough free timers to handle all
+{\textmu}C generally do not have enough free timers to handle all
the \canopen needs directly. Moreover, CanFestival internal data
may be corrupt by reentrant calls.
@@ -330,18 +298,24 @@
After invoking ./configure with your platform specific switches, just
type make.
-\texttt{./configure {[}options]}
-
-\texttt{make}
-
-\texttt{make install}
+
+
+\begin{verbatim}
+ ./configure [options]
+ make
+ make install
+\end{verbatim}
+
+
\subsubsection{Standard Linux node}
-Configure switch:
-
-\texttt{- -timers=unix}
+
+\begin{verbatim}
+ ./configure --timers=unix
+\end{verbatim}
+
To do a \canopen node running on PC -Linux, you need :
@@ -353,9 +327,12 @@
\subsubsection{Real -Time Linux node}
-Configure switch:
-
-\texttt{- -timers=xeno}
+
+\begin{verbatim}
+ ./configure --timers=xeno
+\end{verbatim}
+
+
To do a \canopen node running on PC -Linux, you need :
@@ -370,22 +347,24 @@
To do a CANopen node running on PC-Linux in kernel space, you need:
-\paragraph{A working Linux distribution with pre-built 2.6.x.x kernel sources}
-
-
-\paragraph{A CAN card driver compatible with CanFestival}
+\begin{enumerate}
+\item A working Linux distribution with pre-built 2.6.x.x kernel sources
+\item A CAN card driver compatible with CanFestival
+\end{enumerate}
\subsubsection{CAN devices}
-Curently supported CAN devices and corresponding configure switch:
+Currently supported CAN devices and corresponding configure switch:
\paragraph{Peak systems}
-Configure switch:
-
-\texttt{- -can=peak\_linux}
+
+\begin{verbatim}
+ ./configure --can=peak_linux
+\end{verbatim}
+
PeakSystems CAN interface is automatically chosen as default CAN interface
if libpcan is present in the system.
@@ -397,25 +376,29 @@
\paragraph{Socket -Can (http://socketcan.berlios.de)}
-Configure switch:
-
-\texttt{- -can=socket}
+
+\begin{verbatim}
+ ./configure --can=socket
+\end{verbatim}
\paragraph{LinCan}
-Configure switch:
-
-\texttt{- -can=lincan}
+
+\begin{verbatim}
+ ./configure --can=lincan
+\end{verbatim}
\paragraph{Virtual CAN interfaces (for test/debug)}
-Configure switch:
-
-\texttt{- -can=virtual (in user space)}
-
-\texttt{- -can=virtual\_kernel (in kernel space)}
+
+\begin{verbatim}
+ ./configure --can=virtual
+ or, for kernel space:
+ ./configure --can=kernel_virtual
+\end{verbatim}
+
Virtual CAN interface use Unix pipes to emulate a virtual CAN network.
Each message issued from a node is repeat to all other nodes. Currently
@@ -425,10 +408,16 @@
\subsection{Testing your CanFestival installation}
+\subsection{User space}
+
Sample provided in /example/TestMasterSlave is installed into your
system during installation.
-\texttt{TestMasterSlave}
+
+\begin{verbatim}
+ TestMasterSlave
+\end{verbatim}
+
Default CAN driver library is libcanfestival\_can\_virtual.so., which
will simply pass CAN messages through Unix pipes between Master and
@@ -438,11 +427,23 @@
CAN ports. Another example using Peak{\textquotesingle}s dual PCMCIA
(configure and install with --can=peak) :
-\texttt{TestMasterSlave -l libcanfestival\_can\_peak.so -s 40 -m 41}
-
-\texttt{example/kerneltest} It's based on TestMasterSlave example
+
+\begin{verbatim}
+ TestMasterSlave -l libcanfestival_can_peak.so -s 40 -m 41
+\end{verbatim}
+
+
+\subsection{Kernel space}
+
+
+\begin{verbatim}
+ example/kerneltest
+\end{verbatim}
+
+
+It's based on TestMasterSlave example
and has the same functionality. Uses virtual can driver as default
-too. After successfull installation you can insert the module by typing:
+too. After successful installation you can insert the module by typing:
modprobe canf\_ktest Module control is done by simple console 'canf\_ktest\_console'
which is used to start/stop sending data.
@@ -452,16 +453,13 @@
CanFestival can be compiled and run on Windows platform. It is possible
to use both Cygwin and win32 native runtime environment.
-
\subsection{Object Dictionary Editor GUI installation.}
Please refer to \hyperlink{a821UsingDictionaryEditorGUIoutline}{8.2.1)Using
Dictionary Editor GUI}
-
\subsection{CYGWIN}
-
\subsubsection{Requirements}
Cygwin have to be installed with those packages :
@@ -489,94 +487,109 @@
\paragraph{A single node with PcanLight and Peak CAN -USB adapter}
-Download the PCAN -Light Zip file for your HW ( URL from download
+Download the PCAN-Light Zip file for your HW ( URL from download
page ):
-\texttt{wget http://www.peak -system.com/files/usb.zip}
+
+\begin{verbatim}
+ wget http://www.peak -system.com/files/usb.zip
+\end{verbatim}
+
Extract its content into your cygwin home (it will create a {}``Disk''
directory):
-\texttt{unzip usb.zip}
+
+\begin{verbatim}
+ unzip usb.zip
+\end{verbatim}
+
Configure CanFestival3 providing path to the desired PcanLight implementation:
-\texttt{cd CanFestival -3}
-
-\texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN -Light/Api/}
-
-\texttt{export PCAN\_HEADER=Pcan\_usb.h}
-
-\texttt{export PCAN\_LIB=\~{ }/Disk/PCAN -Light/Lib/Visual\textbackslash{}
-C++/Pcan\_usb.lib}
-
-\texttt{./configure -{}-can=peak\_win32}
-
-\texttt{make}
+
+\begin{verbatim}
+ cd CanFestival -3
+ export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/
+ export PCAN_HEADER=Pcan_usb.h
+ export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_usb.lib
+ ./configure --can=peak_win32
+ make
+\end{verbatim}
+
In order to test, you have to use another CanFestival node, connect
with a CAN cable.
-\texttt{cp \~{ }/Disk/PCAN -Light/Pcan\_usb.dll .}
-
-\texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}}
-
-\texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll \textbackslash{}}
-
-\texttt{-S 500K -M none}
+
+\begin{verbatim}
+ cp ~/Disk/PCAN-Light/Pcan_usb.dll .
+ ./examples/TestMasterSlave/TestMasterSlave \
+ -l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll \
+ -S 500K -M none
+\end{verbatim}
+
Then, on the other node :
-\texttt{./TestMasterSlave -l my\_driver.so -S none -M 500K}
-
-Now messages are beeing exchanged between master and slave node.
-
+
+\begin{verbatim}
+ ./TestMasterSlave -l my_driver.so -S none -M 500K
+\end{verbatim}
+
+
+Now messages are being exchanged between master and slave node.
\paragraph{Two nodes with PcanLight and Peak dual PCMCIA -CAN adapter}
-Download the PCAN -Light Zip file for your HW ( URL from download
+Download the PCAN-Light Zip file for your HW ( URL from download
page ):
-\texttt{wget http://www.peak -system.com/files/pccard.zip}
+
+\begin{verbatim}
+ wget http://www.peak-system.com/files/pccard.zip
+\end{verbatim}
+
Extract its content into your cygwin home (it will create a {}``Disk''
directory):
-\texttt{unzip pccard.zip}
+
+\begin{verbatim}
+ unzip pccard.zip
+\end{verbatim}
+
The configure CanFestival3 providing path to the desired PcanLight
implementation:
-\texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN -Light/Api/}
-
-\texttt{export PCAN\_HEADER=Pcan\_pcc.h}
-
-\texttt{export PCAN\_LIB=\~{ }/Disk/PCAN -Light/Lib/Visual\textbackslash{}
-C++/Pcan\_pcc.lib}
-
-\texttt{export PCAN2\_HEADER=Pcan\_2pcc.h}
-
-\texttt{export PCAN2\_LIB=\~{ }/Disk/PCAN -Light/Lib/Visual\textbackslash{}
-C++/Pcan\_2pcc.lib}
+
+\begin{verbatim}
+ export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/
+ export PCAN_HEADER=Pcan_pcc.h
+ export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_pcc.lib
+ export PCAN2_HEADER=Pcan_2pcc.h
+ export PCAN2_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_2pcc.lib
+\end{verbatim}
+
In order to test, just connect together both CAN ports of the PCMCIA
card. Don{\textquotesingle}t forget 120ohms terminator.
-\texttt{cp \~{ }/Disk/PCAN -Light/Pcan\_pcc.dll .}
-
-\texttt{cp \~{ }/Disk/PCAN -Light/Pcan\_2pcc.dll .}
-
-\texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}}
-
-\texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll}
+
+\begin{verbatim}
+ cp ~/Disk/PCAN-Light/Pcan_pcc.dll .
+ cp ~/Disk/PCAN-Light/Pcan_2pcc.dll .
+ ./examples/TestMasterSlave/TestMasterSlave \
+ -l drivers/can_peak_win32/cygcan_peak_win32.dll
+\end{verbatim}
+
Messages are then exchanged between master and slave node, both inside
TestMasterSlave{\textquotesingle}s process.
-
\subsection{Visual Studio C++}
-
\subsubsection{Requirements}
Minimal Cygwin installation is required at configuration time in order
@@ -598,7 +611,7 @@
\subsubsection{Compilation with Visual Studio}
-You can either load independents {}``{*}.vcproj'' project files
+You can either load independent {}``{*}.vcproj'' project files
along your own projects in your own solution or load the provided
{}``CanFestival -3.vc8.sln'' solution files directly.
@@ -616,7 +629,10 @@
Copy eventually needed dlls (ie : Pcan\_Nxxx.lib) into Release or
Debug directory, and run the test program:
-\texttt{TestMasterSlave.exe -l can\_peak\_win32.dll}
+
+\begin{verbatim}
+ TestMasterSlave.exe -l can_peak_win32.dll
+\end{verbatim}
\subsection{MSYS}
@@ -655,49 +671,47 @@
Download the PCAN-Light Zip file for your HW ( URL from download page
):
-\begin{quotation}
-\texttt{wget http://www.peak-system.com/files/usb.zip}
-\end{quotation}
+\begin{verbatim}
+ wget http://www.peak-system.com/files/usb.zip
+\end{verbatim}
+
Extract its content into your MSYS's home (it will create a \char`\"{}
Disk\char`\"{} directory):
-\begin{quotation}
-\texttt{unzip usb.zip}
-\end{quotation}
+
+\begin{verbatim}
+ unzip usb.zip
+\end{verbatim}
+
+
Configure CanFestival3 providing path to the desired PcanLight implementation:
-\begin{quotation}
-\texttt{cd CanFestival-3}
-
-\texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN-Light/Api/}
-
-\texttt{export PCAN\_HEADER=Pcan\_usb.h}
-
-\texttt{export PCAN\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{}
-C++/Pcan\_usb.lib}
-
-\texttt{./configure - -can=peak\_win32}
-
-\texttt{make}
-\end{quotation}
+\begin{verbatim}
+ cd CanFestival-3
+ export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/
+ export PCAN_HEADER=Pcan_usb.h
+ export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_usb.lib
+ ./configure --can=peak_win32
+ make
+\end{verbatim}
+
In order to test, you have to use another CanFestival node, connect
with a CAN cable.
-\begin{quotation}
-\texttt{cp \~{ }/Disk/PCAN-Light/Pcan\_usb.dll .}
-
-\texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}}
-
-\texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll \textbackslash{}}
-
-\texttt{-S 500K -M none}
-\end{quotation}
+
+\begin{verbatim}
+ cp ~/Disk/PCAN-Light/Pcan_usb.dll .
+ ./examples/TestMasterSlave/TestMasterSlave \
+ -l drivers/can_peak_win32/cygcan_peak_win32.dll \
+ -S 500K -M none
+\end{verbatim}
+
Then, on the other node :
-\begin{quotation}
-\texttt{./TestMasterSlave -l my\_driver.so -S none -M 500K -m 0}
-\end{quotation}
-Now messages are beeing exchanged between master and slave node.
+\begin{verbatim}
+ ./TestMasterSlave -l my_driver.so -S none -M 500K -m 0
+\end{verbatim}
+Now messages are being exchanged between master and slave node.
\paragraph{Two nodes with PcanLight and Peak dual PCMCIA-CAN adapter}
@@ -705,48 +719,38 @@
Download the PCAN-Light Zip file for your HW ( URL from download page
):
-\begin{quotation}
-\texttt{wget http://www.peak-system.com/files/pccard.zip}
-\end{quotation}
+\begin{verbatim}
+ wget http://www.peak-system.com/files/pccard.zip
+\end{verbatim}
Extract its content into your MSYS's home (it will create a \char`\"{}
Disk\char`\"{} directory):
-\begin{quotation}
-\texttt{unzip pccard.zip}
-\end{quotation}
+\begin{verbatim}
+ unzip pccard.zip
+\end{verbatim}
The configure CanFestival3 providing path to the desired PcanLight
implementation:
-\begin{quotation}
-\texttt{export PCAN\_INCLUDE=\~{ }/Disk/PCAN-Light/Api/}
-
-\texttt{export PCAN\_HEADER=Pcan\_pcc.h}
-
-\texttt{export PCAN\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{}
-C++/Pcan\_pcc.lib}
-
-\texttt{export PCAN2\_HEADER=Pcan\_2pcc.h}
-
-\texttt{export PCAN2\_LIB=\~{ }/Disk/PCAN-Light/Lib/Visual\textbackslash{}
-C++/Pcan\_2pcc.lib}
-\end{quotation}
+\begin{verbatim}
+ export PCAN_INCLUDE=~/Disk/PCAN-Light/Api/
+ export PCAN_HEADER=Pcan_pcc.h}
+ export PCAN_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_pcc.lib
+ export PCAN2_HEADER=Pcan_2pcc.h
+ export PCAN2_LIB=~/Disk/PCAN-Light/Lib/Visual\ C++/Pcan_2pcc.lib
+\end{verbatim}
+
In order to test, just connect together both CAN ports of the PCMCIA
card. Don't forget 120ohms terminator.
-\begin{quotation}
-\texttt{cp\~{ }/Disk/PCAN-Light/Pcan\_pcc.dll ~.}
-
-\texttt{cp \~{ }/Disk/PCAN-Light/Pcan\_2pcc.dll ~.}
-
-\texttt{./examples/TestMasterSlave/TestMasterSlave \textbackslash{}}
-
-\texttt{-l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll -m 0 -s
-1}
-\end{quotation}
+\begin{verbatim}
+ cp~/Disk/PCAN-Light/Pcan_pcc.dll ~.
+ cp ~/Disk/PCAN-Light/Pcan_2pcc.dll ~.
+ ./examples/TestMasterSlave/TestMasterSlave \
+ -l drivers/can\_peak\_win32/cygcan\_peak\_win32.dll -m 0 -s 1
+\end{verbatim}
Messages are then exchanged between master and slave node, both inside
TestMasterSlave's process.
-
\section{Motorola HCS12}
The examples have been tested on a MC9S12DG255 mounted on a Elektronikladen
@@ -761,7 +765,9 @@
Configure switch:
-\texttt{-{}-target=hcs12}
+\begin{verbatim}
+ --target=hcs12
+\end{verbatim}
To do a \canopen node running on a microncontroller Motorola MC9S12DP256,
you need :
@@ -769,9 +775,9 @@
\begin{enumerate}
\item The compiler GNU gcc for HC11, HC12, HCS12 : m6811 -elf. \\
Download the \textbf{release 3.1} at : \href{http://m68hc11.serveftp.org/m68hc11_pkg_rpm.php}{http://m68hc11.serveftp.org/m68hc11\_pkg\_rpm.php}
-\item A board with this chip. We are using the T -board from Electronikladden.
+\item A board with this chip. We are using the T -board from Electronikladen.
\item At least about 40 kBytes of program memory.
-\item A tool to flash the memory. (We are using the hight cost Lauterbach
+\item A tool to flash the memory. (We are using the high cost Lauterbach
debugger).
\end{enumerate}
@@ -780,19 +786,23 @@
\subsubsection{Compiling Canfestival:}
-\texttt{./configure -{}-target=hcs12}
+\begin{verbatim}
+ ./configure --target=hcs12
+\end{verbatim}
\subsubsection{Compiling and building an example}
Enter in the folder of an HCS12 example,
-\texttt{make all}
+\begin{verbatim}
+ make all
+\end{verbatim}
\subsubsection{Flashing the memory :}
-Use your prefered loader ! If you are using a debugger Lauterbach,
+Use your preferred loader ! If you are using a debugger Lauterbach,
you can load the bash file : trace32\_flash\_programmer.cmm. It loads
directly the elf file.
@@ -800,15 +810,15 @@
\subsubsection{Connecting to a serial RS232 console :}
Connect the portS(TxD0) of the HCS12 to a console configured at 19200
-bauds 8N1, via a Max232 chip to adapt the electricals levels. On Linux,
-you can use minicom. Connecting to a console is usefull to read the
+bauds 8N1, via a Max232 chip to adapt the electrical levels. On Linux,
+you can use minicom. Connecting to a console is useful to read the
messages, but not required.
\subsubsection{Connecting to the CAN network :}
Connect the port CAN0 (pin PM0, PM1) to the network via a CAN controller.
-On our board, the CAN controler is a PCA82C250 chip.
+On our board, the CAN controller is a PCA82C250 chip.
\subsubsection{starting the node :}
@@ -824,108 +834,82 @@
\subsection{TestMasterSlave}
-\texttt{{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}\ }
-
-\texttt{{*} \ TestMasterSlave \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ A simple example for PC. It does implement 2 \canopen
-\ \ \ \ \ {*}}
-
-\texttt{{*} \ nodes in the same process. A master and a slave. Both
-\ \ \ \ {*}}
-
-\texttt{{*} \ communicate together, exchanging periodically NMT,
-SYNC, \ {*}}
-
-\texttt{{*} \ SDO and PDO. Master configure heartbeat producer time
-\ \ \ \ {*}}
-
-\texttt{{*} \ at 1000 ms for slave node -id 0x02 by concise DCF. \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ Usage: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ ./TestMasterSlave \ {[}OPTIONS] \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ OPTIONS: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -l : Can library {[}{\textquotedbl}libcanfestival\_can\_virtual.so{\textquotedbl}]
-\ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ Slave: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -s : bus name {[}{\textquotedbl}0{\textquotedbl}]
-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -S : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)
-\ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ Master: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -m : bus name {[}{\textquotedbl}1{\textquotedbl}]
-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable)
-\ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}}
-
-\bigskip{}
-
-
-\textsf{Notes for Concise DCF :}
-
-\bigskip{}
-
-
-\textsf{In this example, Master configure \ heartbeat producer time
+
+\begin{verbatim}
+ **************************************************************
+ * TestMasterSlave *
+ * *
+ * A simple example for PC. It does implement 2 CanOpen *
+ * nodes in the same process. A master and a slave. Both *
+ * communicate together, exchanging periodically NMT, SYNC, *
+ * SDO and PDO. Master configure heartbeat producer time *
+ * at 1000 ms for slave node-id 0x02 by concise DCF. *
+ * *
+ * Usage: *
+ * ./TestMasterSlave [OPTIONS] *
+ * *
+ * OPTIONS: *
+ * -l : Can library ["libcanfestival_can_virtual.so"] *
+ * *
+ * Slave: *
+ * -s : bus name ["0"] *
+ * -S : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) *
+ * *
+ * Master: *
+ * -m : bus name ["1"] *
+ * -M : 1M,500K,250K,125K,100K,50K,20K,10K,none(disable) *
+ * *
+ **************************************************************
+\end{verbatim}
+
+
+Notes aboute use of voncise DCF :
+
+In this example, Master configure heartbeat producer time
at 1000 ms for slave node -id 0x02 by concise DCF according DS -302
-profile.}
-
-\textsf{Index 0x1F22 , sub -index 0x00 of the master OD, correspond
+profile.
+
+Index 0x1F22, sub-index 0x00 of the master OD, correspond
to the number of entries. This equal to the maximum possible nodeId
(127). Each sub -index points to the Node -ID of the device, to which
-the configuration belongs.}
-
-\bigskip{}
-
-
-\textsf{To add more parameters configurations to the slave, the value
+the configuration belongs.
+
+To add more parameters configurations to the slave, the value
at sub -index 0x02 must be a binary stream (little -endian) following
-this structure :}\\
- \textsf{ \{ (UNS32) nb of entries}\\
- \textsf{ (UNS16) index parameter 1}\\
- \textsf{ (UNS8) sub -index parameter 1}\\
- \textsf{ (UNS32) size data parameter 1}\\
- \textsf{ (DOMAIN) data parameter 1}\\
- \textsf{ (UNS16) index parameter 2}\\
- \textsf{ (UNS8) sub -index parameter 2}\\
- \textsf{ (UNS32) size data parameter 2}\\
- \textsf{ (DOMAIN) data parameter 2}\\
- \textsf{ \ \ \ \ \ ....}\\
- \textsf{ (UNS16) index parameter n}\\
- \textsf{ (UNS8) sub -index parameter n}\\
- \textsf{ (UNS32) size data parameter n}\\
- \textsf{ (DOMAIN) data parameter n}\\
- \textsf{ \}}
-
-\textsf{So the binary value stream to configure heartbeat producer
-time must be :}\\
- \textsf{ 0100000017100002000000e803}
-
-\textsf{The slave node is configured just before the Master entering
-in Pre\_operational state.}
+this structure :
+
+
+\begin{verbatim}
+
+ (UNS32) nb of entries
+ (UNS16) index parameter 1
+ (UNS8) sub -index parameter 1
+ (UNS32) size data parameter 1
+ (DOMAIN) data parameter 1
+ (UNS16) index parameter 2
+ (UNS8) sub -index parameter 2
+ (UNS32) size data parameter 2
+ (DOMAIN) data parameter 2
+ ....
+ (UNS16) index parameter n
+ (UNS8) sub -index parameter n
+ (UNS32) size data parameter n
+ (DOMAIN) data parameter n
+
+\end{verbatim}
+
+
+So the binary value stream to configure heartbeat producer
+time must be :
+
+
+\begin{verbatim}
+ 0100000017100002000000e803
+\end{verbatim}
+
+
+The slave node is configured just before the Master entering
+in Pre\_operational state.
\subsection{gene\_SYNC\_HCS12 :}
@@ -951,7 +935,10 @@
which exports requisite functions. Canfestival.ko module is then dependent
on CAN card driver module, by default CAN virtual driver will be loaded.
After installing modules (make install), all dependencies are solved
-automatically by kernel. To run the example type: \texttt{sh run.sh}
+automatically by kernel. To run the example type:
+\begin{verbatim}
+ sh run.sh
+\end{verbatim}
It will insert required modules, start console, and after quitting
console it'll remove modules from kernel.
@@ -961,68 +948,39 @@
\subsection{TestMasterMicroMod }
-\texttt{{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}}
-
-\texttt{{*} \ TestMasterMicroMod \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ A simple example for PC. \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ A \canopen master that control a MicroMod module: \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - setup module TPDO 1 transmit type \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - setup module RPDO 1 transmit type \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - setup module hearbeatbeat period \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - disable others TPDOs \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - set state to operational \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - send periodic SYNC \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - send periodic RPDO 1 to Micromod (digital output)
-\ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - listen Micromod{\textquotesingle}s TPDO 1 (digital
-input) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ - Mapping RPDO 1 bit per bit (digital input) \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ Usage: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ ./TestMasterMicroMod \ {[}OPTIONS] \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ OPTIONS: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -l : Can library {[}{\textquotedbl}libcanfestival\_can\_virtual.so{\textquotedbl}]
-\ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ Slave: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -i : Slave Node id format {[}0x01 , 0x7F]
-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ Master: \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -m : bus name {[}{\textquotedbl}1{\textquotedbl}]
-\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ -M : 1M,500K,250K,125K,100K,50K,20K,10K \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}}
-
-\texttt{{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}{*}}
+
+
+\begin{verbatim}
+ **************************************************************
+ * TestMasterMicroMod *
+ * *
+ * A simple example for PC. *
+ * A CanOpen master that control a MicroMod module: *
+ * - setup module TPDO 1 transmit type *
+ * - setup module RPDO 1 transmit type *
+ * - setup module hearbeatbeat period *
+ * - disable others TPDOs *
+ * - set state to operational *
+ * - send periodic SYNC *
+ * - send periodic RPDO 1 to Micromod (digital output) *
+ * - listen Micromod's TPDO 1 (digital input) *
+ * - Mapping RPDO 1 bit per bit (digital input) *
+ * *
+ * Usage: *
+ * ./TestMasterMicroMod [OPTIONS] *
+ * *
+ * OPTIONS: *
+ * -l : Can library ["libcanfestival_can_virtual.so"] *
+ * *
+ * Slave: *
+ * -i : Slave Node id format [0x01 , 0x7F] *
+ * *
+ * Master: *
+ * -m : bus name ["1"] *
+ * -M : 1M,500K,250K,125K,100K,50K,20K,10K *
+ * *
+ **************************************************************
+\end{verbatim}
\section{Developing a new node}
@@ -1048,13 +1006,16 @@
You first have to download and install Gnosis XML modules. This is
automated by a Makefile rule.
-\texttt{cd objdictgen}
-
-\texttt{make}
+\begin{verbatim}
+ cd objdictgen
+ make
+\end{verbatim}
Now start the editor.
-\texttt{python objdictedit.py {[}od files...]}
+\begin{verbatim}
+ python objdictedit.py [od files...]
+\end{verbatim}
\subsubsection{Installation and usage on Windows}
@@ -1065,26 +1026,24 @@
Cygwin users can install Gnosis XML utils the same as Linux use. Just
call make.
-\texttt{cd objdictgen}
-
-\texttt{make}
-
-Others will have to download and intall Gnosis XML by hand :
-
-\texttt{Gnosis Utils:}
-
-\texttt{http://freshmeat.net/projects/gnosisxml/}
-
-\texttt{http://www.gnosis.cx/download/Gnosis\_Utils.More/Gnosis\_Utils
--1.2.1.win32 -py24.exe}
-
-\texttt{Get latest version.}
+\begin{verbatim}
+ cd objdictgen
+ make
+\end{verbatim}
+
+Others will have to download and install Gnosis XML by hand :
+
+\begin{verbatim}
+ Gnosis Utils:
+ http://freshmeat.net/projects/gnosisxml/
+ http://www.gnosis.cx/download/
+ Get latest version.
+\end{verbatim}
Download CanFestival archive and uncompress it. Use windows file explorer
to go into CanFestival3\textbackslash{}objdicgten, and double -click
on objdictedit.py.
-
\subsubsection{About}
The Object Dictionary editor GUI is a python application that use
@@ -1158,7 +1117,7 @@
\subsubsection{User types}
-Use User Types to implement value boundaries, and string lentgth
+Use User Types to implement value boundaries, and string length
\begin{center}
\includegraphics[width=11cm]{Pictures/10000201000001C40000010766961D7F}
@@ -1212,9 +1171,11 @@
\subsubsection{With command line}
-\texttt{Usage of objdictgen.py :}
-
-\texttt{python objdictgen.py XMLFilePath CfilePath}
+\begin{verbatim}
+ Usage of objdictgen.py :
+ python objdictgen.py XMLFilePath CfilePath
+\end{verbatim}
+
\section{FAQ}
@@ -1320,150 +1281,149 @@
\paragraph{Interrupt functions}
-\subparagraph{Code for GCC:}
-
-\texttt{// prototype}~\\
- \texttt{ void \_\_attribute\_\_((interrupt))timer3Hdl(void):}~\\
- \texttt{ // function}~\\
- \texttt{ void \_\_attribute\_\_((interrupt))timer3Hdl(void)\{...\}}
+\subparagraph{Code for GCC:
+}
+
+
+\begin{verbatim}
+ // prototype
+ void __attribute__((interrupt))timer3Hdl(void):
+ // function
+ void __attribute__((interrupt))timer3Hdl(void){...}
+\end{verbatim}
+
+
+\subparagraph{Code for CodeWarrior
+}
+
+
+\begin{verbatim}
+ // protoype
+ void interrupt timer3Hdl(void);
+ // function
+ pragma CODE_SEG__NEAR_SEG_NON_BANKED
+ void interrupt timer3Hdl(void)
+ {...}
+ pragma CODE_SEG_DEFAULT\end{verbatim}
+
+
+\paragraph{Interrupt lock, unlock
+}
+
+
+\subparagraph{Code for GCC
+}
+
+
+\begin{verbatim}
+ void unlock (void)
+ {
+ __asm__ __volatile__("cli");
+ }
+ void lock (void)
+ {
+ unsigned short mask;
+ __asm__ __volatile__("tpa\n\tsei":"=d"(mask));
+ }
+\end{verbatim}
\subparagraph{Code for CodeWarrior}
-\texttt{// protoype}~\\
- \texttt{ void interrupt timer3Hdl(void);}~\\
- \texttt{ // function}~\\
- \texttt{ pragma CODE\_SEG\_\_NEAR\_SEG\_NON\_BANKED}~\\
- \texttt{ void interrupt timer3Hdl(void)}~\\
- \texttt{ \{...\}}~\\
- \texttt{ pragma CODE\_SEG\_DEFAULT}
-
-
-\paragraph{Interrupt lock, unlock}
+
+\begin{verbatim}
+void unlock (void)
+ {
+ __asm("cli");
+ }
+ void lock (void)
+ {
+ unsigned short mask;
+ __asm
+ {
+ tpa:tsei:"=d"(mask);
+ }
+ }
+\end{verbatim}
+
+
+\paragraph{Initialize function}
\subparagraph{Code for GCC}
-\texttt{void unlock (void)}~\\
- \texttt{ \ }~\\
- \texttt{ \ \_\_asm\_\_ \_\_volatile\_\_({\textquotedbl}cli{\textquotedbl});}~\\
- \texttt{ \}}~\\
- \texttt{ void lock (void)}~\\
- \texttt{ \ }~\\
- \texttt{ \ unsigned short mask;}~\\
- \texttt{ \ \_\_asm\_\_ \_\_volatile\_\_({\textquotedbl}tpa{\textbackslash{}
-}n{\textbackslash{} }tsei{\textquotedbl}:{\textquotedbl}=d{\textquotedbl}(mask));}~\\
- \texttt{ \}}
-
-
-\subparagraph{Code for CodeWarrior}
-
-\texttt{void unlock (void)}~\\
- \texttt{ \ }~\\
- \texttt{ \ \_\_asm({\textquotedbl}cli{\textquotedbl});}~\\
- \texttt{ \}}~\\
- \texttt{ void lock (void)}~\\
- \texttt{ \ }~\\
- \texttt{ \ unsigned short mask;}~\\
- \texttt{ \ \_\_asm}~\\
- \texttt{ \ }~\\
- \texttt{ \ tpa:tsei:{\textquotedbl}=d{\textquotedbl}(mask);}~\\
- \texttt{ \}}~\\
- \texttt{ \}}
-
-
-\paragraph{Initialize function}
-
-
-\subparagraph{Code for GCC}
-
-\texttt{void initCanHCS12 (void)}~\\
- \texttt{ \{ \ }~\\
- \texttt{ \ //Init the HCS12 microcontroler for \canopen} ~\\
- \texttt{ \ initHCS12();}~\\
- \texttt{ \ \ // Init the HCS12 \ CAN driver}~\\
- \texttt{ \ const canBusInit bi0 = \ }~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no low power \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}
-~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no time stamp \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 1, \ \ \ /{*} enable MSCAN \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} clock source : oscillator (In
-fact, it is not used) \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no loop back \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no listen only \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no low pass filter for wk up {*}/}~\\
- \texttt{ \ CAN\_Baudrates{[}CAN\_BAUDRATE\_250K],}~\\
- \texttt{ \ \ \ \ }~\\
- \texttt{ \ \ \ \ \ 0x00, \ \ \ /{*} Filter on 16 bits.}~\\
- \texttt{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ See Motorola
-Block Guide V02.14 fig 4 -3 {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 0 hight accept all
-msg \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 0 low accept all
-msg \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 1 hight filter all
-of \ msg \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 1 low filter all
-of \ msg \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 2 hight filter most
-of \ msg {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 2 low filter most
-of \ msg \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 3 hight filter most
-of \ msg {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 3 low filter most
-of \ msg \ \ {*}/}~\\
- \texttt{ \ \ \ \}}~\\
- \texttt{ \ \};}
-
-
-\subparagraph{Code for CodeWarrior}
-
-\texttt{void initCanHCS12 (void)}~\\
- \texttt{ \{ \ }~\\
- \texttt{ \ //Init the HCS12 microcontroler for \canopen} ~\\
- \texttt{ \ initHCS12();}~\\
- \texttt{ \ \ // Init the HCS12 \ CAN driver}~\\
- \texttt{ \ const canBusInit bi0 = \ }~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no low power \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}
-~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no time stamp \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 1, \ \ \ /{*} enable MSCAN \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} clock source : oscillator (In
-fact, it is not used) \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no loop back \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no listen only \ \ \ \ \ \ \ \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ 0, \ \ \ /{*} no low pass filter for wk up {*}/}~\\
- \texttt{ \ \ \ \ }~\\
- \texttt{ \ \ \ \ 1, /{*} clksrc {*}/}~\\
- \texttt{ \ \ \ \ 3, /{*} brp \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ 0, /{*} sjw \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ 0, /{*} samp \ \ {*}/}~\\
- \texttt{ \ \ \ \ 1, /{*} tseg2 \ {*}/}~\\
- \texttt{ \ \ \ \ 12,/{*} tseg1 \ {*}/}~\\
- \texttt{ \ \ \ \},}~\\
- \texttt{ \ \ \ \ }~\\
- \texttt{ \ \ \ \ \ 0x00, \ \ \ /{*} Filter on 16 bits.}~\\
- \texttt{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ See Motorola
-Block Guide V02.14 fig 4 -3 {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 0 hight accept all
-msg \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 0 low accept all
-msg \ \ \ \ \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 1 hight filter all
-of \ msg \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 1 low filter all
-of \ msg \ \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 2 hight filter most
-of \ msg {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 2 low filter most
-of \ msg \ \ {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 3 hight filter most
-of \ msg {*}/}~\\
- \texttt{ \ \ \ \ \ 0x00, 0xFF, /{*} filter 3 low filter most
-of \ msg \ \ {*}/}~\\
- \texttt{ \ \ \ \}}~\\
- \texttt{ \ \};}
+
+\begin{verbatim}
+void initCanHCS12 (void)
+{
+ //Init the HCS12 microcontroler for CanOpen
+ initHCS12();
+ // Init the HCS12 CAN driver
+ const canBusInit bi0 = {
+ 0, /* no low power */
+ 0, /* no time stamp */
+ 1, /* enable MSCAN */
+ 0, /* clock source : oscillator (In fact, it is not used) */
+ 0, /* no loop back */
+ 0, /* no listen only */
+ 0, /* no low pass filter for wk up */
+ CAN_Baudrates[CAN_BAUDRATE_250K],
+ {
+ 0x00, /* Filter on 16 bits.
+ See Motorola Block Guide V02.14 fig 4-3 */
+ 0x00, 0xFF, /* filter 0 hight accept all msg */
+ 0x00, 0xFF, /* filter 0 low accept all msg */
+ 0x00, 0xFF, /* filter 1 hight filter all of msg */
+ 0x00, 0xFF, /* filter 1 low filter all of msg */
+ 0x00, 0xFF, /* filter 2 hight filter most of msg */
+ 0x00, 0xFF, /* filter 2 low filter most of msg */
+ 0x00, 0xFF, /* filter 3 hight filter most of msg */
+ 0x00, 0xFF, /* filter 3 low filter most of msg */
+ }
+};
+\end{verbatim}
+
+
+\subparagraph{Code for CodeWarrior
+}
+
+
+\begin{verbatim}
+void initCanHCS12 (void)
+{
+ //Init the HCS12 microcontroler for CanOpen
+ initHCS12();
+ // Init the HCS12 CAN driver
+ const canBusInit bi0 = {
+ 0, /* no low power */
+ 0, /* no time stamp */
+ 1, /* enable MSCAN */
+ 0, /* clock source : oscillator (In fact, it is not used) */
+ 0, /* no loop back */
+ 0, /* no listen only */
+ 0, /* no low pass filter for wk up */
+ {
+ 1, /* clksrc */
+ 3, /* brp */
+ 0, /* sjw */
+ 0, /* samp */
+ 1, /* tseg2 */
+ 12,/* tseg1 */
+ },
+ {
+ 0x00, /* Filter on 16 bits.
+ See Motorola Block Guide V02.14 fig 4-3 */
+ 0x00, 0xFF, /* filter 0 hight accept all msg */
+ 0x00, 0xFF, /* filter 0 low accept all msg */
+ 0x00, 0xFF, /* filter 1 hight filter all of msg */
+ 0x00, 0xFF, /* filter 1 low filter all of msg */
+ 0x00, 0xFF, /* filter 2 hight filter most of msg */
+ 0x00, 0xFF, /* filter 2 low filter most of msg */
+ 0x00, 0xFF, /* filter 3 hight filter most of msg */
+ 0x00, 0xFF, /* filter 3 low filter most of msg */
+ }
+};
+\end{verbatim}
\subsubsection{Does the code works in banked memory ?}
@@ -1485,37 +1445,38 @@
\section{Documentation resources}
-\paragraph{CIA : Can in Automation }
+\subsection{CIA : Can in Automation }
\href{http://www.can-cia.de/}{http://www.can -cia.de}
-\paragraph{Resources and training in \canopen }
+\subsection{Resources and training in \canopen
+}
\href{http://www.esacademy.com/}{http://www.esacademy.com}
-\paragraph{Elektronikladen HCS12 T -board }
+\subsection{Elektronikladen HCS12 T -board }
\href{http://www.elektronikladen.de/en_hcs12tb.html}{http://www.elektronikladen.de/en\_hcs12tb.html}
-\paragraph{Gnu gcc compiler for HC12}
+\subsection{Gnu gcc compiler for HC12 }
\href{http://m68hc11.serveftp.org/m68hc11_port.php}{http://m68hc11.serveftp.org/m68hc11\_port.php}
-\paragraph{Motorola documentation on HC12 }
+\subsection{Motorola documentation on HC12 }
\href{http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MC9S12DP256}{http://www.freescale.com/webapp/sps/site/prod\_summary.jsp?code=MC9S12DP256}
-\paragraph{Lauterbach debugger for HC12 }
+\subsection{Lauterbach debugger for HC12 }
\href{http://www.lauterbach.com/}{http://www.lauterbach.com}
-\paragraph{Python language }
+\subsection{Python language }
\href{http://www.python.org/}{http://www.python.org}
@@ -1612,50 +1573,28 @@
All the project is licensed with LGPL. This mean you can link CanFestival
with any code without being obliged to publish it.
-\texttt{\#This file is part of CanFestival, a library implementing
-\canopen Stack.}
-
-\texttt{\#}
-
-\texttt{\#Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent
-BESSARD}
-
-\texttt{\#}
-
-\texttt{\#See COPYING file for copyrights details.}
-
-\texttt{\#}
-
-\texttt{\#This library is free software; you can redistribute it and/or}
-
-\texttt{\#modify it under the terms of the GNU Lesser General Public}
-
-\texttt{\#License as published by the Free Software Foundation; either}
-
-\texttt{\#version 2.1 of the License, or (at your option) any later
-version.}
-
-\texttt{\#}
-
-\texttt{\#This library is distributed in the hope that it will be
-useful,}
-
-\texttt{\#but WITHOUT ANY WARRANTY; without even the implied warranty
-of}
-
-\texttt{\#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
-the GNU}
-
-\texttt{\#Lesser General Public License for more details.}
-
-\texttt{\#}
-
-\texttt{\#You should have received a copy of the GNU Lesser General
-Public}
-
-\texttt{\#License along with this library; if not, write to the Free
-Software}
-
-\texttt{\#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-\ 02111 -1307 \ USA}
+
+\begin{verbatim}
+#This file is part of CanFestival, a library implementing CanOpen Stack.
+#
+#Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD
+#
+#See COPYING file for copyrights details.
+#
+#This library is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public
+#License as published by the Free Software Foundation; either
+#version 2.1 of the License, or (at your option) any later version.
+#
+#This library is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#Lesser General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public
+#License along with this library; if not, write to the Free Software
+#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+\end{verbatim}
+
+
\end{document}