GEX thesis source code, full text, references
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gex-thesis/ch.unit.sipo.tex

78 lines
2.5 KiB

\section{SIPO (Shift Register) Unit}
The shift registers driver unit is designed for the loading of data into serial-in/parallel-out (SIPO) shift registers, such as 74xx4094 or 74xx595. These are commonly used to control segmented \gls{LED} displays, \gls{LED} user interfaces, etc.
\noindent
A SIPO shift register has the following digital pins:
\begin{itemize}[itemsep=0pt]
\item \textit{Shift} -- \gls{SCK}; shifts the data in the register by one bit
\item \textit{Data In} -- \gls{MOSI}; serial data to load into the register
\item \textit{Data Out} -- output for daisy-chaining with other shift registers
\item \textit{Store} -- latches the current register data and shows it at the outputs
\item \textit{Clear} -- erases the latched data and clears the display
\end{itemize}
This unit automatically handles both the \textit{Shift} and \textit{Store} signals, provides access to the \textit{Clear} output, and is capable of loading multiple shift registers in parallel (an arrangement sometimes used instead of daisy-chaining). The polarity (active level) of all signals can be configured.
It is, additionally, possible to set the data lines to arbitrary ``idle'' level(s) before sending the \textit{Store} pulse; this may be latched and used for some additional feature on the user interface, such as a brightness control.
\subsection{SIPO Configuration}
\begin{inicode}
[SIPO:display@9]
# Shift pin & its active edge (1-rising,0-falling)
shift-pin=A1
shift-pol=1
# Store pin & its active edge
store-pin=A0
store-pol=1
# Clear pin & its active level
clear-pin=A2
clear-pol=0
# Data port and pins
data-port=A
data-pins=3
\end{inicode}
\subsection{SIPO Commands}
The WRITE and CLEAR\_DIRECT commands are the only ones normally used. The others provide manual control over all the output signals for debugging or testing.
\begin{cmdlist}
0 & \cname{WRITE}
Load the shift registers and leave the \textit{Data} outputs in the ``trailing data'' state before sending a \textit{Store} pulse.
&
\begin{cmdreq}
\cfield{u16} trailing data (packed pins)
\item For each output (same size)
\begin{pldlist}
\cfield{u8[]} data to load
\end{pldlist}
\end{cmdreq}
\\
1 & \cname{DIRECT\_DATA}
Directly write to the \textit{Data} pin(s)
&
\begin{cmdreq}
\cfield{u16} values to write (packed pins)
\end{cmdreq} \\
2 &
\cname{DIRECT\_CLEAR}
Pulse the \textit{Clear} pin & \\
3 &
\cname{DIRECT\_SHIFT}
Pulse the \textit{Shift} pin & \\
4 &
\cname{DIRECT\_STORE}
Pulse the \textit{Store} pin & \\
\end{cmdlist}