How can the pushbutton switches on the MIO be accessed from Software?
I have enabled the GPIO on the MIO in the Zynq tab in EDK. (The UART1 is also enabled, so the GPIOs fil up the rest of the MIO)
I have tried reading from pins 50 and 51 (for the pushbuttons on the Zedboard but can't read the value from the pushbuttons. e.g.
pushButton= XGpioPs_ReadPin(&Gpio,50);
pushButton= XGpioPs_ReadPin(&Gpio,51);
I've also tried reading the memory locations directly around the address 0xe000a000 but can't see any changes when I press the push buttons.
I'm initialising the pointer like the example, and it seems to give the correct base address:
ConfigPtr = XGpioPs_LookupConfig(XPAR_PS7_GPIO_0_DEVICE_ID);
Status = XGpioPs_CfgInitialize(&Gpio, ConfigPtr, ConfigPtr->BaseAddr);
tt
On a related issue, I routed the dipswitches on the board through the EMIO, and found the driver functions did not work correctly. e.g. XGpioPs_ReadPin(&Gpio, pin);
I found the switches were mapped to the memory address Gpio.GpioConfig.BaseAddr+16, not Gpio.GpioConfig.BaseAddr which I think the XGpioPs_ReadPin was trying to read from. I could work around this because I could see where the GPIO were mapped in memory, but I can't see where the pushbuttons are mapped, or even if they are conneted properly.
Have I missed a step somewhere, or am I trying to use the GPIO in the wrong way? Any help or advice appreciated.