Viktor Nikolov
Published © CC0

Designing a carrier card for MicroZed Zynq-7000 SOM

First steps in making practical use of the Zynq-7000 System on Module

AdvancedFull instructions provided1,259
Designing a carrier card for MicroZed Zynq-7000 SOM

Things used in this project

Hardware components

MicroZed
Tria Technologies MicroZed
MicroZed 7010 or 7020 System on Module with Zynq-7000
×1
JTAG-HS3 Programming Cable
Digilent JTAG-HS3 Programming Cable
×1
Texas Instruments TPS62082 1.2A High Efficient Step Down Converter
×1
Texas Instruments TXB0108 8-Bit Bidirectional Voltage-Level Translator
×1

Software apps and online services

KiCad
KiCad
Vivado Design Suite
AMD Vivado Design Suite
Vitis Unified Software Platform
AMD Vitis Unified Software Platform

Story

Read more

Schematics

KiCad 7.0 design files and production files for manufacturing

See repository's folder KiCad_and_production_files for schematics and PCB design created in KiCad 7.0. Also board production files ready for ordering manufacturing at JLCPCB are provided.

Schematics in PDF

Vivado diagram for the board Demo HW design

Code

board_demo.cpp

C/C++
Source code of the board demo application.
/*******************************************************************************
The demo does the following:

- Board's LED1 and LED2 blink with 2.5 Hz frequency.

- Board's SWITCH1 disables blinking of LED1. SWITCH2 disables LED2.

- Testing serial output is provided on the UART Micro-USB connector.
  - Connect your computer to the board's UART Micro-USB connector. A new COM port should became
    available in the operating system. Connect a terminal program (e.g. PuTTY) to given COM port, 
    set the speed to 9600 baud. You then shall see increasing series of numbers in the terminal (25 lines per second).
  - Activity of the board's serial output is also indicated by fast blinking yellow TX LED on the board.

- J3_1 provides the 3.3 V square wave signal of frequency 5 kHz, which is exactly ten thousand times
  de-scaled 50 MHz frequency signal from the oscillator X1.

- Other pins with odd pin number on J3, J4 and PMODs provide the square wave signal
  of frequency 166.6 Hz (5 V on PMOD1 and PMOD2, 3.3 V on other connectors).

- Pins with even pin number on J3, J4 and PMODs provide the square wave signal of frequency 80.6 Hz.

*******************************************************************************/

#include <vector>
#include "xil_printf.h"
#include "xgpiops.h"
#include "sleep.h"

#define PS_LED_PIN   47  //MIO pin 47 = PS LED on MicroZed

#define PL_LED_PIN   54  //= EMIO pin 0, connected to LEDs on the carrier board
#define PL_EVEN_PIN  55  //= EMIO pin 1, connected to even pins on the carrier board
#define PL_ODD_PIN   56  //= EMIO pin 2, connected to odd pins on the carrier board

XGpioPs GpioInstance;

int initialiseGPIO()
{
	XGpioPs_Config *GpioConfig;

	GpioConfig = XGpioPs_LookupConfig(XPAR_PS7_GPIO_0_DEVICE_ID);
	if(GpioConfig == NULL) {
		print("XGpioPs_LookupConfig failed\r\n");
		return XST_FAILURE;
	}

	int Status = XGpioPs_CfgInitialize(&GpioInstance, GpioConfig, GpioConfig->BaseAddr);
	if(Status != XST_SUCCESS) {
		print("XGpioPs_CfgInitialize failed\r\n");
		return XST_FAILURE;
	}

	//configure output pins
	const std::vector<int> outputPins = { PS_LED_PIN, PL_LED_PIN, PL_EVEN_PIN, PL_ODD_PIN  };
	for( auto p : outputPins ) {
		XGpioPs_SetDirectionPin(&GpioInstance, p,    1 /*set as output*/);
		XGpioPs_SetOutputEnablePin(&GpioInstance, p, 1 /*enable*/);
	}

    return XST_SUCCESS;
}


int main()
{
    print("***** MicroZed carrier board demo started *****\n\r");

    if( initialiseGPIO() != XST_SUCCESS )
    	return XST_FAILURE;

    const unsigned SLEEP_INTERVAL{100},
                   LED_TICKS{1999},     //  2.5 Hz
                   EVEN_PIN_TICKS{61},  // 80.6 Hz
                   ODD_PIN_TICKS{29};   //166.6 Hz
    unsigned LEDTickCounter{0}, EvenPinTickCounter{0}, OddPinTickCounter{0};
    unsigned LEDState{0}, EvenPinState{0}, OddPinState{0};

    while(1) {
        if( LEDTickCounter == LED_TICKS ) {
        	LEDTickCounter = 0;
        	LEDState = !LEDState;
        	XGpioPs_WritePin( &GpioInstance, PS_LED_PIN, LEDState );
        	XGpioPs_WritePin( &GpioInstance, PL_LED_PIN, LEDState );
        }
        else
        	LEDTickCounter++;

        if( EvenPinTickCounter == EVEN_PIN_TICKS ) {
        	EvenPinTickCounter = 0;
        	EvenPinState = !EvenPinState;
        	XGpioPs_WritePin( &GpioInstance, PL_EVEN_PIN, EvenPinState );
        }
        else
        	EvenPinTickCounter++;

        if( OddPinTickCounter == ODD_PIN_TICKS ) {
        	OddPinTickCounter = 0;
        	OddPinState = !OddPinState;
        	XGpioPs_WritePin( &GpioInstance, PL_ODD_PIN, OddPinState );
        }
        else
        	OddPinTickCounter++;

    	usleep( SLEEP_INTERVAL );
    }

    return 0; //never reaches to here
}

Board demo HW and SW

See repository's folder board_demo_hw_and_sw for sample HW design created in Vivado 2023.1 and demo SW application created in Vitis 2023.1

Credits

Viktor Nikolov
6 projects • 16 followers
I'm a former SW engineer, now program manager, who found electronics an exciting and challenging hobby.
Contact

Comments

Please log in or sign up to comment.