Commit b24b0a20 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

Changed location of i2c_slave doc and started vme64x_i2c doc

parent 1b6dacbf
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="513.25293"
height="172.24207"
id="svg5725"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="i2c-bitlevel.svg">
<defs
id="defs5727" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="360.61373"
inkscape:cy="71.153224"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:window-width="1855"
inkscape:window-height="1176"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
showguides="true"
inkscape:guide-bbox="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata5730">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(12.270655,-83.87603)">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 212.48847,237.90156 35.43307,0 0,0 17.71653,-35.43307 17.71654,0 17.71653,35.43307 35.43307,0"
id="path5749"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="-13.131983"
y="153.18704"
id="text5755"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan5757"
x="-13.131983"
y="153.18704"
style="font-size:12px;font-weight:bold">SDA</tspan></text>
<text
sodipodi:linespacing="125%"
id="text5759"
y="224.05318"
x="-13.131983"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
style="font-size:12px;font-weight:bold"
y="224.05318"
x="-13.131983"
id="tspan5761"
sodipodi:role="line">SCL</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 53.149606,201.96848 70.866144,0 17.71653,35.43307 17.71654,0"
id="path6292"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path6294"
d="m 496.063,201.96848 -70.86615,0 -17.71653,35.43307 -17.71654,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 53.149606,131.10234 35.433071,0 17.716533,35.43307 53.14961,0"
id="path6296"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path6298"
d="m 496.063,131.10234 -35.43307,0 -17.71654,35.43307 -53.14961,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<rect
style="opacity:0.75;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:8, 8;stroke-dashoffset:0"
id="rect6300"
width="35.714287"
height="141.73228"
x="80"
y="113.3858" />
<rect
y="113.3858"
x="435.06863"
height="141.73228"
width="35.714287"
id="rect6302"
style="opacity:0.75;fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:8, 8;stroke-dashoffset:0" />
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="106.08603"
y="91.473686"
id="text6304"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
x="107.67783"
y="91.473686"
id="tspan3003"
style="text-align:center;text-anchor:middle">Start (S) or repeated start (Sr) </tspan><tspan
sodipodi:role="line"
x="106.08603"
y="103.97369"
style="text-align:center;text-anchor:middle"
id="tspan3026">condition</tspan></text>
<text
sodipodi:linespacing="125%"
id="text6308"
y="98.312073"
x="229.80971"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
y="98.312073"
x="229.80971"
id="tspan6310"
sodipodi:role="line">Valid bit transfer</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="412.64731"
y="97.342827"
id="text6312"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan6314"
x="412.64731"
y="97.342827">Stop condition (P)</tspan></text>
<path
style="opacity:0.75;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:6, 6;stroke-dashoffset:0"
d="m 247.92154,113.88581 0,141.73229"
id="path6320"
inkscape:connector-curvature="0" />
<path
style="opacity:0.75;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:6, 6;stroke-dashoffset:0"
d="m 301.07114,113.88581 0,141.73229"
id="path6322"
inkscape:connector-curvature="0" />
<g
id="g4484"
transform="matrix(1,0,0,-0.98588871,-0.10995786,295.78773)">
<path
inkscape:connector-curvature="0"
id="path5747"
d="m 212.59843,166.53541 17.71653,0 17.71654,-35.43307 53.1496,0 17.71654,35.43307 17.71653,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path6324"
d="m 230.31496,166.53541 88.58268,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
</svg>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="459.73666"
height="87.908813"
id="svg5817"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="i2c-ports.svg">
<defs
id="defs5819">
<marker
inkscape:stockid="DotM"
orient="auto"
refY="0"
refX="0"
id="DotM"
style="overflow:visible">
<path
id="path6698"
d="m -2.5,-1 c 0,2.76 -2.24,5 -5,5 -2.76,0 -5,-2.24 -5,-5 0,-2.76 2.24,-5 5,-5 2.76,0 5,2.24 5,5 z"
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt"
transform="matrix(0.4,0,0,0.4,2.96,0.4)"
inkscape:connector-curvature="0" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
inkscape:cx="183.77749"
inkscape:cy="72.704189"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:snap-global="true"
inkscape:window-width="1855"
inkscape:window-height="1176"
inkscape:window-x="65"
inkscape:window-y="24"
inkscape:window-maximized="1"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0" />
<metadata
id="metadata5822">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-98.606537,-31.118387)">
<g
id="g7142">
<path
inkscape:connector-curvature="0"
id="path5844"
d="m 177.16535,60.236198 35.43308,17.716536 -35.43308,17.716535 z"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path5848"
d="m 141.73228,77.952734 35.43307,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path5854"
d="m 212.59843,77.952734 70.86614,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path5856"
d="m 141.73228,35.433049 53.14961,0 0,33.714845"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path5860"
d="m 248.0315,77.952734 0,35.433066 -106.29922,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#DotM)" />
<text
sodipodi:linespacing="125%"
id="text7095"
y="80.823746"
x="115.56454"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
y="80.823746"
x="115.56454"
id="tspan7097"
sodipodi:role="line">scl_o</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="119.29501"
y="116.6688"
id="text7099"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan7101"
x="119.29501"
y="116.6688">scl_i</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="98.064545"
y="38.716045"
id="text7103"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan7105"
x="98.064545"
y="38.716045">scl_en_o</tspan></text>
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="288.55316"
y="80.823746"
id="text7119"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan7121"
x="288.55316"
y="80.823746">SCL</tspan></text>
</g>
<g
id="g7127"
transform="translate(249.16504,-106.28063)">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 177.16535,166.53541 35.43308,17.71654 -35.43308,17.71653 z"
id="path5846"
inkscape:connector-curvature="0" />
<path
inkscape:connector-curvature="0"
id="path5850"
d="m 141.73228,184.25195 35.43307,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path5852"
d="m 212.59843,184.25195 70.86614,0"
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 141.73228,141.73226 53.14961,0 0,33.71485"
id="path5858"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#DotM)"
d="m 248.0315,184.25195 0,35.43307 -106.29922,0"
id="path7074"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="110.26124"
y="187.10439"
id="text7107"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan7109"
x="110.26124"
y="187.10439">sda_o</tspan></text>
<text
sodipodi:linespacing="125%"
id="text7111"
y="222.94943"
x="113.99171"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
y="222.94943"
x="113.99171"
id="tspan7113"
sodipodi:role="line">sda_i</tspan></text>
<text
sodipodi:linespacing="125%"
id="text7115"
y="144.99667"
x="92.761246"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
y="144.99667"
x="92.761246"
id="tspan7117"
sodipodi:role="line">sda_en_o</tspan></text>
<text
sodipodi:linespacing="125%"
id="text7123"
y="186.13214"
x="288.55316"
style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
xml:space="preserve"><tspan
y="186.13214"
x="288.55316"
id="tspan7125"
sodipodi:role="line">SDA</tspan></text>
</g>
</g>
</svg>
This diff is collapsed.
This diff is collapsed.
@misc{i2c-spec,
title = {{I2C Bus Specification, version 2.1}},
month = jan,
year = 2000,
note = "{\url{http://www.nxp.com/documents/other/39340011.pdf}}"
}
\ No newline at end of file
This diff is collapsed.
FILE=vme64x_i2c
all:
pdflatex -synctex=1 -interaction=nonstopmode *.tex
bibtex *.aux
pdflatex -synctex=1 -interaction=nonstopmode *.tex
pdflatex -synctex=1 -interaction=nonstopmode *.tex
evince $(FILE).pdf &
clean:
rm -rf *.aux *.dvi *.log $(FILE).pdf *.lof *.lot *.out *.toc *.bbl *.blg *.gz
@misc{sysmon-i2c,
author = "{ELMA}",
title = {{Access to board data using SNMP and I2C}},
howpublished = {\url{http://www.ohwr.org/documents/227}}
}
%==============================================================================
% Document header
%==============================================================================
\documentclass[a4paper,11pt]{article}
\usepackage[pdfborder= 0 0 0 1]{hyperref}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{rotating}
\usepackage{multirow}
\usepackage{color}
%==============================================================================
% Start of document
%==============================================================================
\begin{document}
\title{VME64x I$^2$C to Wishbone bridge}
\author
{
Theodor-Adrian Stana \\
CERN, BE-CO-HT \\
}
\date{\today}
\maketitle
\thispagestyle{empty}
\begin{figure}
\begin{center}
\includegraphics[scale=.25,keepaspectratio]{fig/cern-logo.png}
\end{center}
\end{figure}
% Break page
\pagebreak
% Generate TOC and pagebreak after it
\tableofcontents
\pagebreak
%==============================================================================
% SEC: Intro
%==============================================================================
\section{Introduction}
\label{sec:intro}
This document describes the \textit{vme64x\_i2c} module, an I$^2$C to Wishbone
bridge for the VME64x crates. The module implements an I$^2$C slave and translates
the protocol defined by ELMA in \cite{sysmon-i2c} into Wishbone accesses to a
Wishbone slave device of choice.
%==============================================================================
% SEC: Protocol
%==============================================================================
\section{ELMA I$^2$C Protocol}
\label{sec:elma-i2c}
\textcolor{red}{WRITE THIS THING}
%==============================================================================
% SEC: Implem
%==============================================================================
\section{Implementation}
\label{sec:implem}
In order to perform low-level I$^2$C transfers, the \textit{i2c\_slave} module
is instantiated and used within the \textit{vme64x\_i2c} module. The outputs of
the \textit{i2c\_slave} module \textcolor{red}{REFERENCE?} are used as controls for an eight-state
finite state machine (FSM), shown in Table~\ref{tbl:state-mach}. When the
\textit{i2c\_slave} module finishes a transfer (signaled by a \textit{done\_p\_o}
pulse), the status is checked and if it is as expected (e.g., a \textit{address good}
in the \textit{ST\_IDLE} state), the FSM advances to the next state.
\begin{table}[h]
\caption{\textit{vme64x\_i2c} state machine}
\label{tbl:state-mach}
\centerline
{
\begin{tabular}{l p{.65\textwidth}}
\hline
\multicolumn{1}{c}{\textbf{State}} & \multicolumn{1}{c}{\textbf{Description}} \\
\hline
ST\_IDLE & Wait for the \textit{i2c\_slave} module to receive the I$^2$C
address and go to \textit{ST\_WB\_ADR}. The starting value at the
\textit{op\_o} output of the \textit{i2c\_slave} module is stored
for checking in \textit{ST\_OP} \\
ST\_WB\_ADR & Shift in the two address bytes sent via I$^2$C and go to
\textit{ST\_SIM\_WB\_TRANSF} \\
ST\_SIM\_WB\_TRANSF & Start a Wishbone read transfer from address received in previous
state and go to \textit{ST\_OP} if Wishbone address exists (Wishbone
\textit{ack} received, or \textit{ST\_IDLE} otherwise (Wishbone \textit{err}
received) \\
ST\_OP & Check the \textit{op\_o} output of the \textit{i2c\_slave} module.
If different from the value at the start, go to \textit{ST\_SYSMON\_RD\_WB} state
(SysMon is reading from CONV-TTL-BLO), otherwise continue shifting
in bytes (SysMon writing to CONV-TTL-BLO) \\
ST\_SYSMON\_WR & Continue reading up to four bytes sent by the SysMon and go to
\textit{ST\_SYSMON\_WR\_WB}\\
ST\_SYSMON\_WR\_WB & Perform a Wishbone write transfer to the register with the address obtained in
\textit{ST\_WB\_ADR} \\
ST\_SYSMON\_RD\_WB & Perform a Wishbone read transfer from the address obtained in
\textit{ST\_WB\_ADR} and go to \textit{ST\_SYSMON\_RD} \\
ST\_SYSMON\_RD & Shift out the four bytes of the Wishbone register when the \textit{i2c\_slave}
module successfully finishes a write \\
\hline
\end{tabular}
}
\end{table}
It should be noted that where the SysMon appears in the state names, it indicates
what the SysMon action is. That is, if the state of the FSM is \textit{ST\_SYSMON\_WR},
this means the SysMon is writing and the CONV-TTL-BLO is reading.
To better understand how the FSM operates, \textcolor{red}{BYTE ORDER FIGURES} can be consulted,
where each I$^2$C transfer is correlated to the current state of the FSM.
When reading from the SysMon, the \textit{vme64x\_i2c} module will wait in the
\textit{ST\_IDLE} state while the I$^2$C address is sent, then go to the
\textit{ST\_WB\_ADR} state to shift in the address. A Wishbone transfer is
simulated and if the address exists (a Wishbone \textit{ack} is received),
the first byte is shifted in while in the \textit{ST\_OP} state, followed
by the next three bytes while in the \textit{ST\_SYSMON\_WR} state. After that,
the register is written to in the \textit{ST\_SYSMON\_WR\_WB} state.
When writing to the SysMon, the first few steps are the same as for reading from it.
The address is shifted in and checked in the Wishbone transfer simulation state.
In the case of a SysMon reading from a board, however, the I$^2$C transfer
is restarted and the order is reversed (SysMon starts reading). Thus, while in
\textit{ST\_OP}, the FSM detects a different value of \textit{op\_o} and goes into
the \textit{ST\_SYSMON\_RD\_WB} state. Here, an actual Wishbone read transfer is
executed, the value of the register is read and sent via I$^2$C in the\\
\textit{ST\_SYSMON\_RD} state.
%==============================================================================
% Bibliography
%==============================================================================
\pagebreak
\bibliographystyle{ieeetr}
\bibliography{vme64x_i2c}
\end{document}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment