Schlüsselwortarchiv

Du betrachtest das Archiv des Tags ZYBO.

• ZYBO board MIOs: Driving the LD4 LED using the BTN4 button

Just a quick and dirty non-tutorial solution on how to use the multiplexed I/Os (MIO/GPIO) to wire the BTN4 button on the ZYBO board (MIO50, the right one) to the LD4 LED (MIO7). Both are connected directly to the processing system and cannot be controlled from the fabric.

#include "platform.h"

#include "xparameters.h"
#include "xgpiops.h"
#include "xstatus.h"

#define GPIO_DEVICE_ID  XPAR_XGPIOPS_0_DEVICE_ID
#define OUTPUT_PIN		7	/* MIO7,  pin connected to LED */
#define INPUT_PIN		50	/* MIO50, pin connected to button */

int main()
{
int Status;
XGpioPs Gpio;
XGpioPs_Config *ConfigPtr;

// Initialize the system
init_platform();

// initialize the GPIO driver.
ConfigPtr = XGpioPs_LookupConfig(GPIO_DEVICE_ID);
if (Status != XST_SUCCESS) {
return XST_FAILURE;
}

// configure the LED pin as output
// status checks skipped for readability
XGpioPs_SetDirectionPin(&Gpio, OUTPUT_PIN, 1);
XGpioPs_SetOutputEnablePin(&Gpio, OUTPUT_PIN, 1);

// configure the button pin as input
XGpioPs_SetDirectionPin(&Gpio, INPUT_PIN, 0);

// wire the button to the LED (inverted)
while(1)
{
XGpioPs_WritePin(&Gpio, OUTPUT_PIN, !data);
}

return 0;
}


Note that when you open the system.mss file in SDK, you’ll find the ps7_gpio_0 entry under the Peripheral Drivers section. Click „Example“ there to find more information.

Because I desperately searched for something like that and found nothing, I just wrote a tutorial myself on how to start with the Xilinx PlanAhead workflow in ISE 14.7 when using the Digilent ZYBO board. Though I made this with the ZYBO in mind, the general workflow also applies to ZedBoard users and probably general Zynq boards as well.

It can be found at http://sunsided.github.io/zybo-tutorial/.

Basically the tutorial explains in about 120 pictures how to implement

LEDs <= Switches xor Buttons;


using the Xilinx tools. You can also find that nice picture of my fingers there, too.

If that ain’t something!

Edit:
Johann wrote a tutorial on using the ZYBO with Vivado on Linux. It can be found here.

• Xilinx SDK: make crashing with Interrupt/Exception

After exporting the implemented and generated project from PlanAhead to Xilinx SDK and having generated a Board Support Package, the build stops with an error due to make crashing with a rather dubious message along the lines of

make: Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3)


It turned out that this is due to an existing installation of Git, when the Git directory is added to the path. Specifically, sh.exe is the problem here and simply removing that from (or renaming it in) the Git installation directory solves the problem.

• Digilent ZYBO (Zynq-7010)

The ZYBO is an evaluation board for the Xilinx Zynq-7010 All-Programmable SoC made by Digilent. I got mine from Trenz Electronic at a reduced price for academic use.

I chose it over the ZedBoard (which I already have some experience with) because of the reduced size and since I don’t need the high-density I/O jack. It turns out though that the board is very small, yet quite heavy.

One thing to keep in mind though is that despite the rather large number of PMOD connectors, not all of them might be actually useful for a given task. The one on the left is connected to the Cortex processor, the right one is mixed analog/digital, and the three lower right ones are differential, leaving exactly the one on the lower left as a logic-dedicated PMOD for the FPGA (i.e. a single ended one that is connected directly to the FPGA, apart from the XADC one, of course).

I originally intended the board to be used to experiment with the OV7670 camera, but that might turn out to be a problem because of the PMODs. So: Caveat emptor.