From f15c92fd3458064277a69d4f083296c8152662cb Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 4 Dec 2014 01:50:41 +0100 Subject: [PATCH] doc: RM48 specific changes --- doc/rpp_simulink.tex | 373 ++++++++++++++++++++++--------------------- 1 file changed, 194 insertions(+), 179 deletions(-) diff --git a/doc/rpp_simulink.tex b/doc/rpp_simulink.tex index 83bac05..c4d4a29 100644 --- a/doc/rpp_simulink.tex +++ b/doc/rpp_simulink.tex @@ -125,13 +125,21 @@ Michal \textsc{Sojka}\\[\baselineskip] \chapter{Introduction} \label{chap-introduction} -This text is a documentation for a Rapid Prototyping Platform (RPP) project. It -may serve as a guideline for development tools installation, Simulink Coder -configuration, creation of new models as well as downloading the resulting -firmware to the hardware. It can also be used as a reference for a testing tool, -Matlab Simulink blocks and RPP Matlab Simulink Code generator. The document also -provides an overall description of the hardware design and architecture of its -control software. +This text serves as a documentation for the Rapid Prototyping Platform +(RPP) project based on Texas Instruments RM48 safety microcontroller. +Originally, the RPP project was created for TMS570 microcontroller and +the port to RM48 was derived from it under a contract with Eaton +Corporation. As this document is still in beta version, some +references to the original TMS570-based RPP remain in it. + + +The document contains step-by-step instructions for installation of +development tools, information about Simulink Coder configuration, +describes how to create new models as well as how to download the +resulting firmware to the hardware. It can also be used as a reference +for a testing tool, Matlab Simulink blocks and RPP Matlab Simulink +Code generator. The document also provides an overall description of +the hardware design and architecture of its control software. \section{Background} \label{sec-background} @@ -197,9 +205,9 @@ design was driven by the following guidelines: \begin{compactitem} \item Top-down dependency only. No lower layer depends on anything from upper layers. - \item 1-1 layer dependency only. The top layer depends -exclusively on the bottom layer, not on any lower level layer (except for a -couple of exceptions). +% \item 1-1 layer dependency only. The top layer depends +% exclusively on the bottom layer, not on any lower level layer (except for a +% couple of exceptions). \item Each layer should provide a unified layer interface (\textsc{rpp.h}, \textsc{drv.h}, \textsc {hal.h}, \textsc{sys.h} and \textsc{os.h}), so top layers depends on that layer interface and not on @@ -311,139 +319,141 @@ This section provides reference documentation for the RPP board: \item Modules capabilities and features. \end{compactitem} -\subsection{Layout description} -\label{sec-layout-description} -The RPP board has been designed with strict Automotive standards and safety in -mind. The components and pins are placed in sections and wires are routed in a -way to avoid any significant electromagnetic interference. - -As can be seen on Figure \ref{board_photo}, the high power output logic is -placed in the top left corner, the low power output logic is placed on the -bottom left corner, while the communication logic is placed on the top right -corner. In the middle there is the only one button available, the reset button -and below it is placed the TMS570 MCU itself. In the bottom right corner there -are components of analog inputs. - -\begin{figure}[H]\begin{center} -\noindent -\includegraphics[width=300px]{images/board-photo.png} -\caption{The RPP board (signal connector missing).} -\label{board_photo} -\end{center}\end{figure} - - -\subsection{Connectors pinout} -\label{sec-connector-pinout} -The pinout of the board, described by the Figure \ref{pinout}, follows the -layout described in the previous section. The side connectors for communication -(24 pins), signals (56 pins) and power (24 pins) are automotive approved -humidity resistant connectors. - -\begin{figure}[H] -\advance\leftskip-1cm -\noindent -\includegraphics[width=530px]{images/pinout.pdf} -\caption{The RPP connectors pinout.} -\label{pinout} -\end{figure} - -\subsection{Modules description} -\label{sec-modules-description} -This section enumerates the capabilities of the hardware modules from Software -perspective. The block diagram of the modules can be seen in Figure -\ref{blocks}. - -\begin{figure}[H] -\advance -\leftskip-1cm -\noindent -\includegraphics[width=500px]{images/blocks.pdf} -\caption{The RPP layer modules.} -\label{blocks} -\end{figure} - -\subsubsection{Logic IO} -\label{sec-logic-io} +TODO + +% \subsection{Layout description} +% \label{sec-layout-description} +% The RPP board has been designed with strict Automotive standards and safety in +% mind. The components and pins are placed in sections and wires are routed in a +% way to avoid any significant electromagnetic interference. + +% As can be seen on Figure \ref{board_photo}, the high power output logic is +% placed in the top left corner, the low power output logic is placed on the +% bottom left corner, while the communication logic is placed on the top right +% corner. In the middle there is the only one button available, the reset button +% and below it is placed the TMS570 MCU itself. In the bottom right corner there +% are components of analog inputs. + +% \begin{figure}[H]\begin{center} +% \noindent +% \includegraphics[width=300px]{images/board-photo.png} +% \caption{The RPP board (signal connector missing).} +% \label{board_photo} +% \end{center}\end{figure} + + +% \subsection{Connectors pinout} +% \label{sec-connector-pinout} +% The pinout of the board, described by the Figure \ref{pinout}, follows the +% layout described in the previous section. The side connectors for communication +% (24 pins), signals (56 pins) and power (24 pins) are automotive approved +% humidity resistant connectors. + +% \begin{figure}[H] +% \advance\leftskip-1cm +% \noindent +% \includegraphics[width=530px]{images/pinout.pdf} +% \caption{The RPP connectors pinout.} +% \label{pinout} +% \end{figure} + +% \subsection{Modules description} +% \label{sec-modules-description} +% This section enumerates the capabilities of the hardware modules from Software +% perspective. The block diagram of the modules can be seen in Figure +% \ref{blocks}. + +% \begin{figure}[H] +% \advance +% \leftskip-1cm +% \noindent +% \includegraphics[width=500px]{images/blocks.pdf} +% \caption{The RPP layer modules.} +% \label{blocks} +% \end{figure} + +% \subsubsection{Logic IO} +% \label{sec-logic-io} \paragraph{Digital Inputs (DIN)} \label{par-digital-inputs} -\begin{compactitem} - \item 16 pins available on Signal Connector. - \item Pins 8-15 status can be read via GPIO using configurable -threshold. \newline{} Pins 8-11 use variable threshold B and pins 12-15 use -variable threshold A. - \item Variable threshold is a DAC chip MCP4922. - \item All pins are read at once via SPI (fixed threshold) using chip -MC33972. - \item 0-7 are programmable pins and can be set to pull-up or -pull-down. 8-15 are pull-down only. - \item All pins can be set to be active or tri-stated. - \item All pins can be set to trigger interrupt. - \item On-line diagnostic of broken wire. -\end{compactitem} - -\paragraph{Digital Outputs (LOUT)} -\label{par-digital-outputs} -\begin{compactitem} - \item 8 pins available on Signal Connector. - \item Pins for logic output only, up to 100mA. - \item All pins are set at once using a chip through SPI. -\end{compactitem} +% \begin{compactitem} +% \item 16 pins available on Signal Connector. +% \item Pins 8-15 status can be read via GPIO using configurable +% threshold. \newline{} Pins 8-11 use variable threshold B and pins 12-15 use +% variable threshold A. +% \item Variable threshold is a DAC chip MCP4922. +% \item All pins are read at once via SPI (fixed threshold) using chip +% MC33972. +% \item 0-7 are programmable pins and can be set to pull-up or +% pull-down. 8-15 are pull-down only. +% \item All pins can be set to be active or tri-stated. +% \item All pins can be set to trigger interrupt. +% \item On-line diagnostic of broken wire. +% \end{compactitem} + +% \paragraph{Digital Outputs (LOUT)} +% \label{par-digital-outputs} +% \begin{compactitem} +% \item 8 pins available on Signal Connector. +% \item Pins for logic output only, up to 100mA. +% \item All pins are set at once using a chip through SPI. +% \end{compactitem} \paragraph{Analog Input (ADC)} \label{par-analog-input} -\begin{compactitem} - \item 12 channels available. - \item Differential inputs, thus 24 pins available on Signal Connector. - \item Range for 0-20 volts. - \item 12 bits resolution. - \item Using CPU ADC. -\end{compactitem} - -\paragraph{Analog Output (DAC)} -\label{par-analog-output} -\begin{compactitem} - \item 4 pins available on Signal Connector. - \item Output range is 0-12 volts. - \item Using 2 x MCP4922 DACs controlled using SPI. - \item Resolution is 12 bits. But because of amplification and voltage -reference not all range is used. -\end{compactitem} - -\subsubsection{Power Output} -\label{sec-power-output} -\paragraph{H-Bridge (HBR)} -\label{par-hbr} -\begin{compactitem} - \item 1 port (2 pins) available on Power Connector. - \item Communication is done through SPI. - \item H-Bridge can be enabled or disabled. - \item Current direction can be set. - \item PWM control with 1\% resolution change of the duty cycle. - \item Port can drive load up to 10A. -\end{compactitem} - -\paragraph{Power Output (MOUT)} -\label{par-power-output} -\begin{compactitem} - \item 6 pins available on Power Connector. - \item Pins can drive a load up to 2A. Push/Pull. - \item Pins are set using 6 CPU output GPIOs. Diagnostic are read using 6 -externally pulled-up open-drain input GPIOs. - \item On-line diagnostics. Driver chip will pull-down the corresponding -diagnostic pin on the CPU. -\end{compactitem} - -\paragraph{High-Power Output (HOUT)} -\label{par-high-power-output} -\begin{compactitem} - \item 6 pins available on Power Connector. - \item Pins can be set ON/OFF. - \item Pins can drive a load up to 10A with PWM. - \item System can read analog values of current flowing (IFBK). - \item System can read diagnostics values (DIAG). Detection of a fault -condition. -\end{compactitem} +% \begin{compactitem} +% \item 12 channels available. +% \item Differential inputs, thus 24 pins available on Signal Connector. +% \item Range for 0-20 volts. +% \item 12 bits resolution. +% \item Using CPU ADC. +% \end{compactitem} + +% \paragraph{Analog Output (DAC)} +% \label{par-analog-output} +% \begin{compactitem} +% \item 4 pins available on Signal Connector. +% \item Output range is 0-12 volts. +% \item Using 2 x MCP4922 DACs controlled using SPI. +% \item Resolution is 12 bits. But because of amplification and voltage +% reference not all range is used. +% \end{compactitem} + +% \subsubsection{Power Output} +% \label{sec-power-output} +% \paragraph{H-Bridge (HBR)} +% \label{par-hbr} +% \begin{compactitem} +% \item 1 port (2 pins) available on Power Connector. +% \item Communication is done through SPI. +% \item H-Bridge can be enabled or disabled. +% \item Current direction can be set. +% \item PWM control with 1\% resolution change of the duty cycle. +% \item Port can drive load up to 10A. +% \end{compactitem} + +% \paragraph{Power Output (MOUT)} +% \label{par-power-output} +% \begin{compactitem} +% \item 6 pins available on Power Connector. +% \item Pins can drive a load up to 2A. Push/Pull. +% \item Pins are set using 6 CPU output GPIOs. Diagnostic are read using 6 +% externally pulled-up open-drain input GPIOs. +% \item On-line diagnostics. Driver chip will pull-down the corresponding +% diagnostic pin on the CPU. +% \end{compactitem} + +% \paragraph{High-Power Output (HOUT)} +% \label{par-high-power-output} +% \begin{compactitem} +% \item 6 pins available on Power Connector. +% \item Pins can be set ON/OFF. +% \item Pins can drive a load up to 10A with PWM. +% \item System can read analog values of current flowing (IFBK). +% \item System can read diagnostics values (DIAG). Detection of a fault +% condition. +% \end{compactitem} \subsubsection{Communication} \label{sec-communication} @@ -457,20 +467,20 @@ are available on Communication connector. \item Detection of network errors. \end{compactitem} -\paragraph{Local Interconnect Network (LIN)} -\label{par-lin} -\begin{compactitem} - \item 2 ports/pins available on Communication Connector. - \item Only first port can be used when using the SCI. Second port is -shared with SCI. -\end{compactitem} - -\paragraph{FlexRay (FR)} -\label{par-flexray} -\begin{compactitem} - \item 2 ports available. FlexRay uses differential signaling thus 4 pins are available on - Communication Connector. -\end{compactitem} +% \paragraph{Local Interconnect Network (LIN)} +% \label{par-lin} +% \begin{compactitem} +% \item 2 ports/pins available on Communication Connector. +% \item Only first port can be used when using the SCI. Second port is +% shared with SCI. +% \end{compactitem} + +% \paragraph{FlexRay (FR)} +% \label{par-flexray} +% \begin{compactitem} +% \item 2 ports available. FlexRay uses differential signaling thus 4 pins are available on +% Communication Connector. +% \end{compactitem} \paragraph{Serial Comm. Interface (SCI)} \label{par-sci} @@ -480,29 +490,29 @@ shared with SCI. \item RS232 standard compatible. \end{compactitem} -\paragraph{Ethernet (ETH)} -\label{par-eth} -\begin{compactitem} - \item 1 port available. Standard Ethernet connector available inside box. -\end{compactitem} - -\subsubsection{Data storage/logging} -\label{sec-data-storage} -\paragraph{External Memory SD-RAM (SDR)} -\label{par-external-memory} -\begin{compactitem} - \item 64MB (currently installed) external RAM used for logging. Maximal -supported capacity is 256MB. - \item Memory test routine available with test -Software. -\end{compactitem} - -\paragraph{SD Card (SDC)} -\label{par-sd-card} -\begin{compactitem} - \item Standard SD-Card connector or microSD connector available inside box. - \item Communication done using SPI. -\end{compactitem} +% \paragraph{Ethernet (ETH)} +% \label{par-eth} +% \begin{compactitem} +% \item 1 port available. Standard Ethernet connector available inside box. +% \end{compactitem} + +% \subsubsection{Data storage/logging} +% \label{sec-data-storage} +% \paragraph{External Memory SD-RAM (SDR)} +% \label{par-external-memory} +% \begin{compactitem} +% \item 64MB (currently installed) external RAM used for logging. Maximal +% supported capacity is 256MB. +% \item Memory test routine available with test +% Software. +% \end{compactitem} + +% \paragraph{SD Card (SDC)} +% \label{par-sd-card} +% \begin{compactitem} +% \item Standard SD-Card connector or microSD connector available inside box. +% \item Communication done using SPI. +% \end{compactitem} \section{Document structure} \label{sec-document-structure} @@ -748,8 +758,7 @@ add \textsc{RPP\_LIB\_ROOT} to the library search path.\newline{} \item Configure linker to retain \textsc{.intvecs} from RPP static library.\newline{} \noindent\includegraphics[width=350px]{images/base_4.png} \item Configure compiler to include local includes, OS includes for -TMS570 and RPP includes, in that order\todo{Add lwip include paths as -well}.\newline{} +TMS570 and RPP includes, in that order.\newline{} \noindent\includegraphics[width=350px]{images/base_5.png} \newpage \item Configure compiler to allow GCC extensions.\newline{} @@ -1178,7 +1187,11 @@ serial interface connector on the RPP board. \section{Bug reporting} \label{sec-bug-reporting} -% TODO: implement +Please report any problems at CTU's bug tracking system at +\url{https://redmine.felk.cvut.cz/projects/eaton-rm48}. New users have +to register in the system and notify Michal Sojka about their +registration via $\langle{}sojkam1@fel.cvut.cz\rangle{}$ email +address. \chapter{C Support Library} \label{chap-c-support-library} @@ -1741,8 +1754,10 @@ The file \textsc{$\langle$modelname$\rangle$.c} has 3 main functions: This section describes each one of the Simulink blocks present in the Simulink RPP block library, shown in Figure \ref{fig-block-library}. -\begin{figure} -\includegraphics[width=\textwidth]{images/block_library.png} +\begin{figure}[h] + \begin{center} + TODO%\includegraphics[width=\textwidth]{images/block_library.png} + \end{center} \caption{Simulink RPP Block Library.} \label{fig-block-library} \end{figure} -- 2.39.2