cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
992 Views
Registered: ‎04-05-2018

Where t find Zybo board details as required by the drivers

hi,

I have zybo 7020  board. In order to use the xgpio drivers for controlling led or switches on the board, xgpio drivers required information like led banks , channel and pin number to which led is connected. I could find the pin number of led as given in digilent website but could not find its channel and bank number. Can anyone suggest me where can i find such information?

 

Thank you.

0 Kudos
5 Replies
Highlighted
986 Views
Registered: ‎02-12-2018

Re: Where t find Zybo board details as required by the drivers

hi, you can find pin number and bank looking into the schematics of Z7. https://store.digilentinc.com/zybo-z7-zynq-7000-arm-fpga-soc-development-board/
Highlighted
Observer
Observer
965 Views
Registered: ‎04-05-2018

Re: Where t find Zybo board details as required by the drivers

thank you.

But led does not light up. I could not figure out problem 

 Here is the code for reference

 

#include <stdio.h>
#include "platform.h"
#include "xil_printf.h"
#include "xgpio.h"
#include "xparameters.h"

int main() {
XGpio led_gpio;
XGpio_Config *led_gpioconfig;
int status;

init_platform();

 

led_gpioconfig = XGpio_LookupConfig(XPAR_AXI_GPIO_0_DEVICE_ID);
status = XGpio_CfgInitialize(&led_gpio, led_gpioconfig,led_gpioconfig->BaseAddress);

if (status == 0) {
print("OK");
}

XGpio_SetDataDirection(&led_gpio, 1, 0x00000000);
XGpio_DiscreteSet(&led_gpio,1, 1);

print("Hello World\n\r");
cleanup_platform();
return 0;
}

0 Kudos
Highlighted
941 Views
Registered: ‎02-12-2018

Re: Where t find Zybo board details as required by the drivers

@creative, So you are working bare metal. Now I know what you meant by channel.

 

  1. explain what you tried to do
    • did you create a block design, generated a bitfile?
    • do you have a GPIO instance?
    • is it connected to the leds, on channel 1 or 2?
    • what have you tried before, did you step through your code?
    • etc
  2. format your code!
  3. comment your code

 

0 Kudos
Highlighted
932 Views
Registered: ‎02-12-2018

Re: Where t find Zybo board details as required by the drivers

your code should be fine, though.
0 Kudos
Highlighted
Observer
Observer
832 Views
Registered: ‎04-05-2018

Re: Where t find Zybo board details as required by the drivers

  • So you are working bare metal.

    Yes

  • did you create a block design, generated a bitfile?

    Yes. I have zynq processing system, connected to GPIO through AXI interconnect. All of them were connected by running connection automation. after that verifiy the design and then Synthesis, Implementation and generate bitstream. I have attached the block diagram and GPIO configuration below.Zyn.PNGGPIO Config.PNG

 

  • do you have a GPIO instance?

   Yes

  • is it connected to the leds, on channel 1 or 2?

  This is what i am not able to understand. On board LED is connected to pins D18,G14,M15 and M14. In XDC file , how to enter this mapping? And what are these channel 1 and 2, where do i find it? I know bank 0 and 1.

 

  • what have you tried before, did you step through your code?

i had controlled the led pin which is directly connected to PS.

 

  • etc.

I have done embedded programming but on fpga this is the first time. I have seen many tutorials about doing it so, but problem arises while using the drivers.

 

  1. format your code!

Format in the sense what? structure of code? lookwise?

2. comment your code

  Since i was just exploring this, so dint comment. But thanks for point it out.

 

Thank you for your reply and time.

 

 

GPIO config2.PNG
0 Kudos