In vivado I added a AXI GPIO block and connected leds and buttons. Its says:
The vivado address editor shows an address 0x4120_0000
Then when I make an application:
XGpio_SetDataDirection(&gpio, 2, 0x00000000); // set LED GPIO channel tristates to All Output
XGpio_SetDataDirection(&gpio, 1, 0xFFFFFFFF); // set BTN GPIO channel tristates to All Input
btn = XGpio_DiscreteRead(&gpio, 1);
XGpio_DiscreteWrite(&gpio, 2, led);
And that works...
But how do I work out that the GPIO is channel 1 and 2 from Vivado... when what I had was those addresses ?
I want to work with pmods too but I am not sure how to get everything connected.
Question
jungle
Hello I have a Zynq Cora 7s.
I am adding some leds to control via software:
This is in the constraints:
#set_property -dict { PACKAGE_PIN L15 IOSTANDARD LVCMOS33 } [get_ports { led0_b }]; #IO_L22N_T3_AD7N_35 Sch=led0_b #set_property -dict { PACKAGE_PIN G17 IOSTANDARD LVCMOS33 } [get_ports { led0_g }]; #IO_L16P_T2_35 Sch=led0_g #set_property -dict { PACKAGE_PIN N15 IOSTANDARD LVCMOS33 } [get_ports { led0_r }]; #IO_L21P_T3_DQS_AD14P_35 Sch=led0_r #set_property -dict { PACKAGE_PIN G14 IOSTANDARD LVCMOS33 } [get_ports { led1_b }]; #IO_0_35 Sch=led1_b #set_property -dict { PACKAGE_PIN L14 IOSTANDARD LVCMOS33 } [get_ports { led1_g }]; #IO_L22P_T3_AD7P_35 Sch=led1_g #set_property -dict { PACKAGE_PIN M15 IOSTANDARD LVCMOS33 } [get_ports { led1_r }]; #IO_L23N_T3_35 Sch=led1_r
I can see the physical pins:
In vivado I added a AXI GPIO block and connected leds and buttons. Its says:
The vivado address editor shows an address 0x4120_0000
Then when I make an application:
XGpio_SetDataDirection(&gpio, 2, 0x00000000); // set LED GPIO channel tristates to All Output XGpio_SetDataDirection(&gpio, 1, 0xFFFFFFFF); // set BTN GPIO channel tristates to All Input btn = XGpio_DiscreteRead(&gpio, 1); XGpio_DiscreteWrite(&gpio, 2, led);
And that works...
But how do I work out that the GPIO is channel 1 and 2 from Vivado... when what I had was those addresses ?
I want to work with pmods too but I am not sure how to get everything connected.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.