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

Subversion Repositories gecko4

[/] [gecko4/] [trunk/] [GECKO4com/] [doc/] [input_output.tex] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 ktt1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
%%            _   _            __   ____                                      %%
3
%%           / / | |          / _| |  __|                                     %%
4
%%           | |_| |  _   _  / /   | |_                                       %%
5
%%           |  _  | | | | | | |   |  _|                                      %%
6
%%           | | | | | |_| | \ \_  | |__                                      %%
7
%%           |_| |_| \_____|  \__| |____| microLab                            %%
8
%%                                                                            %%
9
%%           Bern University of Applied Sciences (BFH)                        %%
10
%%           Quellgasse 21                                                    %%
11
%%           Room HG 4.33                                                     %%
12
%%           2501 Biel/Bienne                                                 %%
13
%%           Switzerland                                                      %%
14
%%                                                                            %%
15
%%           http://www.microlab.ch                                           %%
16
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17
\chapter{Input and Output}
18
\label{chap:IO}
19
The {\sc GECKO4com} provides input and output functionality by the
20
implementation of a VGA controller, button and switches, LEDs, and a RS232
21
pass-through. Each of these IO components will be discussed in this chapter.
22
%-----------------------------------------------------------------------------
23
\section{VGA controller}
24
\label{sec: vga}
25
The VGA controller provides a VGA screen at the resolution of 1024x768 by a
26
refresh rate of 60Hz. The screen can only display ASCII characters (so no
27
graphical mode is provided) and is divided into three display areas (see
28
Appendix~\ref{appen:4com}). The screen uses a simple 8-color palette as shown in
29
Figure~\ref{fig:vga color}.
30
\begin{figure}[hb]
31
\centering%
32
\includegraphics[width=0.6\columnwidth]{figs/vga_colors}
33
\caption{The color palette as used by the VGA controller. The numbers above the
34
colors indicate the index for the foreground or background color.}
35
\label{fig:vga color}
36
\end{figure}
37
 
38
The VGA controller provides a 7-bit {\sc ASCII} table. As all implemented
39
commands use a byte to put characters on the screen, the $8^{\text{th}}$ bit is
40
used for color inversion. If the $8^{\text{th}}$ bit equals to \verb+0+ the character
41
pixels are displayed in the foreground color and the rest is displayed in the
42
background color. If the $8^{\text{th}}$ bit equals to \verb+1+ the character
43
pixels are displayed in the background color and the rest is displayed in the
44
foreground color. Each character consists of 16 lines each containing 8 pixels.
45
 
46
The three screens provided by the VGA controller are described below.
47
\begin{itemize}
48
\item \textbf{Static User Window (SUW).} This window displays a static contents
49
that is stored in the non-volatile memory of the {\sc GECKO4com}. The colors of
50
this window are fixed to a background color black (\verb+0+) and a foreground
51
color white (\verb+7+). The contents of this screen can be changed by the
52
\verb+*PUD+ command described in Chapter~\ref{sec: PUD}.
53
\item \textbf{USBTMC Message Window(UMW).} This window can be controlled by the
54
\verb+VGA:+ SCPI commandos described in Chapter~\ref{sec: vga commands}. At
55
startup the {\sc GECKO4com} initializes the foreground color to white (\verb+7+)
56
and the background color to black (\verb+0+). The cursor is always displayed and
57
blinks with a frequency of 1~Hz. This window scrolls automatically when the
58
cursor reaches the end of the screen; however, no scroll-back buffer is
59
provided.
60
\item \textbf{User FPGA Message Window (FMW).} This window can be controlled by the
61
the memory mapped registers described in Chapter~\ref{sec:mem map}. At
62
startup the {\sc GECKO4com} initializes the foreground color to red (\verb+4+)
63
and the background color to black (\verb+0+). The cursor is always displayed and
64
blinks with a frequency of 1~Hz. This window scrolls automatically when the
65
cursor reaches the end of the screen; however, no scroll-back buffer is
66
provided.
67
\end{itemize}
68
%-----------------------------------------------------------------------------
69
\section{Buttons, Switch and LEDs}
70
\label{sec:but switch}
71
The {\sc GECKO4com} provides three general purpose buttons and one hexswitch
72
(see Appendix~\ref{appen:4com}). The hexswitch can be manipulated by USBTMC
73
commandos (see Chapter~\ref{sec: hexswitch}) and read out by the user FPGA
74
through a memory mapped register (see Chapter~\ref{sec:mem map}). When reading
75
the register at address \verb+0x27+ the current value of the hexswitch is
76
returned in the lower 4 bits of the register. The resting bits are set to 0.
77
 
78
The state of the buttons can only be read out by the user FPGA through a memory
79
mapped register (see Chapter~\ref{sec:mem map}). When reading the register at
80
address \verb+0x26+ the current state of the buttons is returned. The current
81
state is \verb+0+ when the button is not pressed and \verb+1+ otherwise. The
82
{\sc GECKO4com} returns the state of {\sc button1} in bit 0, {\sc button2} in
83
bit 1, and {\sc button3} in bit 2. All the other bits of this register are set
84
to 0.\\
85
\textit{Note: {\sc button3} has a special functionality; if this button is
86
pressed during power-on or during board reset the FX2 is prevented to load its
87
firmware stored in the {\sc GECKO4com}'s non-volatile memory.}\\
88
 
89
Besides the buttons and the switch, the {\sc GECKO4com} also controls eight
90
bi-color LEDs. During normal operation these LEDs can be controlled by the user
91
FPGA through memory mapped registers (see Chapter~\ref{sec:mem map}). Each LED
92
has a 4-bit control register. The values that can be written to these control
93
registers and the operation of the LED is listed in Table~\ref{tab:led cntrl}.
94
\begin{table}[t]
95
\centering%
96
\begin{tabular}{|c|l|}
97
\hline
98
\textbf{Value}&\textbf{LED function}\\
99
\hline
100
\hline
101
\verb+0x0+&LED is off\\
102
\hline
103
\verb+0x1+&LED is off\\
104
\hline
105
\verb+0x2+&LED is continues red\\
106
\hline
107
\verb+0x3+&LED is continues green\\
108
\hline
109
\verb+0x4+&LED is slowly blinking red\\
110
\hline
111
\verb+0x5+&LED is slowly blinking green\\
112
\hline
113
\verb+0x6+&LED is slowly toggling red-green\\
114
\hline
115
\verb+0x7+&LED is slowly toggling red-green\\
116
\hline
117
\verb+0x8+&LED is off\\
118
\hline
119
\verb+0x9+&LED is off\\
120
\hline
121
\verb+0xA+&LED is continues red\\
122
\hline
123
\verb+0xB+&LED is continues green\\
124
\hline
125
\verb+0xC+&LED is fast blinking red\\
126
\hline
127
\verb+0xD+&LED is fast blinking green\\
128
\hline
129
\verb+0xE+&LED is fast toggling red-green\\
130
\hline
131
\verb+0xF+&LED is fast toggling red-green\\
132
\hline
133
\end{tabular}
134
\caption{Values and function of the memory-mapped LED control register.}
135
\label{tab:led cntrl}
136
\end{table}
137
There are two situation in which the LEDs are controlled by the {\sc GECKO4com}:
138
\begin{enumerate}
139
\item In case of an identification command the LEDs light up as described in
140
Chapter~\ref{sec: main info}.
141
\item If the {\sc GECKO4com} is busy and cannot accept new command (for example during the erase of the non-volatile
142
memory), the LED7 will light up red and the other LEDs will be off.
143
\end{enumerate}
144
%-----------------------------------------------------------------------------
145
\section{RS232 pass-through}
146
The {\sc GECKO4com} provides two signals that are put on the external connector
147
and can be used for example as carriers for a RS232 communication protocol. The
148
signals on the connector are {\sc lvttl} whilst the signals on the user FPGA are
149
{\sc lvcmos25}. Table~\ref{tab:rs232} shows the signals and their pin on the user FPGA.
150
\begin{table}[h]
151
\centering%
152
\begin{tabular}{|l|l|l|}
153
\hline
154
\textbf{Name}&\textbf{Direction}&\textbf{Pin}\\
155
\hline
156
\hline
157
RS232TxD&{\sc output}&\verb+AF13+\\
158
\hline
159
RS232RxD&{\sc input}&\verb+Y16+\\
160
\hline
161
\end{tabular}
162
\caption{RS232 communication lines as provided on the user FPGA. Both these
163
signals are {\sc lvcmos25}.}
164
\label{tab:rs232}
165
\end{table}
166
%-----------------------------------------------------------------------------
167
\section{User clocks}
168
The {\sc genio1} connector on the {\sc GECKO4main} provides two user clocks.
169
These clocks are connected to the {\sc GECKO4com} for level adaptation. In the
170
{\sc GECKO4com} these two clocks are put on a Digital Loop Lock (DLL) for timing
171
compensation. The {\sc GECKO4com} provides the user clocks including a lock
172
signal to the user FPGA. If the lock signal is \verb+0+ the clocks should not be
173
used, and if the lock signal is \verb+1+ the clock is stable and locked by the
174
{\sc GECKO4com}. The DLL used in the {\sc GECKO4com} poses some restriction on
175
the user clocks. The restriction is the frequency range a user clock is allowed
176
to have. The user clocks must be in the range of [18MHz...167MHz] with a duty
177
cycle in between 40\% and 60\%. Table~\ref{tab:clocks} list the connections to the user
178
FPGA.
179
\begin{table}[h]
180
\centering%
181
\begin{tabular}{|l|l||l|l|}
182
\hline
183
\textbf{Signal}&\textbf{Pin}&
184
\textbf{Signal}&\textbf{Pin}\\
185
\hline
186
\hline
187
User Clock 1&\verb+AF14+&User Lock 1&\verb+AA9+\\
188
\hline
189
User Clock 2&\verb+AE14+&User Lock 2&\verb+AB9+\\
190
\hline
191
\end{tabular}
192
\caption{User Clock and User Lock signals on the user FPGA. All signals are {\sc
193
inputs} and of type {\sc lvcmos25}.}
194
\label{tab:clocks}
195
\end{table}

powered by: WebSVN 2.1.0

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