7 Segment Displays

By xantus on Friday 5 March 2010 04:25 - Comments are closed
Category: Verilog examples, Views: 11.790

An easy way to add debug capabilities to your project is by using the 7-segment displays. The following piece of verilog code shows you how to control the 4 multiplexed common-cathode displays. The digitx inputs are BCD. The fifth bit (digitx[4]) is for blanking the digit (1=off, 0=on).

Read more »

VGA timing

By xantus on Thursday 4 March 2010 07:43 - Comments (1)
Category: Verilog examples, Views: 9.425

Figure 1 illustrates the basic timing requirements for each row (horizontal) that is displayed on a VGA monitor. An active-low pulse of specific duration (time a in the figure) is applied to the horizontal synchronization (hsync) input of the monitor, which signifies the end of one row of data and the start of the next. The data (RGB) input on the monitor must be driven low for a time period called the back porch (b) after the hsync pulse occurs, which is followed by the display interval (c).

Read more »

Rotary Encoder

By xantus on Monday 1 March 2010 20:24 - Comments are closed
Category: Verilog examples, Views: 6.029

The following code is for a rotary encoder with 2-bit gray code output. It has an 8-bit output which increases/decreases by rotating the rotary encoder

Read more »

PS/2 Keyboard Communication

By xantus on Thursday 18 February 2010 13:41 - Comments (1)
Category: Verilog examples, Views: 16.317

PS/2 keyboard communication is actually a very simply protocol too implement on a FPGA. The clock is provided by the keyboard and the data is sent in 11-bit frames. The frame-bits are:
  • 1 start bit; always 0
  • 8 data bits (LSB first)
  • 1 parity bit (odd parity)
  • 1 stop bit; always 1

Read more »

USB Communication (RS232)

By xantus on Wednesday 17 February 2010 08:01 - Comments (4)
Category: Verilog examples, Views: 5.673

The USB 2.0 capabilities are provided by the FT232RL, which is an USB to UART converter IC. So we just have to write some verilog to create an UART module to interface with the FT232RL for USB communication :) .
The verilog consists of 3 modules: baud_generator, uartrx and uarttx.

Read more »