Hardware Reference
In-Depth Information
133
begin
134
if rst_lcd='1' then
135
pr_state <= FunctionSet1;
136
elsif rising_edge(E) then
137
pr_state <= nx_state;
138
end if;
139
end process;
140
141
--FSM combinational logic:
142
process (all)
143
begin
144
case pr_state is
145
--Initialization:
146
when FunctionSet1 =>
147
RS <= '0';
148
DB <= "00111000";
149
nx_state <= FunctionSet2;
150
when FunctionSet2 =>
151
RS <= '0';
152
DB <= "00111000";
153
nx_state <= FunctionSet3;
154
when FunctionSet3 =>
155
RS <= '0';
156
DB <= "00111000";
157
nx_state <= FunctionSet4;
158
when FunctionSet4 =>
159
RS <= '0';
160
DB <= "00111000";
161
nx_state <= ClearDisplay;
162
when ClearDisplay =>
163
RS <= '0';
164
DB <= "00000001";
165
nx_state <= DisplayControl;
166
when DisplayControl =>
167
RS <= '0';
168
DB <= "00001100";
169
nx_state <= EntryMode;
170
when EntryMode =>
171
RS <= '0';
172
DB <= "00000110";
173
nx_state <= WriteHourT;
174
--Write data:
175
when WriteHourT =>
176
RS <= '1';
177
DB <= bcd_to_lcd(hourT);
178
nx_state <= WriteHourU;
179
when WriteHourU =>
180
RS <= '1';
181
DB <= bcd_to_lcd(hourU);
182
nx_state <= WriteColon1;
183
when WriteColon1 =>
184
RS <= '1';
185
DB <= "00111010";
186
nx_state <= WriteMinT;
187
when WriteMinT =>
188
RS <= '1';
189
DB <= bcd_to_lcd(minT);
Search WWH ::




Custom Search