Community
cancel
Showing results for 
Search instead for 
Did you mean: 

NEEK GPIO (Debug) Connector

NEEK GPIO (Debug) Connector


Overview

The Nios II Embedded Evaluation Kit, Cyclone III Edition (NEEK) has, as one of its many features, a "Debug" connector that can also be used as an 8-bit bi-directional GPIO port. This is a 10-pin shrouded header located on the LCD Daughter Card next to the RJ-45 Ethernet connector. Unfortunately the documentation for this functionality is limited, hard to find, and somewhat incorrect. This page attempts to clarify the the configuration and use of the GPIO functionality by providing a complete Quartus II/Qsys version 11.0 sp1 hardware design as well as a modified "Count Binary" example Nios II software application to demonstrate the implementation of the GPIO port on the NEEK sytem. The hardware design is an extension of the niosii-ethernet-standard-3c25 Triple Speed Ethernet Quartus II project included in the Simple Socket Server Design Example which can be found on Altera's Website at:

www.altera.com/support/examples/nios2/exm-hello_world.html

GPIO Data Path

Like all the other features on the NEEK LCD Daughter Card, the GPIO signals must pass through the high-speed mezzanine (HSMC) connector to get from one board to the other. In addition, the GPIO (Debug) signals also pass through a bi-directional level shifter (U12) and are controlled by an Altera MAXII CPLD which modifies the connections to these signals depending on the Mode configuration. Consequently, a number of steps must be followed to make the GPIO signals available to the Cyclone III. This project defines and uses the GPIO signals as outputs and excercises them with the modified Count Binary Nios II application. The information provided on this page should make it readilay apparent as to how individual GPIO pins could be change to inputs or bi-directional signals.

Connecting the GPIO to the Cyclone III

The following steps were used to create this project and make the GPIO (Debug) header available to the Cyclone III FPGA:

  1. Download and unzip the Simple Socket Server Design Example files from the link shown above to a new project directory.
  2. From the newly created project directory double-click theniosii_ethernet_standard_3c25.qpf to luanch the hardware design in Quartus II.
  3. Launch Qsys from within Quartus II and load the peripheral_system.qsys file.
  4. Modify button_pio component in peripheral_system.qsys Basic Settings to change Width from 2 to 4 to enable buttons 1 through 4.
  5. Modify led_pio component in peripheral_system.qsys Basic Settings to change Width from 2 to 4 to enable LED 1 through 4.
  6. Add a new PIO component in peripheral_system.qsys and rename it gpio_pio.
  7. Modify the newly added gpio_pio component in peripheral_system.qsys Basic Settings with the following settings:
  8.  Width = 8
  9. Direction = Output,
  10.  Output Register = Enable individual bit setting/clearing.
  11. Modify peripheral_system.qsys System Contents to re-assign base addresses to accommodate the additional button and LED bits plus the added GPIO bits.
  12. Re-generate and save the peripheral_system.qsys.
  13. Open the eth_std_main_system.qsys
  14. Set the peripheral_subsystem component address to 0x00000000(Base) and 0x000000ff(End).
  15. Export the gpio_pio_external_connection as gpio_pio
  16. Re-generate and save eth_std_main_system.qsys
  17. Make the following changes to the Quartus II project:
  18. Update the eth_std_main_system symbol in the Quartus II top level Block Diagram File to incorporate the chages made in Qsys.
  19. In the Pin Planner change button_pio[1] Location from PIN_F1 to PIN_F2
  20. In the Pin Planner change button_pio[0] Location from PIN_F2 to PIN_F1
  21. In the Pin Planner add Node Name gpio[7] and assign it to Location PIN_H2
  22. In the Pin Planner add Node Name gpio[6] and assign it to Location PIN_C1
  23. In the Pin Planner add Node Name gpio[5] and assign it to Location PIN_C2
  24. In the Pin Planner add Node Name gpio[4] and assign it to Location PIN_T16
  25. In the Pin Planner add Node Name gpio[3] and assign it to Location PIN_R16
  26. In the Pin Planner add Node Name gpio[2] and assign it to Location PIN_N15
  27. In the Pin Planner add Node Name gpio[1] and assign it to Location PIN_K5
  28. In the Pin Planner add Node Name gpio[0] and assign it to Location PIN_L5
  29. In the Pin Planner Change button_pio[1] Location from PIN_F1 to PIN_F2
  30. Re-compile the Quartus II project and program the NEEK with the new SOF file.

Enabling the Debug Port

One more step before the GPIO will work, and it comes with a bit of a catch. It seems that in order to conserve resources, the 8 data bits used for the GPIO interface are also used for the LCD video decoder. As they connot server both purposes at the same time, you must select the operating mode suited to your application. For the GPIO and/or Debug option, you must select Mode 1.

A common utility application is provided that allows you to change the EEPROM data or the Mode Control Register value stored in the MAX II Device's user flash memory. Perform the following steps to set the board to Mode 1:


Before using this tool, make sure the USB cable is connected to between the development kit board and the host PC.

  1. From the directory: <install dir>/board_design_files/LCD_multimedia_hsmc/ tools/HMB2_Configuration_Utility/, launch HMB2_CONFIG.exe.
  2. There should be a .sof file in this directory (HMB2_CONFIG.sof) that will automatically download into the FPGA and the application will display Connected when communications is established with the downloaded design. (If any error message is shown, please check the power and USB cable, then press Connect button to re- configure FPGA.)

EEPROM_Utility.jpg (Click here for image)


Hardware Design Files

www.alterawiki.com/wiki/File:Neek_enet_gpio.zip#file

Attachments
Version history
Revision #:
1 of 1
Last update:
‎06-25-2019 08:51 PM
Updated by:
 
Contributors