Altera_Forum
Honored Contributor
14 years agoOutputting data to a GPIO pin??
Hello,
I'm having issues outputting data onto a GPIO pin. I wish to measure the output of a difference equation on an oscilloscope. I currently have a signal generator hooked up to the ADC pins, from there I take the values from the ADC and put it through the difference equation and the output from the difference equation goes through a PWM. Now I'm stuck at getting the PWM output onto a GPIO pin. In the SOPC builder, I have defined a PIO as GPIO_0 and as a one bit wide outptut. From there,in my bdf file, I have an output pin labeled GPIO_0[0] connected to it. In NIOS II, I know it creates a system.h file. From there I can find the GPIO_0_BASE. So in my C code, I'm trying to write the output of the PWM to GPIO_0_BASE as follows: IOWR(GPIO_0_BASE,0,PWM_OUT); I hoped this would output PWM_OUT to GPIO_0[0] and then the oscilloscope could read this but it doesn't work. By the way, I'm using a DE0 Nano. I have the ADC and difference equation working, I just can't get an output on the scope. Also, I know the difference equation is working because I have printf statements in my code printing out the output from the difference equation and the ADC and I have plotted them in Excel, verifying the output I should be seeing. Any help would be greatly appreciated! Thank You