📄 manual.tex
字号:
Chose the used profile to edit.\begin{center}\includegraphics[width=4cm]{Pictures/10000000000000AB000000C88F594413} \par\end{center}Pick up optional chosen profile entries.\begin{center}\includegraphics[width=11cm]{Pictures/10000201000002DE000001D82D89C224} \par\end{center}\subsubsection{User types}Use User Types to implement value boundaries, and string length\begin{center}\includegraphics[width=11cm]{Pictures/10000201000001C40000010766961D7F} \par\end{center}\subsubsection{Mapped variable}Add your own specific dictionary entries and associated mapped variables.\begin{center}\includegraphics[width=11cm]{Pictures/10000201000001C4000000DD129D4661} \par\end{center}\subsubsection{Integrated help}Using F1 key, you can get context sensitive help.\begin{center}\includegraphics[width=12cm]{Pictures/10000201000002F30000020B23ED7F67} \par\end{center}In order to do that, official 301\_v04000201.pdf file must be placedinto doc/ directory, and xpdf must be present on your system.F2 key open HTML CanFestival help.\begin{center}\includegraphics[width=12cm]{Pictures/10000201000003440000025ACC3FD2F1} \par\end{center}\subsection{Generating the object Dictionary}Once object dictionary has been edited and saved, you have to generateobject dictionary C code for your CanFestival node.\subsubsection{With GUI}Menu entry {}``File/Build Dictionary''.\begin{center}\includegraphics[width=4cm]{Pictures/10000201000000B7000000C66AF89CD5} \par\end{center}Choose C file to create or overwrite. Header file will be also createdwith the same prefix as C file.\subsubsection{With command line}\begin{verbatim} Usage of objdictgen.py : python objdictgen.py XMLFilePath CfilePath\end{verbatim}\section{FAQ}\subsection{General}\subsubsection{Does the code compiles on Windows ?}Yes, with both Cygwin and Visual Studio C++. Because \canopen layer is coded with C, put a compilation option/TC or /TP if you plan to mix C++ files. See the MSDN documentationabout that.\subsubsection{How to fit the library to an other microcontr锟絣er ?}First, be sure that you have at least 40K bytes of program memory,and about 2k of RAM.You have to create target specific interface to HW resources. Takemodel on bundled interfaces provided in drivers/ and create your owninterface. You also have to update Makefile.in files for target specificcflags and options. Choose {--}target= configure switch to compileyour specific interface.You are welcome to contribute -back your own interfaces! Other Canfestivalusers will use it and provide feedback, tests and enhancements.\subsubsection{Is CanFestival3 conform to DS301 v.4.02 ?}Thanks to Philippe Foureys (IUT of Valence), a slave node have beentested with the National Instrument \canopen Conformance Test. Itpassed the test with success.Some very small unconformity have been found in very unusual situations,for example in the SDO code response to wrong messages.\subsection{LINUX}\subsubsection{How to use a Peaksystem CAN board ?}Just install peak driver and then compile and install Canfestival.Peak driver is detected at compile time.\subsubsection{How to use an unsupported CAN board ?}You have to install the specific driver on your system, with necessarylibs and headers.Use can\_peak.c/h or can\_virtual.c/h as an example, and adapt itto your driver API.Execute configure script and choose --can=mydriver\subsection{Win32}Compatibility:\begin{enumerate}\item Code was compiled MS VisualStudio 2003.NET and VisualStudio 2005.NETfor WindowsXP \ with ANSI and UNICODE configurations and for WindowsCE5.0. \item Some preliminary testing was done, but not enough to be used in missioncritical projects. \end{enumerate}Additional Features:\begin{enumerate}\item Non -integral integers support implementation UNS24, UNS40, UNS48etc. \item When enable debug output with DEBUG\_WAR\_CONSOLE\_ON or DEBUG\_ERR\_CONSOLE\_ON,you can navigate in CanFestival source code by double clicking atdiagnostic lines in VisualStudio.NET 200X Debug Output Window. \end{enumerate}Custom size integral types such as INTEGER24, UNS40, INTEGER56 etc.have been defined as 64 bits integers. You will need to replace sizeof(TYPE)operators to sizeof\_TYPE definitions in generated code, i.e. replacesizeof(UNS40) with sizeof\_UNS40.\subsection{HCS12}\subsubsection{Which board are you using ?}A T -board from elektronikladen with a MC9S12DP256 or MC9S12DG256.\subsubsection{Does the code compile with an other compiler than GNU gcc ?}It is known to work with Metrowerks CodeWarrior. Here are some tipsfrom Philippe Foureys. :\paragraph{Interrupt functions}\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}\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}\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 ?}No. Today it seems that the port of gcc is bogged for using the bankedmemory. So, unfortunately, we are limited to 48 Kbytes of memory code.\subsubsection{What GCC version are you using ?}We are using the stable RPM release 2.2 :\begin{enumerate}\item GNU Gcc 3.0.4. Build 20030501 \item Newlib 1.10.0 Build 20030421 \item GNU Binutils 2.12.1 Build 20030427 \end{enumerate}\section{Documentation resources}\subsection{CIA : Can in Automation }\href{http://www.can-cia.de/}{http://www.can -cia.de}\subsection{Resources and training in \canopen }\href{http://www.esacademy.com/}{http://www.esacademy.com}\subsection{Elektronikladen HCS12 T -board }\href{http://www.elektronikladen.de/en_hcs12tb.html}{http://www.elektronikladen.de/en\_hcs12tb.html}\subsection{Gnu gcc compiler for HC12 }\href{http://m68hc11.serveftp.org/m68hc11_port.php}{http://m68hc11.serveftp.org/m68hc11\_port.php}\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}\subsection{Lauterbach debugger for HC12 }\href{http://www.lauterbach.com/}{http://www.lauterbach.com}\subsection{Python language }\href{http://www.python.org/}{http://www.python.org}\clearpage{}\section{About the project}\subsection{Contributors }\begin{center}\includegraphics[width=10cm]{Pictures/1000020100000258000000832C6FFAB4} \par\end{center}Unit锟
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -