Input an 8-bit value using a DIP switch

Input an 8-bit value using a DIP switch

In this article, I’ll show how I connected a DIP switch to input an 8-bit value to the Icezum Alhambra FPGA board (Ice40HX1k)

Material I used

Schematics

The DIP switch is an array of 8 SPST switches. We use the resistor array to connect the dip switch in a Pull-Up configuration.

  • When the switch is open, current will flow from Vcc to the PINs.
  • When the switch is closed, the pin will be brought down to ground.

Sample Circuit in IceStudio

In the circuit, the register enable is connected to “1” (always enabled). It can also be connected to the dbouncer, so that it will load only when button is pressed.

Written on June 8, 2018