wiki:HardwareUsersGuides/FPGABoard_v2.2/UserIO/warp_v4_userio

Version 6 (modified by sgupta, 15 years ago) (diff)

--

Custom User I/O Control Core

A custom core for user I/O control is available in the repository and during the base system builder process. The core allows the user to control the LEDs, read the push buttons and DIP switches and output patterns to the 7-segment displays. The core also implements the mapping of 4-bit hexadecimal characters to 7-bit patterns used to drive the 7-segment displays. This mapping is enabled per display at runtime by user designs.

Register Bank

The core has 5 registers that enable the I/O functionality. Register 0 and 1 are the output and input registers for the dedicated I/O, namely the LEDs, the push buttons and the DIP switch.

Functions

As we know, there are four peripherals controlled by the UserIO controller.

Dedicated LEDs:

The following function call directly writes to the LED outputs. The value should be 8-bits wide and the baseaddress is the base address of the UserIO core. The least significant bit corresponds to LED0.

WarpV4_UserIO_Leds(baseaddress, value)

Push Buttons:

The push button values can be read using the following function.

WarpV4_UserIO_PushB(baseaddress)

where baseaddress is the base address of the UserIO core. As noted previously, the bottom push button is used as the reset button in all XPS designs, hence the function returns a four bit value. The returned vector is arranged as follows: [Up, Left, Right, Center].

Dip Switch:

The dip switches can be read using the following function:

WarpV4_UserIO_DipSw(baseaddress)

where baseaddress is the base address of the UserIO core. The returned value is four bits wide.

Hex Displays:

There are two primary methods to control the hex displays: raw mode and number mode. The number mode allows the user to write the number desired to a register which is then appropriately converted to appear on the hex display. In raw mode, the user controls each bit individually. The three displays can be configured separately.

To configure the hex display for number mode choose one of the following functions:

WarpV4_UserIO_NumberMode_All(baseaddress)
WarpV4_UserIO_NumberMode_LeftHex(baseaddress)
WarpV4_UserIO_NumberMode_MiddleHex(baseaddress)
WarpV4_UserIO_NumberMode_RightHex(baseaddress)