Saturday, May 30, 2015

Setting up a Linux-only CentOS linux computer with Vivado/SDK

Install instructions for 64 bit computers:  CentOS 6.6, Vivado 2014.4, SDK 2014.4, cairo-1.10.2-3.el6.x86_64.rpm, cairo-devel-1.10.2-3.el6.x86_64.rpm, gtkterm-0.99.5-11.el6.x86_64.rpm

1.  CD of bootable CentOS disk.  find an image here:
http://centos.mirrors.hoobly.com/6.6/isos/x86_64/
Select CentOS-6.6-x86_64-bin-DVD1.iso

1a. add zynquser as root: 
login as root:  $ su
password: sphysics

Type visudo
add this line
zynquser ALL=(ALL)   ALL

1b. To switch the primary display monitor, type
xranr --current
This will tell you about the connected monitors.  Identify the monitor that is NOT listed as current.  Then type
xrandr --output XXXX --primary
Replace XXXX with the monitor that isn't current.

1c. Install missing libraries
https://sites.google.com/a/cs.ship.edu/fpga/centos-xilinx-14-x

We used the following two commands

  • sudo yum install libusb-devel autoconf automake dos2unix git kernel-headers kernel-devel ncurses-term
  • sudo yum install glibc.i686 ncurses-libs.i686 compat-libstdc++-33.i686


2.  Download latest version of Vivado and SDK

3.  Download cairo
http://fr2.rpmfind.net/linux/rpm2html/search.php?query=cairo&submit=Search+...

cairo-1.10.2-3.el6.x86_64.rpm

http://fr2.rpmfind.net/linux/rpm2html/search.php?query=cairo-devel&submit=Search+...&system=&arch=

cairo-devel-1.10.2-3.el6.x86_64.rpm

4.  Download gtkterm for CentOS 6.6

http://rpmfind.net/linux/rpm2html/search.php?query=gtkterm

gtkterm-0.99.5-11.el6.x86_64.rpm

5.  Download Zedboard Drivers from Digilent (instructions from Svenand blog:  http://svenand.blogdrive.com/archive/172.html#.VWoTqEQRGlM)
http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,66&Cat=12

Follow the instructions on the blog for the correct files and how to install and copy files to the right places.

6.  Download the zynqbook_tutorials and the zynqbook_tutorial_sources.
http://www.zynqbook.com/downloads.html

7.  If permissions become a problem, change the permissions of the following folders:
a.  If you are saving your projects in workspace, cd to the folder that holds workspace, then type:
chmod -R 777 workspace/
b.  Go to ~   type:  chmod -R 777 .Xil/
c.  cd to opt and type:
chmod -R 777 Xilinx/

Friday, May 29, 2015

http://smallbusiness.chron.com/add-second-hard-drive-set-up-dual-booting-70976.html

May 29 - GTKTERM

The following link gives a three step process on how to install gtkterm.
http://pkgs.org/centos-6/epel-i386/gtkterm-0.99.5-11.el6.i686.rpm.html


In the first step, this link is provided:
http://dl.fedoraproject.org/pub/epel/6/i386/


Open the previous link and look for:
epel-release-6-8.noarch.rpm
Click on this link and it will download. Then in the downloads folder, or at the bottom of your web browser, click the file to install it.

Then go to the terminal and type the following:
sudo yum install gtkterm


Directions to use gtkterm are in Sven's blog:
http://svenand.blogdrive.com/archive/173.html#.VWh9l9jbJ9A


At the beginning of the blog, it talks about permissions. Following these steps can help with that:
To check for the permissions, open a terminal and type:
          cd ..
          cd ..  (to move all the way out)
          cd dev (must be in this directory)
          ls -l ttyAMC0  (checks the permission)
If the permission is not crw-rw-rw, then type:
          sudo chmod 666 ttyACM0




Then we are able to follow the steps in Sven's blog.

Thursday, May 28, 2015

Helpful functions used in c programs

The following steps must be performed in the software application to enable reading from the
GPIO: 1) Initialize the GPIO, 2) Set data direction, and 3) Read the data

XGpio_Initialize (XGpio *InstancePtr, u16 DeviceId)
InstancePtr is a pointer to an XGpio instance. The memory the pointer references must be preallocated
by the caller. Further calls to manipulate the component through the XGpio API must
be made with this pointer.
DeviceId is the unique id of the device controlled by this XGpio component. Passing in a device
id associates the generic XGpio instance to a specific device, as chosen by the caller or
application developer.
XGpio_SetDataDirection (XGpio * InstancePtr, unsigned Channel, u32 DirectionMask)
InstancePtr is a pointer to the XGpio instance to be worked on.
Channel contains the channel of the GPIO (1 or 2) to operate on.
DirectionMask is a bitmask specifying which discretes are input and which are output. Bits set to
0 are output and bits set to 1 are input.
XGpio_DiscreteRead(XGpio *InstancePtr, unsigned channel)
InstancePtr is a pointer to the XGpio instance to be worked on.
Channel contains the channel of the GPIO (1 or 2) to operate on

May 28 - Code for turning the voltage from pmod on and off

We modified the tutorial one code to not only blink the LEDs but to turn the voltage from the pins of PMOD JA1 on and off. The following code is what we used:


/* LED_test.c
 *
 *  Created on:  13 June 2013
 *      Author:  Ross Elliot
 *     Version:  1.1
 */

/********************************************************************************************
* VERSION HISTORY
********************************************************************************************
* v1.1 - 27 January 2014
*  GPIO_DEVICE_ID definition updated to reflect new naming conventions in Vivado 2013.3
*  onwards.
*
* v1.0 - 13 June 2013
*  First version created.
*******************************************************************************************/


/********************************************************************************************
 * This file contains an example of using the GPIO driver to provide communication between
 * the Zynq Processing System (PS) and the AXI GPIO block implemented in the Zynq Programmable
 * Logic (PL). The AXI GPIO is connected to the LEDs on the ZedBoard.
 *
 * The provided code demonstrates how to use the GPIO driver to write to the memory mapped AXI
 * GPIO block, which in turn controls the LEDs.
 ********************************************************************************************/


/* Include Files */
#include "xparameters.h"
#include "xgpio.h"
#include "xstatus.h"
#include "xil_printf.h"


/* Definitions */
#define GPIO_DEVICE_ID  XPAR_AXI_GPIO_0_DEVICE_ID /* GPIO device that LEDs are connected to */
#define LED 0xC3         /* Initial LED value - XX0000XX */
#define PMOD 0xC3         /* Initial LED value - XX0000XX */
#define LED_DELAY 10000000       /* Software delay length */
#define LED_CHANNEL 1        /* GPIO port for LEDs */
#define PMOD_CHANNEL 1        /* GPIO port for PMODs */
#define printf xil_printf       /* smaller, optimised printf */
#define PMOD_JA1_DEVICE_ID  XPAR_AXI_GPIO_1_DEVICE_ID


XGpio Gpio, GpioP;           /* GPIO Device driver instance */


int LEDOutputExample(void)
{


 volatile int Delay;
 int Status;
 int led = LED; /* Hold current LED value. Initialise to LED definition */
 int pmod = PMOD;


  /* GPIO driver initialisation */
  Status = XGpio_Initialize(&Gpio, GPIO_DEVICE_ID);
  if (Status != XST_SUCCESS) {
   return XST_FAILURE;
  }
  Status = XGpio_Initialize(&GpioP, PMOD_JA1_DEVICE_ID);
   if (Status != XST_SUCCESS) {
    return XST_FAILURE;
  }


  /*Set the direction for the LEDs to output. */
  XGpio_SetDataDirection(&Gpio, LED_CHANNEL, 0x00);


  /*Set the direction for the LEDs to output. */
    XGpio_SetDataDirection(&GpioP, PMOD_CHANNEL, 0x00);


  /* Loop forever blinking the LED. */
   while (1) {
    /* Write output to the LEDs. */
    XGpio_DiscreteWrite(&Gpio, LED_CHANNEL, led);


    /* Flip LEDs. */
    led = ~led;


    /* Write output to the LEDs. */
    XGpio_DiscreteWrite(&GpioP, PMOD_CHANNEL, pmod);


    /* Flip LEDs. */
    pmod = ~pmod;


    /* Wait a small amount of time so that the LED blinking is visible. */
    for (Delay = 0; Delay < LED_DELAY; Delay++);
   }


  return XST_SUCCESS; /* Should be unreachable */
}


/* Main function. */
int main(void){


 int Status;


 /* Execute the LED output. */
 Status = LEDOutputExample();
 if (Status != XST_SUCCESS) {
  xil_printf("GPIO output to the LEDs failed!\r\n");
 }


 return 0;
}


This code is different from the code posted in the blog on May 27th because we changed these two lines:
#define PMOD 0xC3         /* Initial LED value - XX0000XX */
#define PMOD_CHANNEL 1        /* GPIO port for PMODs */
The following link explains why we have to use channel 1 even though channel one is already defined for the LEDs. It states that "The hardware must be built for dual channels if this function is used with any channel other than 1. If it is not, this function will assert."
http://stackoverflow.com/questions/16946270/xgpio-setdatadirection-xilinx-c-developer









Wednesday, May 27, 2015

May 27: Tutorial 1 modified code


We are working on modifying the Tutorial 1 code to light the LEDs and output voltage from the pmods at the same time.


/*
 * LED_test.c
 *
 *  Created on:  13 June 2013
 *      Author:  Ross Elliot
 *     Version:  1.1
 */

/********************************************************************************************
* VERSION HISTORY
********************************************************************************************
* v1.1 - 27 January 2014
*  GPIO_DEVICE_ID definition updated to reflect new naming conventions in Vivado 2013.3
*  onwards.
*
* v1.0 - 13 June 2013
*  First version created.
*******************************************************************************************/


/********************************************************************************************
 * This file contains an example of using the GPIO driver to provide communication between
 * the Zynq Processing System (PS) and the AXI GPIO block implemented in the Zynq Programmable
 * Logic (PL). The AXI GPIO is connected to the LEDs on the ZedBoard.
 *
 * The provided code demonstrates how to use the GPIO driver to write to the memory mapped AXI
 * GPIO block, which in turn controls the LEDs.
 ********************************************************************************************/


/* Include Files */
#include "xparameters.h"
#include "xgpio.h"
#include "xstatus.h"
#include "xil_printf.h"


/* Definitions */
#define GPIO_DEVICE_ID  XPAR_AXI_GPIO_0_DEVICE_ID /* GPIO device that LEDs are connected to */
#define LED 0xC3         /* Initial LED value - XX0000XX */
#define PMOD 0xC         /* Initial LED value - XX0000XX */
#define LED_DELAY 10000000       /* Software delay length */
#define LED_CHANNEL 1        /* GPIO port for LEDs */
#define PMOD_CHANNEL 2        /* GPIO port for PMODs */
#define printf xil_printf       /* smaller, optimised printf */
#define PMOD_JA1_DEVICE_ID  XPAR_AXI_GPIO_1_DEVICE_ID


XGpio Gpio, GpioP;           /* GPIO Device driver instance */


int LEDOutputExample(void)
{


 volatile int Delay;
 int Status;
 int led = LED; /* Hold current LED value. Initialise to LED definition */
 int pmod = PMOD;


  /* GPIO driver initialisation */
  Status = XGpio_Initialize(&Gpio, GPIO_DEVICE_ID);
  if (Status != XST_SUCCESS) {
   return XST_FAILURE;
  }
  Status = XGpio_Initialize(&GpioP, PMOD_JA1_DEVICE_ID);
   if (Status != XST_SUCCESS) {
    return XST_FAILURE;
  }


  /*Set the direction for the LEDs to output. */
  XGpio_SetDataDirection(&Gpio, LED_CHANNEL, 0x00);


  /*Set the direction for the LEDs to output. */
    XGpio_SetDataDirection(&GpioP, PMOD_CHANNEL, 0x00);


  /* Loop forever blinking the LED. */
   while (1) {
    /* Write output to the LEDs. */
    XGpio_DiscreteWrite(&Gpio, LED_CHANNEL, led);


    /* Flip LEDs. */
    led = ~led;


    /* Write output to the LEDs. */
    XGpio_DiscreteWrite(&GpioP, PMOD_CHANNEL, pmod);


    /* Flip LEDs. */
    pmod = ~pmod;


    /* Wait a small amount of time so that the LED blinking is visible. */
    for (Delay = 0; Delay < LED_DELAY; Delay++);
   }


  return XST_SUCCESS; /* Should be unreachable */
}


/* Main function. */
int main(void){


 int Status;


 /* Execute the LED output. */
 Status = LEDOutputExample();
 if (Status != XST_SUCCESS) {
  xil_printf("GPIO output to the LEDs failed!\r\n");
 }


 return 0;
}



Viper Motor/Brake Specifications

Brake
Volts: 90
Amps: 0.28

DC Motor
Stall             Amps      
Cont             23.0
Peak             90

Max Speed:   5000 RPM
Tach: 19.0 VDC/1000 RPM




Tuesday, May 26, 2015

Leds using the ZedBoard

LED Output

When connecting the Leds to the same voltage output using both the same color Leds (green and green or red and red) the Leds light up. When the colors are different (having a red and green in the same pin) the Leds will not light up. This is due to the fact that each of the colors have different voltages (red has a 2 volt requirement and green has a 3 volt requirement).

Note only green and red Leds were tested

How the lit LED light corresponds to PMOD pin voltage output

There are 8 LEDs on the board. LD0-LD3 correspond to the top row of pins on the PMOD, LD3 being the leftmost pin. LD4-LD7 correspond to the bottom row of pins, LD7 being the left most (this is not including the ground and power pins, etc).

For Example, if LD0, LD3, and LD7 are lit, then
-the right most pin on the top row will produce a voltage
-the left most pin on the top row will produce a voltage
-the left most pin on the bottom row will produce a voltage

***Again, by left most pin, I am only referring to the first four pins from the right end of the PMOD***

May 26 - Pmod and Max11205

Now we are using MAX11205PMB1 Peripheral Module and the following two links are the datasheets:
http://datasheets.maximintegrated.com/en/ds/MAX11205.pdf
http://datasheets.maximintegrated.com/en/ds/MAX11205PMB1.pdf


The second page of the second datasheet has the chart listed below which tells that we will only use pins 3 and 4.






PIN SIGNAL DESCRIPTION
1 N.C. Not connected
2 N.C. Not connected
3 MISO
Data-ready output/serial-data output.
This output serves a dual function.
In addition to the serial-data output
function, the MISO pin also indicates
that the data is ready when it is pulled
logic-low by the IC. Output data
changes on the falling edge of SCLK.
4 SCK
2-wire serial clock. The host must apply
an external clock signal to shift data
out from the IC.
5 GND Ground
6 VCC Power supply






Steps for completing the hardware part
1. Add GPIO > right click to make external
2. Double Click GPIO > customize to make all outputs
3. IP Configuration set GPIO Width to 8
4. Run Block Automation
5. Run Synthesis
6. Open Constraints Wizard > use page 3 and page 9 to link the pins
http://zedboard.org/sites/default/files/documentations/ZedBoard_RevD.2_Schematic_130516.pdf
Make sure under Configure tab > I/O Standard is LVCMOS33
7. Run Synthesis
8. Generate Bitstream and launch SDK
9. SDK may have to re-generate BSP sources (under system.mss)
10. Run the following code:


Using chapter two of this link (Page 7), we were able to load an .xise file in vivado.
http://www.xilinx.com/support/documentation/sw_manuals/xilinx2012_3/ug911-vivado-migration.pdf


Schematic Design Entry tool forum:
http://forums.xilinx.com/t5/Design-Entry/Schematic-Design-Entry-Tool-in-Vivado/td-p/278260
The entry at the bottom of the page may be a possible route to looking at the schematic diagram. We are in the process of downloading the program mentioned in this forum from this link:
http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/design-tools.html






Maxim User guide:
http://pdfserv.maximintegrated.com/en/an/UG5483.pdf

Friday, May 22, 2015

May 22 - PMOD

Steps for Pmod (using Tutorial 2 to read volatges from pmod) :
1. Add GPIO > right click to make external
2. Double Click GPIO > customize to make all outputs
3. IP Configuration set GPIO Width to 8
4. Run Block Automation
5. Run Synthesis
6. Open Constraints Wizard > use page 3 and page 9 to link the pins
http://zedboard.org/sites/default/files/documentations/ZedBoard_RevD.2_Schematic_130516.pdf
Make sure under Configure tab > I/O Standard is LVCMOS33
7. Run Synthesis
8. Generate Bitsream and launch SDK
9. SDK may have to re-generate BSP sources (under system.mss)
10. Run the following code:




#include "xparameters.h"
#include "xgpio.h"
#include "xscugic.h"
#include "xil_exception.h"
#include "xil_printf.h"
// Parameter definitions
#define INTC_DEVICE_ID   XPAR_PS7_SCUGIC_0_DEVICE_ID
#define BTNS_DEVICE_ID  XPAR_AXI_GPIO_0_DEVICE_ID
#define LEDS_DEVICE_ID  XPAR_AXI_GPIO_1_DEVICE_ID
#define PMOD_JA1_DEVICE_ID XPAR_AXI_GPIO_2_DEVICE_ID
#define INTC_GPIO_INTERRUPT_ID XPAR_FABRIC_AXI_GPIO_0_IP2INTC_IRPT_INTR
#define BTN_INT    XGPIO_IR_CH1_MASK
XGpio LEDInst, BTNInst, PMODJA1Inst;
XScuGic INTCInst;
static int led_data;
static int btn_value;
//----------------------------------------------------
// PROTOTYPE FUNCTIONS
//----------------------------------------------------
static void BTN_Intr_Handler(void *baseaddr_p);
static int InterruptSystemSetup(XScuGic *XScuGicInstancePtr);
static int IntcInitFunction(u16 DeviceId, XGpio *GpioInstancePtr);
//----------------------------------------------------
// INTERRUPT HANDLER FUNCTIONS
// - called by the timer, button interrupt, performs
// - LED flashing
//----------------------------------------------------

void BTN_Intr_Handler(void *InstancePtr)
{
 // Disable GPIO interrupts
 XGpio_InterruptDisable(&BTNInst, BTN_INT);
 // Ignore additional button presses
 if ((XGpio_InterruptGetStatus(&BTNInst) & BTN_INT) !=
   BTN_INT) {
   return;
  }
 btn_value = XGpio_DiscreteRead(&BTNInst, 1);
 // Increment counter based on button value
 // Reset if centre button pressed
 if(btn_value != 1) led_data = led_data + btn_value;
 else led_data = 0;
    XGpio_DiscreteWrite(&LEDInst, 1, led_data);
    XGpio_DiscreteWrite(&PMODJA1Inst, 1, led_data);
    (void)XGpio_InterruptClear(&BTNInst, BTN_INT);
    // Enable GPIO interrupts
    XGpio_InterruptEnable(&BTNInst, BTN_INT);
}
//----------------------------------------------------
// MAIN FUNCTION
//----------------------------------------------------
int main (void)
{
  int status;
  //----------------------------------------------------
  // INITIALIZE THE PERIPHERALS & SET DIRECTIONS OF GPIO
  //----------------------------------------------------
  // Initialize PMOD JA1
  status = XGpio_Initialize(&PMODJA1Inst, PMOD_JA1_DEVICE_ID);
  if(status != XST_SUCCESS) return XST_FAILURE;
  // Initialise LEDs
  status = XGpio_Initialize(&LEDInst, LEDS_DEVICE_ID);
  if(status != XST_SUCCESS) return XST_FAILURE;
  // Initialise Push Buttons
  status = XGpio_Initialize(&BTNInst, BTNS_DEVICE_ID);
  if(status != XST_SUCCESS) return XST_FAILURE;
  // Set PMODJA1 direction to for location  76543210   Pin 3 is an input, pin4 is an output
  XGpio_SetDataDirection(&PMODJA1Inst, 1, 0b00001000);
  // Set LEDs direction to outputs
  XGpio_SetDataDirection(&LEDInst, 1, 0x00);
  // Set all buttons direction to inputs
  XGpio_SetDataDirection(&BTNInst, 1, 0xFF);
  // Initialize interrupt controller
  status = IntcInitFunction(INTC_DEVICE_ID, &BTNInst);
  if(status != XST_SUCCESS) return XST_FAILURE;



  while(1);
  return 0;
}
//----------------------------------------------------
// INITIAL SETUP FUNCTIONS
//----------------------------------------------------
int InterruptSystemSetup(XScuGic *XScuGicInstancePtr)
{
 // Enable interrupt
 XGpio_InterruptEnable(&BTNInst, BTN_INT);
 XGpio_InterruptGlobalEnable(&BTNInst);
 Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
              (Xil_ExceptionHandler)XScuGic_InterruptHandler,
              XScuGicInstancePtr);
 Xil_ExceptionEnable();

 return XST_SUCCESS;
}
int IntcInitFunction(u16 DeviceId, XGpio *GpioInstancePtr)
{
 XScuGic_Config *IntcConfig;
 int status;
 // Interrupt controller initialisation
 IntcConfig = XScuGic_LookupConfig(DeviceId);
 status = XScuGic_CfgInitialize(&INTCInst, IntcConfig, IntcConfig->CpuBaseAddress);
 if(status != XST_SUCCESS) return XST_FAILURE;
 // Call to interrupt setup
 status = InterruptSystemSetup(&INTCInst);
 if(status != XST_SUCCESS) return XST_FAILURE;

 // Connect GPIO interrupt to handler
 status = XScuGic_Connect(&INTCInst,
            INTC_GPIO_INTERRUPT_ID,
            (Xil_ExceptionHandler)BTN_Intr_Handler,
            (void *)GpioInstancePtr);
 if(status != XST_SUCCESS) return XST_FAILURE;
 // Enable GPIO interrupts interrupt
 XGpio_InterruptEnable(GpioInstancePtr, 1);
 XGpio_InterruptGlobalEnable(GpioInstancePtr);
 // Enable GPIO and timer interrupts in the controller
 XScuGic_Enable(&INTCInst, INTC_GPIO_INTERRUPT_ID);

 return XST_SUCCESS;
}




We measured voltages from different pins when different buttons were pushed.












http://datasheets.maximintegrated.com/en/ds/MAX11205.pdf
http://datasheets.maximintegrated.com/en/ds/MAX11205PMB1.pdf

Troubleshooting Tutorial 4

Running through the Zynq Book Steps for Tutorial 4 is relatively straightforward, but there are three main errors that continuously occur:

Error 1: An internal exception has been detected. Vivado may be in an unstable state. Would you like to exit now?

Solution 1: This problem arises when we come to the "Create and Package IP" portion of the tutorial. To solve the problem, we must start the Vivado project from scratch, but this is very early on so not much progress is lost. 
            
               a) Create new Vivado Project
               b) Go to Project Settings in Flow Navigator
               c) Click IP settings (bottom entry on left)
               d) Change Vendor Name to whatever your project name is (in this case I called it                                  led_controller)





Error 2: IP Packager detects changes to source file; Error [Common 17-39] 'ipx:: merge-project-changes' failed due to earlier errors'.

Solution 2: Use caution when in "Edit Mode" of Vivado. This occurs after creating the IP and (as the tutorial explains, clicking edit IP) a new Vivado window opens. Here I made it to the end of the tutorial and was ready to program the FPGA in SDK. The above error is a syntax error and does not rear its ugly head until you are ready to run the program on the Zedboard. To fix the problem, follow the editing directions for both of the C files in "Edit Mode" very carefully. I had forgotten one comma at the end of a line. Do not do this. Check, double check, and triple check, seriously.





Error 3: "No such port ____". When connecting to the terminal after sending the program to the ZedBoard, I received an error in the port address. Even after finding which port the USB UART cable from the board is connected to, and entering it into the Terminal Settings window, the same "no such port" error is found. 

Solution 3: After consulting IT Ken, he told me it was probably a permissions issue. The port was accessible by the owner and the local group, but not the world. For our purposes, we were part of the world permissions. 

The port address is simply ttyACM0. 

You have to go into the terminal and navigate to the source folder where led_controller is located. Using the command:

ls -l led_controller_test_tut_4A.c 

shows that the file is only writable for owner and group, but not world (Ken's words).

Doing the same for the device (ls -l /dev/ttyACM0), shows that for the world, the device is only readable. We must change permissions for this:

[zynquser@localhost led_controller]$ sudo chmod 666 /dev/ttyACM0

Enter the FPGADesign password.

Use command:
ls -l /dev/ttyAMC0 to make sure the device is crw-rw-rw 1 dialout 166.

If it is (owner, group, and world can all read/write) you can enter the port address into the terminal window. The terminal should begin displaying the binary values corresponding to which LEDs were lighting up on the board. Taking a snapshot in time of both the LEDs and the terminal, you will find that the two match up and the program runs successfully. 


Thursday, May 21, 2015

May 21-PMod Pinout and Zedboard diagrams

The image on the right shows the pmod pinout.





The following link is a tutorial that flashes the LED lights in order and was the first step in understanding the peripheral modules (PMods). We were able to measure a voltage difference of 3.3 volts from GND to Vcc.
http://pdfserv.maximintegrated.com/en/an/UG5483.pdf






Here is a link that we used that shows the schematic diagram of the Zedboard
http://zedboard.org/sites/default/files/documentations/ZedBoard_RevD.2_Schematic_130516.pdf
Page 3 and 9 are most important.


Here is the link to the book that will help with programming.
http://www.iups.org/media/meeting_minutes/C.pdf








http://wiki.analog.com/resources/fpga/xilinx/pmod/ad7991
http://zedboard.org/content/pmod-using-sdk
https://avnet.egnyte.com/h-s/20120612/25deb8dc2f484c98

C/C++

This link has some common commands that are found in C/C++ and could possibly be found in code we are working with

http://www.skytopia.com/project/articles/compsci/programming.html


Wednesday, May 20, 2015

Altering the c file in Tutorial 1 (LED Test)

Dr. McColgan and I figured out how to alter the file in tutorial one to change how the LEDs blink.

Steps to alerting c file (will show everyone tomorrow)

Note: must have the tutorial 1 complete fully in order to do this!

  1. Open project in Vivado launch screen and choose the file that ends with .xpr
  2. Once loaded open block design in vivado (drop down should appear with file)
  3. Then open implemented design 
  4. Export to SDK like usual (make sure to launch SDK)
  5. When in SDK hit File>new application>name the file whatever you'd like>hit next>empty world > finish.
  6. Then click LED_test > src > right click (import) > browse > recently used > zynq_sources > first_zynq_design > OK
  7. Double click on the file (LED_test_tut_1C.c) to open it and manipulate it.
  8. After you manipulate it save the file as something else making sure you add the ".c" at the end. 
  9. You will notice that the file will have a red x on it this is because you cannot have two file sources so you will need to delete the original one (LED_test_tut_1C.c).
  10. From there you program the FPGA like normal then run the hardware.
I will show everyone tomorrow

Opening a Previous Project Can Save Time

As we all know, generating a bitstream in Vivado can take several minutes. When messing around in Vivado and SDK, a lot of time can be saved by opening a previous Vivado file that has the bitsream already generated, and implemented design finished. Once the old file is opened, assuming all the work done previously is correct, simply click 'Open Block Design' in the Flow Navigator, and then click 'Open Implemented Design' a bit further down the Flow Navigator. Once these steps have been taken, you can Export to SDK, which is much quicker than creating a new project every time.

Tutorial 4 First Error Solution

Tutorial 4:
Error: An internal exception has been detected. Vivado is unstable. (from Tools>Create and Package new IP)
Solution: Project manager > project settings > IP tab
Vendor value needs a valid value (cannot have "", blanks, or ( ) )
Change vendor value to Xilinx.com or MyFunWorkPlace.org


This solution was found on the following link:
 http://www.xilinx.com/support/answers/60477.html

Using the ZedBoard as a single board computer demo

I dont know if anyone is interested but I found information for plugging in the ZedBoard into a computer monitor and using it as the processing unit.

Here is the link:

http://www.xilinx.com/support/university/boards-portfolio/xup-boards/XUPZedBoard/ZedBoard-Single-Board-Computer-Demo.html

Tuesday, May 19, 2015

May 19 Summary Tutorials 1 and 2

Tutorial 1

For tutorial one we were introduced to Vivado, New Project Wizard and SDK. We also explored and integrated Vivado into the software application while finally exporting the software application to the ZedBoard.

Tutorial 2

In tutorial two we used Vivado again with further analysis incorporating existing IP from the Vivado IP. Later, we added the instances of the AXI GPIO twice. After we ran the connection automation for btns_5bits and /axi_gpio_0/GPIO once then did it a second time but this time we selected less_8bits for /axi_gpio_0/GPIO. After exporting the hardware to SDK we then ran this application on the ZedBoard to demonstrate how the interrupts are used. Finally, we returned to the file we created in Vivado but this time we modified additional sources and deleted connections from the processor to the GPIO. At the end this allowed for the buttons to control the LEDs to flash while allowing the LEDs to blink in one second increments.

May 19-Steps for Tutorial 1

Today we went through Tutorial 1 and 2 from the Zynq Book Tutorials.
Steps for Tutorial 1:
1. Create new project
2. Select ZedBoard Zynq Evaluation and Development Kit from the Boards tab
3. Create block design
4. Add IP (ZYNQ7 Processing System)
5. Run Block Automation
6. Add IP (AXI GPIO)
7. Run Connection Automation
8. Save block design
9. Validate design
10. Create HDL Wrapper (from sources tab)
11. Generate bitstream
12. Export Hardware (include bitstream)
13. Launch SDK (change workspace)
14. Open new application project
15. Expand project and import src
16. Click General > File System
17. Browse to find directory
18. Xilinx Tools > Program FPGA
19. Under Project Explorer right click to run-as project
20. Launch on Hardware

ZedBook Tutorials (Tips)

Make sure to load in the license before Generating the Bitstream. To do this follow these steps:

1. Select "Help" in Vivado
2. Go down to "Manage License"
3. It the "Load License" on the top left
4. Select "computer"
5. Then select "filesystems"
6. Then the "opt" folder
7. Select "Xilinx"
8. Finally "Xilinx.lic"


Next tip is to make sure you keep a folder to store all you work. This is helpful because if you want to find your work later it will be easier to find.

Some Basic Abbreviations

PL - programmable logic
PS - processing system
IDE - integrated development environment
SDK - software development kit
GPIO - general purpose input/output