Altera_Forum
Honored Contributor
14 years agogpio input and output
I have a de2-115 board and i'm trying to do some basic functions but i'm hitting a roadblock.
I used SOPC builder to create a system that has nios ii, two PIO interfaces where one is input and the other is output (2 bits each) and the sysid interface. Basically what i'm trying to do is retrieve an input from the GPIO (two pins that I chose), check whether they're high or low then send high or low to the output pins. My baby steps so far: -in the main verilog file (projectname.v) I declared the GPIO port: inout [35:0] GPIO; -in the structural part I picked the pins I'm going to use as in and out. outputa and inputa are the PIO interfaces. I hope that concatenation is correct .out_port_from_the_outputa({GPIO[5],GPIO[7]}), .in_port_to_the_inputa({GPIO[1],GPIO[3]}) -all pins are assigned correctly using the pin editor (confirmed) -everything compiles fine at this point -now in eclipse NIOS II IDE I want to do the basic functions that I outlined above. I want to take the signals at pins 1 and 3 of the GPIO, play around with them (not important) then send signals to GPIO pins 5 and 7. I'm a complete noob though and can't wrap my head around this. I've coded in C before but this is going right over my head. I know this should be extremely simple. Any pointers?