从ISE14.7使用Micoblaze点亮led灯

2. XPS

从ISE14.7使用Micoblaze点亮led灯

2.1 create new xps program using BSB wizard => PLCsystem

从ISE14.7使用Micoblaze点亮led灯

2.1 base system builder => welcome => new design

board => custom board

从ISE14.7使用Micoblaze点亮led灯

 system => single-processor system

从ISE14.7使用Micoblaze点亮led灯

processor =>

从ISE14.7使用Micoblaze点亮led灯

peripheral => add device  => IO interface type => GPIO ;Device =>LEDS

从ISE14.7使用Micoblaze点亮led灯

 GPIO Data Width => 8

 从ISE14.7使用Micoblaze点亮led灯

cache => summary

 XPS  => project => export hardware design to SDK

 从ISE14.7使用Micoblaze点亮led灯

export  only

从ISE14.7使用Micoblaze点亮led灯

Done!

从ISE14.7使用Micoblaze点亮led灯

  

3.  返回ISE

右键  => add copy  of  source

 从ISE14.7使用Micoblaze点亮led灯

 

data 下的 UCF 文件

打开并修改

 从ISE14.7使用Micoblaze点亮led灯

 

选中

再RUN => generate  top  HDL souce

 从ISE14.7使用Micoblaze点亮led灯

 

完成后 如图

 从ISE14.7使用Micoblaze点亮led灯

export hardware design ti sdk with 

 从ISE14.7使用Micoblaze点亮led灯

4. Xilinx SDK

  File => New =>application project

 从ISE14.7使用Micoblaze点亮led灯

代码如下:

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


int main()
{
    char m=0x01;
    //init_platform();
    while(1){
        for(m=0;m<8;m++){
            XGpio_WriteReg(0x41200000,0,1<<m);
            sleep(1);
        }
        //printf("Hello World!\n%ld\n\r",m);
    }
    return 0;
}

 

save

生成可执行文件

 从ISE14.7使用Micoblaze点亮led灯

run configurations

从ISE14.7使用Micoblaze点亮led灯

 

 

RUN

//调试下载

 

//也可以从ISE下载

返回ISE 右键top文件 add copy source

bootloop下的 elf 文件

 从ISE14.7使用Micoblaze点亮led灯

 下载

 

相关文章: