Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

XIlinx Microblaze first program problem

Status
Not open for further replies.

SUNBELT

Member level 2
Joined
Oct 4, 2005
Messages
42
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,652
I am trying to get Xilinx microblaze to do the simple operation like output = input, I don't want to include UART port or any other similar port to it at this point. (Later on I want it to work with an external RAM)
This is how I tried to do it:
1- In ISE I did "project\new source" and chose "Embedded systems"
2- double clicked on it and opened Xilinx Platform Studio" tool.
3- In XPS in "IP catalog" double clicked on "AXI General Purpose IO" and defined two (one input, one output) ports and called them DataIn and DataOut, and I made them external ports
4- Then "Export Hardware Design to SDK" open SDK tool, where I first did "File\new\board support package" and created "standalone_bsp_0"
5- Then "File\New\Application project" and select "use existing standalone_bsp_0" and "language C" and created a "Helloworld.c"
6. This is my code:


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "xparameters.h"
#include "xgpio.h"
#include "xutil.h"
 
//---------------------------------------------
 
int main(void)
{
    XGpio    DataIn, DataOut;
    int Read_input;
 
    XGpio_Initialize(&DataIn, XPAR_IN_DEVICE_ID);
    XGpio_SetDataDirection(&DataIn, 1, 0xffffffff);
 
    XGpio_Initialize(&DataOut, XPAR_OUT_DEVICE_ID);
    XGpio_SetDataDirection(&DataOut, 1, 0x00000000);
 
    while(1)
    {
        Read_input = XGpio_DiscreteRead(&DataIn, 1);
        XGpio_DiscreteWrite(&DataOut, 1, Read_input);
    }
}



7- I built the elf file and took it to ISE, I made a testbench in ISE and instantiated the microblaze, and apply CLK_P, CLK_N, RESET and DataIn, and DataOut, but the code doesn't work and dataOut stays 0. I think in my code I don't have access to my I/O ports (dataIn, and dataOut). I tried to use XIOModule instead of xgpio but SDK doesn't recognize #include "xiomodule.h" it gives me the error: Unresolved inclusion: "xiomodule.h"

What am I missing here?
 
Last edited by a moderator:

What am I missing here?
The posted project archive.

If you want a chance of some help, you should post the project archive so others don't have to try and duplicate what you have (it is highly unlikely that anyone will even try, I'm certainly not going to).

Regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top