OpenCores
URL https://opencores.org/ocsvn/gecko4/gecko4/trunk

Subversion Repositories gecko4

[/] [gecko4/] [trunk/] [GECKO4com/] [doc/] [input_output.tex] - Rev 4

Compare with Previous | Blame | View Log

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%            _   _            __   ____                                      %%
%%           / / | |          / _| |  __|                                     %%
%%           | |_| |  _   _  / /   | |_                                       %%
%%           |  _  | | | | | | |   |  _|                                      %%
%%           | | | | | |_| | \ \_  | |__                                      %%
%%           |_| |_| \_____|  \__| |____| microLab                            %%
%%                                                                            %%
%%           Bern University of Applied Sciences (BFH)                        %%
%%           Quellgasse 21                                                    %%
%%           Room HG 4.33                                                     %%
%%           2501 Biel/Bienne                                                 %%
%%           Switzerland                                                      %%
%%                                                                            %%
%%           http://www.microlab.ch                                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Input and Output}
\label{chap:IO}
The {\sc GECKO4com} provides input and output functionality by the
implementation of a VGA controller, button and switches, LEDs, and a RS232
pass-through. Each of these IO components will be discussed in this chapter.
%-----------------------------------------------------------------------------
\section{VGA controller}
\label{sec: vga}
The VGA controller provides a VGA screen at the resolution of 1024x768 by a
refresh rate of 60Hz. The screen can only display ASCII characters (so no
graphical mode is provided) and is divided into three display areas (see
Appendix~\ref{appen:4com}). The screen uses a simple 8-color palette as shown in
Figure~\ref{fig:vga color}. 
\begin{figure}[hb]
\centering%
\includegraphics[width=0.6\columnwidth]{figs/vga_colors}
\caption{The color palette as used by the VGA controller. The numbers above the
colors indicate the index for the foreground or background color.}
\label{fig:vga color}
\end{figure}
 
The VGA controller provides a 7-bit {\sc ASCII} table. As all implemented
commands use a byte to put characters on the screen, the $8^{\text{th}}$ bit is
used for color inversion. If the $8^{\text{th}}$ bit equals to \verb+0+ the character
pixels are displayed in the foreground color and the rest is displayed in the
background color. If the $8^{\text{th}}$ bit equals to \verb+1+ the character
pixels are displayed in the background color and the rest is displayed in the
foreground color. Each character consists of 16 lines each containing 8 pixels.
 
The three screens provided by the VGA controller are described below.
\begin{itemize}
\item \textbf{Static User Window (SUW).} This window displays a static contents
that is stored in the non-volatile memory of the {\sc GECKO4com}. The colors of
this window are fixed to a background color black (\verb+0+) and a foreground
color white (\verb+7+). The contents of this screen can be changed by the
\verb+*PUD+ command described in Chapter~\ref{sec: PUD}.
\item \textbf{USBTMC Message Window(UMW).} This window can be controlled by the
\verb+VGA:+ SCPI commandos described in Chapter~\ref{sec: vga commands}. At
startup the {\sc GECKO4com} initializes the foreground color to white (\verb+7+)
and the background color to black (\verb+0+). The cursor is always displayed and
blinks with a frequency of 1~Hz. This window scrolls automatically when the
cursor reaches the end of the screen; however, no scroll-back buffer is
provided.
\item \textbf{User FPGA Message Window (FMW).} This window can be controlled by the
the memory mapped registers described in Chapter~\ref{sec:mem map}. At
startup the {\sc GECKO4com} initializes the foreground color to red (\verb+4+)
and the background color to black (\verb+0+). The cursor is always displayed and
blinks with a frequency of 1~Hz. This window scrolls automatically when the
cursor reaches the end of the screen; however, no scroll-back buffer is
provided.
\end{itemize}
%-----------------------------------------------------------------------------
\section{Buttons, Switch and LEDs}
\label{sec:but switch}
The {\sc GECKO4com} provides three general purpose buttons and one hexswitch
(see Appendix~\ref{appen:4com}). The hexswitch can be manipulated by USBTMC
commandos (see Chapter~\ref{sec: hexswitch}) and read out by the user FPGA
through a memory mapped register (see Chapter~\ref{sec:mem map}). When reading
the register at address \verb+0x27+ the current value of the hexswitch is
returned in the lower 4 bits of the register. The resting bits are set to 0.
 
The state of the buttons can only be read out by the user FPGA through a memory 
mapped register (see Chapter~\ref{sec:mem map}). When reading the register at
address \verb+0x26+ the current state of the buttons is returned. The current
state is \verb+0+ when the button is not pressed and \verb+1+ otherwise. The
{\sc GECKO4com} returns the state of {\sc button1} in bit 0, {\sc button2} in
bit 1, and {\sc button3} in bit 2. All the other bits of this register are set
to 0.\\
\textit{Note: {\sc button3} has a special functionality; if this button is
pressed during power-on or during board reset the FX2 is prevented to load its
firmware stored in the {\sc GECKO4com}'s non-volatile memory.}\\
 
Besides the buttons and the switch, the {\sc GECKO4com} also controls eight
bi-color LEDs. During normal operation these LEDs can be controlled by the user
FPGA through memory mapped registers (see Chapter~\ref{sec:mem map}). Each LED
has a 4-bit control register. The values that can be written to these control
registers and the operation of the LED is listed in Table~\ref{tab:led cntrl}.
\begin{table}[t]
\centering%
\begin{tabular}{|c|l|}
\hline
\textbf{Value}&\textbf{LED function}\\
\hline
\hline
\verb+0x0+&LED is off\\
\hline
\verb+0x1+&LED is off\\
\hline
\verb+0x2+&LED is continues red\\
\hline
\verb+0x3+&LED is continues green\\
\hline
\verb+0x4+&LED is slowly blinking red\\
\hline
\verb+0x5+&LED is slowly blinking green\\
\hline
\verb+0x6+&LED is slowly toggling red-green\\
\hline
\verb+0x7+&LED is slowly toggling red-green\\
\hline
\verb+0x8+&LED is off\\
\hline
\verb+0x9+&LED is off\\
\hline
\verb+0xA+&LED is continues red\\
\hline
\verb+0xB+&LED is continues green\\
\hline
\verb+0xC+&LED is fast blinking red\\
\hline
\verb+0xD+&LED is fast blinking green\\
\hline
\verb+0xE+&LED is fast toggling red-green\\
\hline
\verb+0xF+&LED is fast toggling red-green\\
\hline
\end{tabular}
\caption{Values and function of the memory-mapped LED control register.}
\label{tab:led cntrl}
\end{table}
There are two situation in which the LEDs are controlled by the {\sc GECKO4com}:
\begin{enumerate}
\item In case of an identification command the LEDs light up as described in
Chapter~\ref{sec: main info}.
\item If the {\sc GECKO4com} is busy and cannot accept new command (for example during the erase of the non-volatile
memory), the LED7 will light up red and the other LEDs will be off.
\end{enumerate}
%-----------------------------------------------------------------------------
\section{RS232 pass-through}
The {\sc GECKO4com} provides two signals that are put on the external connector
and can be used for example as carriers for a RS232 communication protocol. The
signals on the connector are {\sc lvttl} whilst the signals on the user FPGA are
{\sc lvcmos25}. Table~\ref{tab:rs232} shows the signals and their pin on the user FPGA.
\begin{table}[h]
\centering%
\begin{tabular}{|l|l|l|}
\hline
\textbf{Name}&\textbf{Direction}&\textbf{Pin}\\
\hline
\hline
RS232TxD&{\sc output}&\verb+AF13+\\
\hline
RS232RxD&{\sc input}&\verb+Y16+\\
\hline
\end{tabular}
\caption{RS232 communication lines as provided on the user FPGA. Both these
signals are {\sc lvcmos25}.}
\label{tab:rs232}
\end{table}
%-----------------------------------------------------------------------------
\section{User clocks}
The {\sc genio1} connector on the {\sc GECKO4main} provides two user clocks.
These clocks are connected to the {\sc GECKO4com} for level adaptation. In the
{\sc GECKO4com} these two clocks are put on a Digital Loop Lock (DLL) for timing
compensation. The {\sc GECKO4com} provides the user clocks including a lock
signal to the user FPGA. If the lock signal is \verb+0+ the clocks should not be
used, and if the lock signal is \verb+1+ the clock is stable and locked by the
{\sc GECKO4com}. The DLL used in the {\sc GECKO4com} poses some restriction on
the user clocks. The restriction is the frequency range a user clock is allowed
to have. The user clocks must be in the range of [18MHz...167MHz] with a duty
cycle in between 40\% and 60\%. Table~\ref{tab:clocks} list the connections to the user
FPGA.
\begin{table}[h]
\centering%
\begin{tabular}{|l|l||l|l|}
\hline
\textbf{Signal}&\textbf{Pin}&
\textbf{Signal}&\textbf{Pin}\\
\hline
\hline
User Clock 1&\verb+AF14+&User Lock 1&\verb+AA9+\\
\hline
User Clock 2&\verb+AE14+&User Lock 2&\verb+AB9+\\
\hline
\end{tabular}
\caption{User Clock and User Lock signals on the user FPGA. All signals are {\sc
inputs} and of type {\sc lvcmos25}.}
\label{tab:clocks}
\end{table}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.