Hardware Reference
In-Depth Information
and the states in the lower row (within a dashed rectangle) are responsible for the
actual data-writing procedure. Note that RS = '0' in the upper row, needed to write to
the instruction register, whereas RS = '1' in the lower row (except for state ReturnHome ),
so the writing occurs in the data register. R/W (not shown) is kept permanently low
(writing only).
In the initialization sequence of i gure 14.4a the same value was adopted for DB in
all four repetitions of the “Function set” instruction, with N = '1' (two-line operation)
and F = '0' (5
8-dot characters). In the “Entry mode” instruction the selected values
were I/D = '1' (DD RAM address incremented automatically) and S = '0' (display not
shifted).
The actual data-writing sequence (lower row, inside the dashed rectangle) depends
on the application. In i gure 14.4a a timed (category 2) machine is employed, which
writes a total of eight characters ( t running from 0 to 7) to the LCD, then returns to
the initial display address and overwrites those eight characters, repeating this loop
indei nitely.
Another data-writing example is presented in i gure 14.4b, this time with a regular
(category 1) machine (this is the FSM that will be implemented with VHDL in the
next section). It displays the digits of a digital clock, with tens of hours and units of
hours in the i rst two positions, then a colon, followed by tens and units of minutes
in the next two characters, then another colon, and i nally tens and units of seconds
in the last two positions, after which the machine repeats the loop, overwriting the
characters with the new readings. This FSM will implement the LCD driver, while the
values of DB ( hourT , hourU , minT , minU , secT , secU ) shown in i gure 14.4b are produced
by another circuit, responsible for implementing the timer proper. Note that DB =
“00111010” was used in states WriteColon1 and WriteColon2 , which corresponds to the
“:” character (check this in i gure 14.3).
The FSM of i gure 14.4 is simple enough to also be implemented using the pointer-
based technique described in chapter 15.
×
14.1.3 Complete Design Example: Clock with LCD Display
Figure 14.5 shows a digital clock that displays hours, minutes, and seconds on an
alphanumeric LCD. The circuit was divided into two blocks, with the i rst block imple-
menting the clock proper and the second block implementing the LCD driver.
The Clock block is controlled by i ve pushbuttons, as follows. Powers-of-two (simple
shifts) were chosen as speed-up factors to reduce the amount of hardware.
sec (adjustment of seconds): Increases the clock speed by a factor of 8.
min (adjustment of minutes): Increases the clock speed by a factor of 256.
hour (adjustment of hours): Increases the clock speed by a factor of 8192.
rst_clock (clock reset): Resets the clock (and so the display) to zero.
rst_lcd (LCD reset): Resets the FSM that implements the LCD driver.
Search WWH ::




Custom Search